04-18-2005 10:39 AM
Hi all,
Is there a way to find out in an ABAP program the name of the local PC from which the user is running this program? (it runs in foreground)
An user can be logged on from several PC's at the same time so we need to know exactly from which PC he's working...
thanks,
Ioana
04-18-2005 10:44 AM
Hi,
Go to SM04 transaction which gives the list of users logged on to SAP & their PC details.
Hope this clarifies your doubt.
Rgds,
04-18-2005 10:44 AM
Hi,
Go to SM04 transaction which gives the list of users logged on to SAP & their PC details.
Hope this clarifies your doubt.
Rgds,
04-18-2005 10:55 AM
Hi,
The problem is that the user can be logged on from several PC's at the same time. How do I know from which PC he's running my program?
Thanks,
Ioana
04-18-2005 10:59 AM
Hi,
In your ABAP Program , you can use the FM TH_USER_INFO to determine that.
Don't forget to reward if it helps...:-)
Regards,
Anand Mandalika.
04-18-2005 10:56 AM
04-18-2005 11:05 AM
Hi,
try this:
CALL METHOD cl_gui_frontend_services=>get_computer_name
CHANGING
computer_name = str.
CALL METHOD cl_gui_cfw=>flush.
Andreas
06-07-2005 12:36 PM
Hi Andreas,
this one is working fine, if I'm connected with the SAPGUI. Do you know, if this is also working with portals? Our users are using Portals in Production, but we don't have them in Development to test this.
Thanks for a hint
Chris
04-18-2005 10:59 AM
Hi Ioana,
I hope you had a chance to look at my answer to your VB script/Word template question... (I think it may be a cleaner way of solving your problem)
Anyway, to answer this question, try the following:
* Include at the top of your program:
INCLUDE RSUSRCOM.
INCLUDE TSKHINCL.
* Direct kernel call to get user data.
call 'ThUsrInfo' id 'OPCODE' field opcode_list
id 'TAB' field usr_tabl-*sys*.
* The table usr_tabl-*sys* will be populated with a list of users
* and the terminal they are logged on with.
This is quite a technical solution, and as its a direct kernel call, it may not be very upgrade compatible, but it will provide the data you are looking for.
Cheers,
Brad
04-19-2005 3:44 PM
FM-> GUI_GET_DESKTOP_INFO
& type will be one of the following depends upon your requirement.
Computername...........1..
Windows Directory......2..
System Directory.......3..
Temp Directory.........4..
User Name (Desktop)....5..
Platform...............6..
Build Number...........7..
OS Version.............8..
Program Name...........9..
Program Path...........10.
Current Directory......11.
Desktop Directory......12.
thanks
sai