Skip to Content
0
Oct 17, 2013 at 06:10 AM

Dynamically generating file-name

43 Views

Dear All,

We have a scenario Idoc to flat file. The scenario is bypass and we are not using any mapping.
Using the SAP provided module we are converting the Idoc xml to Idoc flat file at receiver file adapter .We are able to generate the Idoc flat file successfully using this module.

Our PI environment is PI 7.31 dual stack.

But we have also the requirement to set the target file name RCVPRN+"-ZWR-"+DOCNUM+".txt which we are not able to generate at target side .
We tried the variable substitution but the variable substitution is not working while we are using the (IDOC XML->Idoc Flat file conversion module) .

We tried to use dynamic configuration by introducing an operation-mapping instead of by-pass scenario as used earlier.

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

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

DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","SourceFileTimestamp");

String filename = RCVPRN+"-ZWR-"+DOCNUM+".txt";

conf1.put(key1,filename);

But we are getting a null pointer exception from the last line. It seems as the sender adapter is not a FILE so the above method is not working.

Is there any other way to meet the required functionality?


Thanks and Regards
Rana Brata De