CMOD->SUSR0001
*&---------------------------------------------------------------------*
*& 包含 ZXUSRU01
*&---------------------------------------------------------------------*
DATA:lv_sblm_obj TYPE sblm_obj.
CALL FUNCTION 'ZFMBS_RECORD_LOGIN'
EXPORTING
i_obj = lv_sblm_obj.
SE24->CL_SBLM_SERVER_API 方法:WILL_CAUSE_RABAX
METHOD WILL_CAUSE_RABAX.
try.
r_rabax_flag = cl_sblm_kernel_api=>_will_cause_rabax(
exporting i_type = i_type i_obj = i_obj i_name = i_name i_clas = i_clas ).
catch CX_SY_DYN_CALL_ILLEGAL_METHOD ##NO_HANDLER.
endtry.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$\SE:(1) Class CL_SBLM_SERVER_API, Method WILL_CAUSE_RABAX, End A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZEN_BS_RECORD_TC. "active version
DATA:lv_task TYPE string VALUE 'NEW_TASK'.
CALL FUNCTION 'ZFMBS_RECORD_LOGIN' STARTING NEW TASK lv_task
EXPORTING
i_obj = i_obj.
ENDENHANCEMENT.
*$*$-End: (1)---------------------------------------------------------------------------------$*$*
ENDMETHOD.
封装函数:
FUNCTION zfmbs_record_login.
*"----------------------------------------------------------------------
*"*"本地接口:
*" IMPORTING
*" VALUE(I_OBJ) TYPE SBLM_OBJ
*"----------------------------------------------------------------------
DATA:lt_ztbs_002 TYPE TABLE OF ztbs_002.
DATA:lw_ztbs_002 TYPE ztbs_002.
DATA:ip TYPE string.
CALL METHOD cl_gui_frontend_services=>get_ip_address
RECEIVING
ip_address = ip
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
DATA: opcode_usr_attr(1) TYPE x VALUE 5,
terminal TYPE usr41-terminal.
CALL 'ThUsrInfo' ID 'OPCODE' FIELD opcode_usr_attr ID 'TERMINAL' FIELD terminal.
CALL METHOD zcl_common=>create_guid(
IMPORTING
e_guid = lw_ztbs_002-guid ).
lw_ztbs_002-uname = sy-uname.
lw_ztbs_002-ccmdatum = sy-datum.
lw_ztbs_002-ccmsyuzeit = sy-uzeit.
lw_ztbs_002-ipadr = ip.
lw_ztbs_002-compname = terminal.
lw_ztbs_002-tcode = i_obj.
APPEND lw_ztbs_002 TO lt_ztbs_002.
IF lt_ztbs_002[] IS NOT INITIAL.
MODIFY ztbs_002 FROM TABLE lt_ztbs_002[].
COMMIT WORK AND WAIT.
ENDIF.
ENDFUNCTION.