cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Substitution in Receiver File Channel

Former Member
0 Kudos

Hi All,

Could you kindly help me with this?

Mine is File to File Scenario. ECC drops a XML file in AL11 directory and i send that file using FTP to a third party system. There is no mapping involved and i use ICO. I need to get a value from the payload dynamically for using it in my file name.

When i tried to use Variable Substitution Method i get this error : VariableDataSourceException: Caught SAXException while parsing XML payload: Content is not allowed in prolog.

This is the reference i have given in my variable substitution : payload:customerelement,1,customer,1,sender,1,dealercode,1

and my XML structure is as below and i am trying to access the dealercode field in the XML.

<?xml version="1.0" encoding="UTF-8"?>

-<ns0:CustomerElement xmlns:ns0="http://www.xxxxxx.com/customer">

<recordCount>34</recordCount>

<Customer>

<Sender>

<transmitDate>ddmmyy</transmitDate>

<dealerCode>N050</dealerCode>

<DMSSystem>ABC</DMSSystem>

<DMSReleaseNumber>1.0</DMSReleaseNumber>

</Sender>

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks for your time. I had to write an adapter module to achieve this functionality.

Below link was of great help.

http://wiki.scn.sap.com/wiki/display/Snippets/Dynamic+file+name+in+a+File+to+File+pass+through+scena...

Former Member
0 Kudos

Hello,

Just wanted to update this thread, by mentioning that it's very much possible to set dynamic file name in a XML file to file scenario after reading the XML file content using variable substitution.

You have to just make sure that the XPath which u are trying to access in a XML file at receiver file adapter level is correct.

Thanks

Amit Srivastava

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Amit,

Yeah that is correct. But in my case the XML structure was not properly formed and i hwas frequently getting this error " Content is not allowed in Prolog" for which i tried all the solutions in SDN and nothing worked out. So i had no other option and had to go for adapter module.

Now the issue is solved and the interface is working as expected with the adapter module.

Thanks for your valuable inputs.

Regards,

Prabhu V

naveen_chichili
Active Contributor
0 Kudos

Hi Prabhu,

Check if you have any invalid characters.

http://scn.sap.com/thread/2030198

Thanks,

Naveen

former_member184720
Active Contributor
0 Kudos

If it is just a pass through scenario, you cannot achieve dynamic file name using variable substitution.

You can create a simple java mapping to set the file name. Refer to below wiki.

Dynamic file name for pass-through scenario - Process Integration - SCN Wiki

JaySchwendemann
Active Contributor
0 Kudos

Please note that case probably matters. Your variable substitution is all written in lowercase but the XML has mixed case. Please your variable substitution accordingly.

Come back if that doesn't solve the issue.

Cheers

Jens