ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 记录USER 登陆SAP 的IP Address

记录USER 登陆SAP 的IP Address

原创 Linux操作系统 作者:ytfsrs2008 时间:2009-02-13 08:23:42 0 删除 编辑
在Function module      SUSR_LOGON_USER_EXIT的第36行
* Kundenexit
  CALL CUSTOMER-FUNCTION '001'.
后,添加如下的ABAP代码
* Funktionen die erst nach evt. Prüfungen in Kundenexit ablaufen sollen:
*{   INSERT         SDQK9A14W4                                        1
CALL FUNCTION 'ZCFA_CHECK_USER' .

*}   INSERT

以下为具体Function 'ZCFA_CHECK_USER'的代码:
FUNCTION zcfa_check_user.
*"----------------------------------------------------------------------
*"*"Local interface:
*"----------------------------------------------------------------------
  DATA: usr_tabl LIKE uinfo OCCURS 0.
  DATA: z_usrip LIKE zusrip OCCURS 0 WITH HEADER LINE.
  DATA: z_usripl LIKE zusripl OCCURS 0 WITH HEADER LINE.
  DATA: zterminal LIKE usr41-terminal.
  DATA:t_terminal LIKE  zusrip-terminal.
  DATA:t_term LIKE  zusrip-term.
  DATA: one(3) TYPE c, two(3) TYPE c, three(3) TYPE c, four(3) TYPE c.
  DATA:opcode_list(1)  TYPE x VALUE 2.
  DATA:opcode_delete_usr(1) TYPE x VALUE 20.
  DATA: BEGIN OF usr_tabl1 OCCURS 10.
          INCLUDE STRUCTURE uinfo.
  DATA: END OF usr_tabl1.
  DATA:p_temp(1) TYPE c.
  SELECT SINGLE * FROM zpcli
       WHERE zmandt = sy-mandt
         AND pgmna = 'ZCFA_CHECK_USER'.
  IF sy-subrc = 0 .

    z_usrip-mandt = sy-mandt.
    z_usrip-bname = sy-uname.

    CALL FUNCTION 'TERMINAL_ID_GET'
         EXPORTING
              username             = sy-uname
         IMPORTING
              terminal             = zterminal
         EXCEPTIONS
              multiple_terminal_id = 1
              no_terminal_found    = 2
              OTHERS               = 3.
    SPLIT zterminal AT '-' INTO t_terminal t_term.
    z_usrip-terminal = t_terminal.
    z_usrip-term = t_term.
    z_usrip-from_date = '20080901'.
    z_usrip-to_date = '20091231'.
    z_usrip-ldate = sy-datum.
    z_usrip-ltime = sy-uzeit.
    APPEND z_usrip. CLEAR z_usrip.
    MODIFY zusrip FROM TABLE z_usrip.
  ENDIF.
Endfunction.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15117617/viewspace-550345/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-10-31

  • 博文量
    52
  • 访问量
    50090