Dynamic File name and Directory pseudo code
Hi All,
Dynamic File name and Directory pseudo code: There are many articles, blogs and posts on dynamic filename in SCN. I was looking for a pseudo code where dynamic filename and dynamic directory has been implemented at the same time. I did’nt find any. Here, I am posting a pseudo code with dynamic file name and condition based dynamic directory. Hope this helps.
Name:setFileName
Title:setFileName
Execution Type:Single Values
Category:User-Defined
Type:Argument
Name:variablePart
Java Type:String
//Dynamic File name and Directory: Author-Partha
String filename = new String(“”);
String directory = new String(“”);
DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key1 = DynamicConfigurationKey.create(“http:/”+”/sap.com/xi/XI/System/File”,”FileName”);
DynamicConfigurationKey key2 = DynamicConfigurationKey.create(“http:/”+”/sap.com/xi/XI/System/File”,”Directory”);
filename = “Customers_Outbound_” + variablePart + “_.csv”;
conf1.put(key1,filename);
//return filename;
if (variablePart.equals(“6301”))
{
directory = “/IN-IFL/01-OFFICE”;
}
else if (variablePart.equals(“6302”))
{
directory = “/IN-IFL/02-OFFICE”;
}
else if (variablePart.equals(“6303”))
{
directory = “/IN-IFL/03-OFFICE”;
}
else if (variablePart.equals(“6304”))
{
directory = “/IN-IFL/04-OFFICE”;
}
else if (variablePart.equals(“6305”))
{
directory= “/IN-IFL/05-OFFICE”;
}
else if (variablePart.equals(“6306”))
{
directory= “/IN-IFL/06-OFFICE”;
}
else if (variablePart.equals(“6308”))
{
directory = “/IN-IFL/08-OFFICE”;
}
else if (variablePart.equals(“6309”))
{
directory = “/IN-IFL/09-OFFICE”;
}
else if (variablePart.equals(“6310”))
{
directory = “/IN-IFL/10-OFFICE”;
}
else if (variablePart.equals(“6312”))
{
directory = “/IN-IFL/12-OFFICE”;
}
else if (variablePart.equals(“6313”))
{
directory = “/IN-IFL/13-OFFICE”;
}
else if (variablePart.equals(“6314”))
{
directory = “/IN-IFL/14-OFFICE”;
}
else
{
directory = “/IN-IFL/20-OFFICE”;
}
conf1.put(key2,directory);
return directory;
New NetWeaver Information at SAP.com
Very Helpfull