如何让abap程序暂停? [英] How to make an abap program pause?

查看:41
本文介绍了如何让abap程序暂停?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于测试目的,我需要我的 ABAP 程序等待几秒钟.这怎么办?

For testing purposes I need my ABAP program to wait for few seconds. How can this be done?

推荐答案

2个解决方案:

1) 要么使用 WAIT最多……几秒钟.

WAIT UP TO 42 SECONDS.
WAIT UP TO '0.5' SECONDS. " decimals are possible since ABAP 7.40 SP 8

  • 推出并发布工作流程给听众
  • 执行隐式数据库提交
  • 当 CPU 进程非常宝贵并且隐式提交不会损坏您的数据或由于打开的数据库游标而导致短转储时使用它.

    Use it when CPU processes are at a premium and when the implicit commit will not corrupt your data or cause a short dump because of an open database cursor.

    2) 或者使用功能模块ENQUE_SLEEP:

    2) Or use the function module ENQUE_SLEEP:

        CALL FUNCTION 'ENQUE_SLEEP'
          EXPORTING
            seconds = 42.
    

    • 不发布工作流程
    • 不会导致隐式数据库提交
    • 当您负担不起隐式提交时使用它,并且系统可以处理在 SLEEP 命令期间被占用的工作进程.

      Use it when you cannot afford an implicit commit, and the system can handle the work process(es) being tied up for the duration of the SLEEP command.

      这篇关于如何让abap程序暂停?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆