cancel
Showing results for 
Search instead for 
Did you mean: 

Picking info from incoming file

Former Member
0 Kudos

Hi experts

i need to pick up some info in the file name

the scenarios is that in the file name there will be infrmation about company codes and date and i need to fech the same and use them in the mapping to pass to the target structure in some field

for eg ijkh_compcode_date_data.txt

i have to derive compcode and date from this name and use in my mapping

how to do it ?

please help

thanks

Rohan

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>for eg ijkh_compcode_date_data.txt

all in standard - use ASMA to put the filename in the dynamic header (by checking it in sender file adapter)

then you can get the name inside the mapping program and use it in your mapping

everything should work without any complex coding

Regards,

Michal Krawczyk

Former Member
0 Kudos

HI Michal

I shall do the same

however there is an issue after this that i face

Request you to kindly have a look at the below mentioned and help me out with that if you can

I haven't got many responss to my problem

thanks

Rohan

Answers (1)

Answers (1)

Former Member
0 Kudos

You can use dynamic configuration in UDF in message mapping to extract file name.

The UDF code looks like

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

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

String sourceFileName = conf.get(key);
//write a logic to get compcode and date from this sourceFileName. 

return requiredValue;;