Skip to Content
0
Former Member
Nov 21, 2008 at 11:47 AM

Dynamic target Directory

185 Views

Hi All

I have a scenario in which all my master IDOCS should flow form R3 to XI and form XI to the FTP Server's respective Folder loaction.

The Folder option is storewise , so for example for ST01 , the corresponding WP_PLU should be placed at ST01 folder location in the ftp server.

there is an UDF written foe file naminf convention:

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

Calendar cal = Calendar.getInstance();

Date date = cal.getTime();

String s = date.toString();

String a1 = s.substring(8,10);

String b = s.substring(4,7);

String b1="a";

if(b.equals("Jan"))

{b1="01";}

if(b.equals("Feb"))

{b1="02";}

if(b.equals("Mar"))

{b1="03";}

if(b.equals("Apr"))

{b1="04";}

if(b.equals("May"))

{b1="05";}

if(b.equals("Jun"))

{b1="06";}

if(b.equals("Jul"))

{b1="07";}

if(b.equals("Aug"))

{b1="08";}

if(b.equals("Sep"))

{b1="09";}

if(b.equals("Oct"))

{b1="10";}

if(b.equals("Nov"))

{b1="11";}

if(b.equals("Dec"))

{b1="12";}

String c = s.substring(24);

String sDate = a1b1c;

String e = s.substring(11,13);

String f = s.substring(14,16);

String g = s.substring(17,19);

String sTime = efg;

String d = a.substring(9,25);

String Idoc = d;

String RecieverFilename = "WPDBBY_"Idoc"_"sDate"_"sTime".txt";

//<Receiver Filename> ; //you have to give the filename that has to be generated in the receiver adapter.

conf.put(key, RecieverFilename);

return a;

Could any1 please help how to add the directory to it,please let me know the code as i am not a JAVA developer

regards

Prajna