ITPub博客

首页 > Linux操作系统 > Linux操作系统 > sap 获取windows登陆用户函数

sap 获取windows登陆用户函数

原创 Linux操作系统 作者:ultraluck 时间:2019-01-04 20:21:05 0 删除 编辑

FUNCTION ZIEB_RFC_CHECK04.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" EXPORTING
*" VALUE(USERNAME) TYPE STRING
*" VALUE(DOMAINNAME) TYPE STRING
*"----------------------------------------------------------------------

CALL METHOD cl_gui_frontend_services=>get_user_name
CHANGING
user_name = username
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL METHOD cl_gui_frontend_services=>environment_get_variable
EXPORTING
variable = 'USERDOMAIN'
CHANGING
value = domainname
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
cntl_system_error = 1
cntl_error = 2
OTHERS = 3.

ENDFUNCTION.

[@more@]

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

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

注册时间:2004-12-03

  • 博文量
    135
  • 访问量
    99100