Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

function module for user name of windows XP

Former Member
0 Likes
760

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
621

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.

4 REPLIES 4
Read only

Former Member
0 Likes
621

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

Read only

Former Member
0 Likes
621

Check out this related thread

Use FM GUI_GET_DESKTOP_INFO

Read only

Former Member
0 Likes
622

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. 

Read only

Former Member
0 Likes
621

Hi,

Use function WS_QUERY with parameters

ENVIRONMENT = 'USERNAME'

QUERY = 'EN'

USERDOMAIN instead of USERNAME gives NT domain.

Reward if helpfull...

Cheers,

Sruti.