天天看點

ABAP事務碼SAT裡的Gross time and net time

Created by Jerry Wang, last modified on Oct 06, 2014

以一個簡單的例子說明:

REPORT ztest22.
START-OF-SELECTION.
  PERFORM main.
  CALL FUNCTION 'ZTIME_SPENT'
    EXPORTING
      iv_time = 2.
  CALL FUNCTION 'ZTIME_SPENT'
    EXPORTING
      iv_time   = 1
      iv_nested = abap_true.
  WRITE:/ 'finish'.
FORM main.
  WAIT UP TO 1 SECONDS.
ENDFORM.
      

ZTIME_SPENT的實作:

CHECK iv_time > 0.

WAIT UP TO iv_time SECONDS.

IF iv_nested = abap_true.
   CALL FUNCTION 'ZTIME_SPENT2'
      EXPORTING
         iv_time = iv_time.
ENDIF.
      
CHECK iv_time > 0.

WAIT UP TO iv_time SECONDS.
      

CHECK iv_time > 0.

WAIT UP TO iv_time SECONDS.

繼續閱讀