cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to retrieve the MAC address of the message server in the SAP GUI?

mengxin
Explorer
0 Likes
818

hello,

Is there any other way to retrieve the MAC address of the network card of the message server in the front-end SAP GUI?

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

dominik_jacobs
Participant

Hi,

retrieving the MAC address of the network card of the message server directly from the SAP GUI front-end is not a straightforward task because SAP GUI does not typically expose this level of hardware detail through its standard interfaces.

In some cases, you can execute OS commands from within ABAP if you have the necessary authorizations. These authorizations are not normally assigned for security reasons.

Here is an example of how to send an OS command via ABAP (the precondition for the MAC determination is that you have the IP)

DATA: lv_command  TYPE string,
      lt_result   TYPE TABLE OF string,
      lv_ip       TYPE string.

lv_command_linux = 'ifconfig -a | grep ' && lv_ip.
lv_command_windows = 'arp -a ' && lv_ip.

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
  EXPORTING
    commandname                   = 'Z_MY_OS_COMMAND'
    additional_parameters         = lv_command_linux 
  TABLES
    exec_protocol                 = lt_result
  EXCEPTIONS
    no_permission                 = 1
    command_not_found             = 2
    parameters_too_long           = 3
    ...

IF sy-subrc = 0.
  LOOP AT lt_result INTO DATA(lv_line).
    WRITE: / lv_line.
  ENDLOOP.
ENDIF.

 Greetings

Dom