cancel
Showing results for 
Search instead for 
Did you mean: 

variable substitution

malika_boubguel
Explorer
0 Kudos

Maybe someone can give me a short hint regarding an error we are getting during the variable substitution in an outbound file adapter.

How can we specify a namespace in the variable substituion?

Without namespace this is working well, but we don't know how to specify the namespace.

We get this error essage: #2006-03-17 15:29:07 CET: Message processing failed: Error during

variable substitution:com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: FileName

Here comes our file:

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

<ns1:GMPluTxn xmlns:ns1="http://sap.com/xi/GMStoreConnectivity">

<GMFileHeader> <StoreNumber>0000002101</StoreNumber> <FileName>PluTxn</FileName> </GMFileHeader> <UpdateType>1</UpdateType> <PLU>000000000000610733</PLU> <RetailPrice>0.99</RetailPrice> <QuantityDescription>BX</QuantityDescription> </ns1:GMPluTxn>

We set the flag 'enable variable subsitution' and specified the filename

variable as follows:

FileName payload:ns1:GMPluTxn,1,GMFileHeader,1,FileName,1

The FileName variable is used in the File Name Scheme field:

%FileName%.asc

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

moorthy
Active Contributor
0 Kudos

Hi Malika,

Do not mention ns1 in the variable substitution.

Why you need to mention the namespace in the variable substitution ?

Just Mention GMPluTxn,1,GMFileHeader,1,FileName,1

Like this.

If you want to get the output file name with namespace, then try to get the namespace as part of your payload(i.e part of your message type ). Then if you don;t want it in the Output file, you can cut it using cut option of File Receiver Adapter.

For more-

/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12

http://help.sap.com/saphelp_nw2004s/helpdata/en/ae/d03341771b4c0de10000000a1550b0/frameset.htm

Regards,

Moorthy

malika_boubguel
Explorer
0 Kudos

Hi Moorthy,

Thank you for the very helpful information; I solved the problem by removing the namespace but also by redesigning my message type.

Regards,

Malika.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Check the occurance of the field. If it is 0 to unbounded or 0..1, there might be chances that the filename element was not created in the first place.

Also, in the variable substitution, leave the namespace out.

GMPluTxn,1,GMFileHeader,1,FileName,1

Regards,

Smitha.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Malika,

While specifying the values from your Payload in Variable Name substitution, you have to use the entire path of the node that you want to access and not only the node name,

So ,

FileName <b>GMPluTxn,1,GMFileHeader,1,FileName,1</b>

This tells XI to go to the 1st occurence of GMPluTxn, and then the 1st Occurence of GMFileHeader within it, and so on.

For more info, just check Variable Name Substitution in this link,

http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm

Regards,

Bhavesh

Former Member
0 Kudos

Hi Malika,

You need to give the variable substitution in your receiver file adapter as follows:

FileName payload:GMPluTxn,1,GMFileHeader,1,FileName,1

This should help you in getting your file written properly.

Cheers

JK

PS: Award points if this helps you.