cancel
Showing results for 
Search instead for 
Did you mean: 

How to get IP adress of a SAP VM using SXPG_COMMAND_EXECUTE function module

0 Kudos

I wanted to get the IP address of Linux VM's using SXPG_COMMAND_EXECUTE FM. I tired ping and Ni-ping, but both does not provide the required result. Is there another command name & additional parameter which I can use to get the IP addresses successfully.

(or)

Are their any other "remote enabled" function module to achieve the same. I need the IP address of all associated SAP VM's for an SID.

FredericGirod
Active Contributor
0 Kudos

Could be complex because you could have several IP

did you try "hostname -I" in shell ?

0 Kudos

Thanks, I am able to figure out a way to execute SXPG_COMMAND_EXECUTE using Niping.

Accepted Solutions (0)

Answers (2)

Answers (2)

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos

Instead of SXPG_COMMAND_EXECUTE, you could simply call FM TH_SERVER_LIST. (Though it provides hostnames instead of IP addresses.)

0 Kudos

TH_SERVER_LIST - I can get IP of application server but not CI and ERS (if any) in the SAP system. Do we have any other FM's (remote enabled) which gives me details of central instance and ERS?

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos

What is "CI" and "ERS"?

0 Kudos

CI - central instance (mess + enque)

ERS - Enque replication server

Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos

Ok, then the following might help you: the hostnames of message server and enqueue server are available as profile parameters:

  • rdisp/mshost
  • enq/serverhost
  • SAPFQDN (holds the domain name of the current landscape, so by concatenating the first two values with this one, you can get the FQDN of these two servers, if you need it)

And there is a function module that allows reading the values of profile parameters: TH_GET_PARAMETER. (Actually there are two FMs that read profile parameters, but the other one, TH_GET_PROFILE_VALUE, is not remote enabled...) So you could call TH_GET_PARAMETER and pass PARAMETER_NAME="rdisp/mshost" etc. to get the desired information.

Sriram2009
Active Contributor
0 Kudos

Hi Jagadeesh

Have you tried using the transaction code SM51?

Regards

SS

0 Kudos

I am trying to find RFC enabled function module which needs to be accessed outside SAP.