cancel
Showing results for 
Search instead for 
Did you mean: 

FTP directory from part of PDF file name

former_member568822
Active Participant
0 Kudos

Hi,

I have a requirement to FTP a pdf file to a server directory according to fist 10 char of the file name. I am able to get the file name using variable substitution method but how can i chop the 1st 10 char of file name as my directory? As the file is a .pdf i didn't do any data mapping.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member181985
Active Contributor
0 Kudos

Though there is no mapping currently, you can have a java mapping for by passing the stream and setting the dynamic configuartion within the java mapping.............

Reagards,

Praveen Gujjeti.

former_member568822
Active Participant
0 Kudos

Hi,

Thanks for reply. Can you explain more on the java mapping?

Any others method?

Thanks

Edited by: fcgan on Jan 20, 2010 9:56 AM

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

If you dont have any Mapping Objects,then writing adapter module to change file name is the right option

or you can create dummy message mapping and add dynamic configuration UDF ,but in your case you trasfering PDF documents,this option is not feasible.

or writing Java map is the other alternatine,but it is not recommanded to your requirement,because once again you need change the .add IR objects.

Writen adapter module,

add and chnage below code as per module and your requirement

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

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

SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMdd");

String timestamp = dateformat.format(new Date());

String filename_new=fileNametimestamp".txt";

conf.put(key, filename_new);

return "";

Regards,

Raj

Answers (1)

Answers (1)

Former Member
0 Kudos

You need to write adapter module to do this. Adapter module is a java program . If you do not know about adapter modules, search sdn, you will get some good articles on that.