on 07-27-2009 10:12 AM
Hi ALL.
call method cl_gui_frontend_services=>get_user_name
changing
user_name = win_username
exceptions
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
others = 5.
call method cl_gui_cfw=>flush.
When i run the function . win_username return is null.
Thanks!
james
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
thanks for your reply.
call method cl_gui_frontend_services=>get_user_name
changing
user_name = win_username
exceptions
cntl_error = 2
error_no_gui = 3
not_supported_by_gui = 4
others = 5.
call method cl_gui_cfw=>flush.
If i run it direct then can get user_name, but if i run it in backgroud then return is null.
the selection is same.
james
What exactly are you trying to do? Do you really need the desktop client user id or will the SAP or Portal user ID work? You simply can't use the CL_GUI_* classes in Web Dynpro ABAP. Best you could do is to call a BSP application first that contain the necessary ActiveX calls to get the windows user id. You can then pass the information via URL parameter as you navigate from the BSP application to the WDA.
If you are talking about a batch job, then what exactly does this have to do with Web Dynpro ABAP? Just because something is company policy doesn't mean it is possible. In fact it doesn't really make sense. When you run in a batch job you only have a connection to the user the job runs under. Why would you need to the know the windows user ID? None of this makes any sense.
Get the windows user id for whom? Just for the current logged in user? Even if CL_GUI_FRONTEND_SERVICES worked in the background or in WDA - that's all it would give you. Are you trying to get the Windows User for all SAP accounts? If so it wouldn't make sense to use CL_GUI_FRONTEND_SERVICES to do that. It just sees via the OS on the desktop who is currently logged in. If that is the case then it sounds something like you should do with the LDAP connector and lookup via a central direcotry (like perhaps Microsoft Active Directory).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi James,
The cl_gui_frontend_services=>get_user_name is SAP GUI specific and you cannot use this from your broswer. Try go through these threads where the same issue has been discussed even earlier:
[Fetching login details from portal and passing to web dynpro.How its done?|;
[windows user name in webdynpro abap|;
[WD Abap - get system (windows) user|;
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.