on 06-19-2008 12:42 PM
Hi all,I posted a question yesterday evening with subject name as "Placing a file in one of many directories at run time".
The link for that qestion is as follows:
For that question I got a UDF as a reply.The UDF is as follows
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String strDirectory = "Dir1"
// here write your condition for dynamic Directory
conf.put(key,strDirectory);
return strDirectory;
Im having an double if condition in my scenario as follows:
if (Integer.parseInt(TableName[0])==8 || Integer.parseInt(TableName[0])==10 || Integer.parseInt(TableName[0])==12 )
{
if(CountryCode.equals("SG") || CountryCode.equals("MY") || CountryCode.equals("PH") || CountryCode.equals("TH") || CountryCode.equals("ID"))
{
}
}
Now my question is where to insert last two statements of UDF(conf.put(key,strDirectory);
return strDirectory;).
Should I use both in if condition or any one in if condition.
Can any one help me out in this case.
Thanks in advance,
Regards,
Prajwal Kumar
Hi Naluvala
You can do this. It is pretty simple
bstractTrace trace = container.getTrace();
trace.addInfo("In Dynamic Configuration...............................:");
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
String ourSourceFileName = conf.get(key);
trace.addInfo("Key Filename:"+ourSourceFileName);
String valueOld = "/XD1_interfaces/messages/inbound/ref_payments";
trace.addInfo("Key valueOld:"+valueOld);
conf.put(key1,valueOld);
}
return ourSourceFileName;
Regards
Abhishek
*Please reward points if helpful***
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
you can put
conf.put(key,strDirectory);
return strDirectory;
after all the IF conditions ie at the bottom of UDF.
You need to set only the dir strDirectory variable inside your IF condition.
rgds
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You will have to provide the condition and result directory after // here write your condition for dynamic Directory. Provide all the 6 conditions for all the directories and the corresponding paths after this line. It will work.
Regards,
Sanjeev.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.