Application Development 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: 

system fields

Former Member
0 Kudos

hello friends,

i need some help from u, is there any system variable to findout the system (workstation) name becz i have print this when i print a smartform alont with the username

so as sy-uname is there any variable exists to identify the workstation name where i am working currently

if so plz let me know otherwise please guide me how to find out this

thanks in adavanse

1 ACCEPTED SOLUTION

suresh_datti
Active Contributor
0 Kudos

Hi,

You can us ethe method GET_COMPUTER_NAME in the class

CL_GUI_FRONTEND_SERVICES.

Regards,

Suresh Datti

6 REPLIES 6

suresh_datti
Active Contributor
0 Kudos

Hi,

You can us ethe method GET_COMPUTER_NAME in the class

CL_GUI_FRONTEND_SERVICES.

Regards,

Suresh Datti

0 Kudos

You can use the method from the class CL_GUI_FRONTEND_SERVICES. Make sure that you flush to the frontend.




report zrich_0001 .

data: name type string.

call method cl_gui_frontend_services=>get_computer_name
  changing
    computer_name        = name.

<b>call method cl_gui_cfw=>flush.</b>


write:/ name.


Regards,

Rich Heilman

Former Member
0 Kudos

Hi naveenkumar,

1.Not only the workstation name,

u can also get the IP Address.

2. use this FM

TERMINAL_ID_GET

3. In that u will have to split

the text

for getting ip address and computer name.

regards,

amit m.

former_member188685
Active Contributor
0 Kudos
REPORT  ZTEST_IPGET                             .

DATA: BEGIN OF USR_TABL OCCURS 10.
        INCLUDE STRUCTURE UINFO.
DATA: END OF USR_TABL.

DATA:TH_OPCODE(1)  TYPE X.
DATA: IPADDR(30).

CONSTANTS: OPCODE_LIST  LIKE TH_OPCODE VALUE 2.

CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_LIST
ID 'TAB' FIELD USR_TABL-*SYS*.



LOOP AT USR_TABL.

  CALL FUNCTION 'GWY_IPADR2STRING'
    EXPORTING
      IPADR  = USR_TABL-HOSTADR
    IMPORTING
      STRING = IPADDR.

  WRITE:/ USR_TABL-BNAME ,USR_TABL-TERM, IPADDR.
ENDLOOP.

check the above code , it will give sytem name , ip address.

Regards

Vijay

Former Member
0 Kudos

thanks alot dudes proble solved

Former Member
0 Kudos
chk this also

report ychatest .

data: name(25).

    CALL FUNCTION 'GUI_GET_DESKTOP_INFO'
      EXPORTING
        type          = 1
      changing
        return        = name
              .
write : name.

different options for type

1:  Host name (host name of current system)

2:  Windows directory

3:  System directory

4:  Temp. directory

5:  Domain user name

6:  Platform

7:  Windows build number

8:  Windows version

9:  Program name

10: Program path

Message was edited by: Sekhar