2008 May 15 4:58 PM
hi ,all.
I want to get the function module , which can get user name of windows XP for SAP client in abap.
Any helps will beappreciated .
Thanx.
2008 May 15 5:11 PM
Check out this below code ..
DATA: USERNAME 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.
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
WRITE : USERNAME.
hi ,all.
I want to get the function module , which can get user name of windows XP for SAP client in abap.
Any helps will beappreciated .
Thanx.
2008 May 15 5:04 PM
Hi,
Try the below FM's...
GUI_GET_DESKTOP_INFO Returns information about the end-users desktop
TH_USER_INFO Returns information about user
Hope it is helpful...
Regards,
Chithra
2008 May 15 5:06 PM
2008 May 15 5:11 PM
Check out this below code ..
DATA: USERNAME 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.
CALL METHOD CL_GUI_CFW=>FLUSH
EXCEPTIONS
CNTL_SYSTEM_ERROR = 1
CNTL_ERROR = 2
OTHERS = 3.
WRITE : USERNAME.
2008 May 16 7:59 AM
Hi,
Use function WS_QUERY with parameters
ENVIRONMENT = 'USERNAME'
QUERY = 'EN'
USERDOMAIN instead of USERNAME gives NT domain.
Reward if helpfull...
Cheers,
Sruti.