cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping FileName Dynamically through EDI Separator Adapter

Former Member
0 Kudos

Hi Experts,

I am configuring an EDI to IDOC scenario ,where the FileName is to be mapped to a field in the receiver IDOC structure. As we know for a B2B Add on we will be using two ICO(Integrated Configuration Objects) ,First for splitting the EDI file and the other for the actual mapping from EDI to IDOC. The requirement is to get the EDI filename in the receiver payload.

In the first ICO we are using a File sender adapter, and we have checked the ASMA property,:FileName . But at runtime we are unable to get the filename value due to the EDI separator adapter. Can anyone tell us what would be the possible solution to map the filename to IDOC receiver through EDI Separator adapter.

Regards,

Ragulan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

We have got the file name in the mapping. We are using B2B SP4.

The below UDF works fine.

String SourceFileName = new String("");

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

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

SourceFileName = conf.get(key);

conf.put(key,SourceFileName);

return SourceFileName;

Thanks Hareesh and Praveen for your guidance...

Answers (1)

Answers (1)

former_member184720
Active Contributor
0 Kudos

What is your B2B add-on SP level?

As you find in below blog, dynamic header's will be passed to second ICo from SP04.

EDI Separator

Routing of Dynamic headers

All the present dynamic headers (except set by SAP EDI and TPM modules) will be routed to next ICOs after message processing by EDI Seperator Receiver channel. Example: If you have filename as dynamic header set by AS2 or SFTP adapter in first ICO's XI message, these dynamic headers will be passed to next ICO (XI Message) along with splitted/routed messages.

Former Member
0 Kudos

Hi Hareesh,

We are not able to get the filename in the Second ICO. We are using FTP channel and have checked the Filename attibute in the ASMA

Below is the UDF, which i have used

String SourceFileName = “”;

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

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

"FileName");

SourceFileName = conf.get(key);

conf.put(key,SourceFileName);

return SourceFileName;


Could you please help us here....

former_member181985
Active Contributor
0 Kudos

Hi,

You don't need any UDF, since ASMA in sender file adapter itself carries FileName in DC header.

Note: Moreover, you are setting a blank string "" for FileName in your UDF

Have you checked Harish's reply in regards to SP level? your B2B SP should be 04

Br,

Praveen