on 02-22-2013 4:24 PM
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.
Why dont you hard code the value? it is always gonna be a static value right.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
use
String SID = System.getProperty("SAPSYSTEMNAME");
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.