cancel
Showing results for 
Search instead for 
Did you mean: 

How to rename a XML file using the file/FTP adapter

Former Member
0 Kudos

Dear All,

I am trying to rename a file using VARIABLE NAME SUBSTITUTION.

My structure:

<ns1:MSg xmlns:ns1="http://www.mycomp.inf.br/msr">

<ns1:MSgVal type="A" Id="188549">

<ns1:cab>

<ns1:PO>4500000000</ns1:cPO>

<ns1:BI>90000000011</ns1:cBI>

</ns1:cab>

</ns1:MSgVal>

</ns1:MSg>

How do I do to get the value 188549 from the field Id that is into the tag MSgVal?

I created a variable var1 and my reference is:

var1 --> payload:ns1:MSg,1,ns1:MSgVal,1,Id@,1

I am getting the error:

Could not process due to error: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1

Regards,

Fernando

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

See below links..

change the UDF for your ID generation..

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2

Regards

Chilla..

Former Member
0 Kudos

Hi All,

I need just a simple rename into file adapter.

My mistake was putting tags prefix like example bellow:

<MSG></MSG>,

instead of <ns:MSG> </ns:MSG>.

I took off the prefix and it worked.

Thanks a lot to everybody.

Fernando

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Like pinted by Michal, use Adapter Specific Identifers.

In your mapping set the file name using the code in this link and then in your Receivr File Adapter select the Adapter Specific Identifiers --> FileName .

http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm

Regards

Bhavesh

Former Member
0 Kudos

Dear All,

We can use the field "Id" because it's an attribute. So I used other field.

We can not use tags with prefix.

<ns1:cab> --> Wrong

<cab> --> right.

Regards,

Fernando

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

just use adapter specific attributes (filename)

you can set them in message mapping

they are so much easier and more flexible to use...

Regards,

michal