cancel
Showing results for 
Search instead for 
Did you mean: 

How get Technical System Host Name of a Business System in UDF or Adapter Module?

former_member201264
Active Contributor
0 Kudos

Hi All,

I have a requirement where I need have my Sender Business System Host Name.

And it is to be used to set the source directory dynamically at runtime by using Dynamic Configuration or/and Adapter Module.

OR Just for Knowledge:

How access the ECC Technical system host name from SLD into Dynamic Configuration Settings UDF so that we can use host name as my target FIle Name as HOSTNAME_TimeStamp.

Regards,

Sreeni.

Accepted Solutions (0)

Answers (4)

Answers (4)

rajasekhar_reddy14
Active Contributor
0 Kudos

Why dont you hard code the value? it is always gonna be a static value right.

Former Member
0 Kudos

Hi ,

>>How access the ECC Technical system host name from SLD into Dynamic Configuration Settings UDF so that we can use host name as my target FIle Name as HOSTNAME_TimeStamp.

use the below piece of code.

String host = null;

DynamicConfiguration conf1 = (DynamicConfiguration) container

    .getTransformationParameters()

    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");

//Getting current time stamp

Date date = new Date();

SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy h:mm:ss a") //It is up to you

String formattedDate = sdf.format(date);

//Getting hostname

java.net.InetAddress addr = java.net.InetAddress.getLocalHost();

host = addr.getCanonicalHostName();

String TFileName= host+"_"+formattedDate ;

conf.put(key, TFileName);

return TFileName;//It is up to you

NOTE:

System.getProperty("SAPSYSTEMNAME");   returns 3 digit SID .

regards

Venkat

former_member201264
Active Contributor
0 Kudos

Hi Venkat,

As you told that it is is going to give 3 digit System ID, but I have a doubt here.

NOTE:

System.getProperty("SAPSYSTEMNAME");   returns 3 digit SID .

In the above,  what is  "SAPSYSTEMNAME" ?

Shall I pass same as this name or ANy other host name in place of this SAPSYSTEMNAME?

Please clarify me.

Regards,

Sreeni.

Former Member
0 Kudos

Hi ,

>>n the above,  what is  "SAPSYSTEMNAME" ? 

This is just a generic parameter name .Just like key and its corresponding value.

Here you are asking the value(SID) that is stored under this key.

If you want host name dynamically use the above piece of code .

For SID use the above line of code .

Regards

Venkat

Shabarish_Nair
Active Contributor
0 Kudos

use

String SID = System.getProperty("SAPSYSTEMNAME");

Former Member
0 Kudos

Hi Sreeni,

Check the below link.

http://scn.sap.com/thread/1639443

Thanks,

Satish.