on 10-17-2013 7:10 AM
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
Hi Rana,
this should work at runtime.
Seems like you are passing RCVPRN & DOCNUM from the IDoc. Check the parameters.
Ambrish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rana Brata,
Please check if ASMA property of file name is ticked on in receiver channel.
If this has been set correctly, please kindly post the complete UDF you wrote and the parameters passed into it. Perhaps there might be problems in the UDF code itself. Otherwise everything seems to be ok.
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
>>But we are getting a null pointer exception from the last line.
Where exactly u r getting this error (hope u r not testing DC at mapping level)?
>>It seems as the sender adapter is not a FILE so the above method is not working.
Since, u r setting the dynamic properties in receiver file adapter by just reading the source payload values so it doesn't matter whether u have idoc/RFc/proxy as ur sender adapter.
Thanks
Amit Srivastava
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Rana,
Silly question, but in your file receiver channel, have you checked the FileName under Use Adapter-Specific Message Attributes?
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.