cancel
Showing results for 
Search instead for 
Did you mean: 

Idoc->File scenario: Read a data field in IDOC and name the file with it

Former Member
0 Kudos

Hi All,

I am configuring an IDOC to File scenario.

I have a requirement where I need to read one of the IDOC data field and use that as the name of the File.

E.g: If the IDOC data field-1 = '123456', then I need to name the output file as '123456'.

Is it possible to do this. Appreciate your help on same.

Thanks

Shirin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Check with this

Regards

Seshagiri

Former Member
0 Kudos

Thanks...this Blog talks about using the incoming file name as the outgoing file name.

In my case I want an incoming Data field and later use it as my output file name.

If you have any UDF etc for this, appreciate if you could share that.

Thanks

Shirin

Former Member
0 Kudos

Hi

Check

http://www.saptechnical.com/Tutorials/XI/Variable/substitution.htm

Hope this would close u r issue

reward points if found useful

Srini

Former Member
0 Kudos

Hi,

Use Variable substituion in your case

Regards

Seshagiri

Former Member
0 Kudos

Try this code..

desired field from IDoc will be input parameter to UDF

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

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

conf.put(key,a); // a is input parameter

String ourSourceFileName = conf.get(key);

return ourSourceFileName;

Also, check Adapter specific message attributes in file adapter, check filename

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Shrin,

Try this option :

Give your Output file as : %Idoc_var%

1) In receiver File Adapter : Select "Tab" --> Advance :You can see "Variable Substiuation -->Check Enable box.

2) Here give an entry.

Under "Variable name" : Idoc_var

"Reference : payload: IDOC_Number,1

Check above works for and lemme know

Rergards

Srini