2006 Oct 12 11:09 AM
Hi,
If you go to command prompt, type IPCONFIG/all then you will get the physical address. Is it possible to know the same from SAP. Is there any FM or Class to get the same.
I got the IP Address using the class
CALL METHOD cl_gui_frontend_services=>get_ip_address
Thanks and Regards,
Prakash.
2006 Oct 12 11:13 AM
Hello Prakash,
Use this Fm /SDF/SYSTEM_INFO.
If useful reward.
Vasanth
Hi,
If you go to command prompt, type IPCONFIG/all then you will get the physical address. Is it possible to know the same from SAP. Is there any FM or Class to get the same.
I got the IP Address using the class
CALL METHOD cl_gui_frontend_services=>get_ip_address
Thanks and Regards,
Prakash.
2006 Oct 12 11:13 AM
Hello Prakash,
Use this Fm /SDF/SYSTEM_INFO.
If useful reward.
Vasanth
2006 Oct 12 11:17 AM
Sorry vasanth it's not working:
It will look like
Physical Address. . . . . . . . . : 00-14-C2-0F-6E-2E
Regards,
Prakash.
2006 Oct 12 3:13 PM
2006 Oct 12 3:31 PM
Hi Mr.Ramu,
May be try to execute local shell script with WS_EXECUTE.
or
try this
CALL 'ThUsrInfo' ID
Regards
Vivekanand
2006 Oct 12 3:36 PM
Check the below code:
REPORT ysample60 .
DATA : o_alvgrid TYPE REF TO cl_gui_frontend_services.
DATA: ip_address TYPE char50.
CALL METHOD cl_gui_frontend_services=>get_ip_address
RECEIVING
ip_address = ip_address
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF NOT ip_address IS INITIAL.
write i_address.
ENDIF.
============================================
Also you can try this
FM <b>ARFC_GET_TID</b>will return the IP address of the terminal in hex. Again you have convert HEx to dec format.
2006 Oct 12 3:42 PM
This FM <b>TERMINAL_ID_GET</b> directly provides IP address. Tested working fine.
Regards
Vivek
2006 Oct 12 3:58 PM
Vivek,
Thanks for the effort.
But I don't want the IP Addess, I have already got that.
I want the <b>system's Physical address</b>.
Regards,
Prakash.
2006 Oct 12 4:47 PM
Hi,
This kind of information is highly dependent on the Operating System (I guess it is not the same for IP address ??)
Try creating an external command (say Y_MAC_ADDRESS) in <b>transaction SM69</b> based on this document and on your OS :
http://www-dcn.fnal.gov/DCG-Docs/mac/index.html
Then, run the <b>transaction SM49</b> with the new command.
To do it programmatically, use <b>FM 'SXPG_COMMAND_EXECUTE'</b> with the name of the external command (Y_MAC_ADDRESS) !
Best regards,
Guillaume
2006 Oct 12 5:00 PM
After some googling.. i found
A physical address is a unique hardware-level address associated with a specific network controller. A device's physical address is also called its Media Access Control (MAC) address. On Ethernet, the physical address is a six-byte hexadecimal number assigned by the Ethernet hardware manufacturer. For example:
0000D801CFF2
I dont think the same can be obtained from SAP. Also try to contact BASIS guys.
Regards
Vivek
2006 Oct 12 5:01 PM
Guillaume,
Thanks for your input.
Any idea what should be given in
Operating system command and
Parameters for operating system commands
I just tried with Operating system command = ipconfig/all. But is not working.
Regards,
Prakash.
2006 Oct 12 5:06 PM
Try this code:
If folder c:\temp\ doesnt exist, create or change to a different one.
data: appl type string,
param type string.
data: gt_ipconfig type table of char255,
gs_ipconfig type char255.
appl = 'cmd'.
param = '/c ipconfig /all>c:tempipconfig.txt'.
call method cl_gui_frontend_services=>execute
exporting
* DOCUMENT = appl
application = appl
parameter = param
* DEFAULT_DIRECTORY =
* MAXIMIZED =
* MINIMIZED =
synchronous = 'X'
* OPERATION = 'OPEN'
exceptions
cntl_error = 1
error_no_gui = 2
bad_parameter = 3
file_not_found = 4
path_not_found = 5
file_extension_unknown = 6
error_execute_failed = 7
synchronous_failed = 8
not_supported_by_gui = 9
others = 10
.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
call function 'GUI_UPLOAD'
exporting
filename = 'c:tempipconfig.txt'
tables
data_tab = gt_ipconfig
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
loop at gt_ipconfig into gs_ipconfig.
if gs_ipconfig cs 'Physical Address'.
write:/ gs_ipconfig.
endif.
endloop.
Regards
Sridhar
Message was edited by: Sridhar K
2006 Oct 12 5:13 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |