设中国护士网为首页 | 中国护士网专注于知识的分享,因为专注,所以更好!
分享到:

获取当前用户进程的两种方法

来源:  作者:saplogon

方法一:
  data: begin of wp_tabl occurs 10.
          include structure wpinfo.
  data: end of wp_tabl.
  data: with_cpu type x value 0,
        inum type i.
call function 'TH_WPINFO'
      exporting
        with_cpu = with_cpu
      tables
        wplist   = wp_tabl
      exceptions
        others   = 0.
wp_tab1即进程表
方法二:
DATA OPCODE            TYPE X.
DATA: BEGIN OF USR_TABL OCCURS 10.
        INCLUDE STRUCTURE UINFO.
DATA: END OF USR_TABL.
 CLEAR USR_TABL.
 FREE  USR_TABL.
* set the function call mode
  OPCODE = 2.
* get list of all users actually logging on
  CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE
                   ID 'TAB' FIELD USR_TABL-*SYS*.
  SORT USR_TABL BY BNAME TCODE.
USR_TABL即用户进程表