REPORT z_barry_test3 NO STANDARD PAGE HEADING.
TABLES: tstc,tstct.
DATA: ok_code(20).
DATA: BEGIN OF itab OCCURS 10.
INCLUDE STRUCTURE uinfo2.
DATA: END OF itab.
START-OF-SELECTION.
PERFORM triger.
WRITE:/ '.....'.
AT USER-COMMAND.
CASE ok_code.
WHEN 'TRIG'.
WRITE:/ sy-uzeit. "Time
PERFORM getdata.
PERFORM write.
PERFORM triger.
ENDCASE.
*---------------------------------------------------------------------*
* FORM WHEN_FINISHED *
*---------------------------------------------------------------------*
FORM on_finished USING taskname.
* RECEIVE RESULTS FROM FUNCTION 'RFC_PING_AND_WAIT'.
SET USER-COMMAND 'TRIG'.
ok_code = 'TRIG'.
* sy-ucomm = 'TRIG'.
ENDFORM. "when_finished
*---------------------------------------------------------------------*
* FORM getdata *
*---------------------------------------------------------------------*
FORM getdata.
CLEAR itab.
REFRESH itab.
CALL FUNCTION 'TH_LONG_USR_INFO'
EXPORTING
user = '*'
TABLES
user_info = itab.
SORT itab BY client user terminal tcode.
ENDFORM.
*---------------------------------------------------------------------*
* FORM write *
*---------------------------------------------------------------------*
FORM write.
LOOP AT itab .
SELECT SINGLE ttext FROM tstct INTO tstct-ttext
WHERE sprsl = sy-langu AND
tcode = itab-tcode.
TRANSLATE tstct-ttext TO UPPER CASE.
WRITE:/ itab-session,
itab-client,
itab-user,
itab-terminal,
itab-tcode,
itab-time,
itab-lang,
tstct-ttext.
ENDLOOP.
sy-lsind = 0.
ENDFORM.
*---------------------------------------------------------------------*
* FORM triger *
*---------------------------------------------------------------------*
FORM triger.
CALL FUNCTION 'RFC_PING_AND_WAIT'
STARTING NEW TASK '001'
PERFORMING on_finished ON END OF TASK
EXPORTING
seconds = 4
busy_waiting = ' ' .
ENDFORM.
阅读(5755) | 评论(5) | 转发(0) |