cancel
Showing results for 
Search instead for 
Did you mean: 

file to RFC scenario want to read file name

Former Member
0 Kudos

Hi All,

I am having file to RFC scenario in which i am having file name in format text_yyyymmdd.txt.

i want to read this file name and by separating the date in file name i have to pass this to one of the RFC date parameter.

please help me to sort out this.

Thanks

Swapnil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Swapnil,

Here

1. Set your Adapter Specific Parameter for your sender file adapter. Make use of this blog by michal

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 for achieving the same

2. With the help of the code described, obtain the Dynamic configuration parameters where you get the file name.

3. With the help of UDF extract the date from the file name.

DONE!

Regards

Ramesh

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

By writing simple UDF in your mapping you can Acheive this

Try this Once

DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

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

String MyFileName = dynamicconfiguration.get(key);

String str[] = MyFileName.split("_");

return str1[1];

Map this to the date parameter(RFC) in the mapping .

Thank & Regards,

Deepthi

Edited by: Deepthi Muppasani on Sep 23, 2011 8:17 AM

Former Member
0 Kudos

Hi,

Enable ASMA properties in sender file communication channel and Write a UDF using Dynamic Configuration and get the filename and separate the date from value and pass that value to rfc as input.

Regards,

Sunitha