03-24-2006 2:45 PM
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
03-24-2006 2:47 PM
Hi,
You can us ethe method GET_COMPUTER_NAME in the class
CL_GUI_FRONTEND_SERVICES.
Regards,
Suresh Datti
03-24-2006 2:47 PM
Hi,
You can us ethe method GET_COMPUTER_NAME in the class
CL_GUI_FRONTEND_SERVICES.
Regards,
Suresh Datti
03-24-2006 2:49 PM
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
03-24-2006 2:48 PM
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.
03-24-2006 2:57 PM
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
03-24-2006 3:15 PM
03-24-2006 3:20 PM
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