User's PC Name

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
santosh_sks
Posts: 15
Joined: Wed May 23, 2007 2:15 am

User's PC Name

Post by santosh_sks » Wed Feb 18, 2009 4:11 am

Hi All,

How can I get User's PC Name in a Z program. I want to do this because a single sap-id is used by several persons & I want to allow only one person to execute one of my Z program & that through his PC Name.

Regards
Santosh
Regards
Santosh

Rich
Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool
Contact:

Re: User's PC Name

Post by Rich » Wed Feb 18, 2009 6:24 am

You probably won't get an answer to this because what you are attempting to do is in violation of your Production system license.
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com

ese_pinche_ABAP
Posts: 297
Joined: Tue Mar 01, 2005 12:57 pm

Re: User's PC Name

Post by ese_pinche_ABAP » Wed Feb 18, 2009 8:30 am

You may be able to get information you can use via transaction sm04 (User List) which shows the terminal, although it does not show the PC name.

Rich
Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool
Contact:

Re: User's PC Name

Post by Rich » Wed Feb 18, 2009 8:42 am

ese_pinche_ABAP wrote:You may be able to get information you can use via transaction sm04 (User List) which shows the terminal, although it does not show the PC name.
<sigh>

Ok,

Code: Select all

Data: o_FrontEnd type ref to CL_GUI_FRONTEND_SERVICES,
      w_Test type String.

Create Object o_FrontEnd.
Call Method o_FrontEnd->Get_Computer_Name
  Changing
     Computer_Name = w_Test.
Write:/ w_test.
Free o_FrontEnd.
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com

YuriT
Posts: 885
Joined: Fri Feb 03, 2006 6:40 am
Location: Basel/Riga

Re: User's PC Name

Post by YuriT » Wed Feb 18, 2009 10:02 am

Or you can implement a password in your program and give it to one person.

MattG
Posts: 809
Joined: Wed Oct 23, 2002 2:06 pm
Location: England

Re: User's PC Name

Post by MattG » Wed Feb 18, 2009 11:50 am

Just remember: in the next office reorganisation your user will have a new desk, IP address and if they are lucky a new PC. So you will have to change your code, (and at a busy time at that).
MattG.
Image Search SAPfans

Rich
Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool
Contact:

Re: User's PC Name

Post by Rich » Wed Feb 18, 2009 3:40 pm

And you are still breaking your SAP license.....
Regards

Rich

Image
Abap KC:http://www.richard-harper.me.uk/Kb
SFMDR:http://www.se37.com

santosh_sks
Posts: 15
Joined: Wed May 23, 2007 2:15 am

Re: User's PC Name

Post by santosh_sks » Fri Feb 20, 2009 3:22 am

Thank you all. The problem has been solved.
Regards
Santosh

Post Reply