cancel
Showing results for 
Search instead for 
Did you mean: 

problem variable substiution with payload

Former Member
0 Kudos

Hi all,

I'm work with a file adapter in my system PI 7.0 SPS 16 and i try to implement a scenarii in abap/proxy to file.

I have a problem when i try to configure variable subsitution with payload.

My goal is to create my filename with the first article which is contained in my payload.

my payload is:

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

- <n0:mt_makt xmlns:n0="http://XXXXXXXXXX.fr/SW_XI-Mapping/Wenjing" xmlns:prx="urn:sap.com:proxy:BR1:/1SAI/TAS69AEE1246C27E45CC7F0:700:2008/01/11">

- <dt_makt>

<matnr>_000000000000006041_</matnr>

<maktx>Article A, C02, 04</maktx>

</dt_makt>

- <dt_makt>

<matnr>000000000000006042</matnr>

<maktx>Article A, C02, 05</maktx>

</dt_makt>

- <dt_makt>

<matnr>000000000000006043</matnr>

<maktx>Article A, C02, 06</maktx>

</dt_makt>

- <dt_makt>

<matnr>000000000000006044</matnr>

<maktx>Article A, C02, 07</maktx>

</dt_makt>

- <dt_makt>

<matnr>000000000000006045</matnr>

<maktx>Article A, C02, 08</maktx>

</dt_makt>

.........................................................

...............................................

- <dt_makt>

<matnr>000000000000006069</matnr>

<maktx>Article A, C06, 04</maktx>

</dt_makt>

</n0:mt_makt>

my configuration in Advanced:

under Variable Name : var2

under Reference : payload:mt_makt,1,dt_makt,1,matnr,1

my configuration in Target

Target directory : E:\XI\out\wjb

File Name scheme : test%var2%

When in send the message from my SAP ERP To SAP Pi, messages are processed with successfully (sxmb_moni) but no files was created.

my log CC receiver :

Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var2: 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: var2

do you know what's wrong

Thanks by advance

NG

Edited by: Nor Goudjil on Dec 18, 2008 4:23 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Ru planning to create multiple output files? If so I dont think var substitution shall work. You can do a change in message mapping byt create a header field<occurence: 1> map to a constant and call it in var substitution.

If you want to create multiple target files you need to use multi mapping.

Thanks

Nikhil

Answers (3)

Answers (3)

SudhirT
Active Contributor
0 Kudos

Replace dt_makt,1 by dt_makt,2 in the value of var2. i guess _ in matnr,1 is causing problem.

Former Member
0 Kudos

hi all and thanks for you participation... but I always have the same problem

Indeed the file was not created...

"ASMA " is unchecked, and there is no extra space after "var2" under the Variable Substitution

So I also replaced "dt_makt,1 by dt_makt,2 in the value of var2" but whitout succeed

I have the same error in CC log's

Regards,

NG

Former Member
0 Kudos

Hi Nor,

Everything looks fine and it should work. I have a small qestion, the payload which you have shown is the inbound structure (target) payload, right? I mean the payload after mapping source and target (if there is any). I can see the namespace with proxy, so just wondering if it is not the payload which source system is sending.

Also can you try changing the variable name from var2 to var3 and see. I just want to see if there is any cache problem. I know this won't resolve your thing, but just want to check the error log again.

Amit

Edited by: Amit Gupta on Dec 18, 2008 7:32 PM

Former Member
0 Kudos

I was able to create a file using the same variable substituation reference and even the variable value having underscore on the both ends.... testfile_1232454_.xml

Just wanted to confirm that the payload you have provided is the TARGET PAYLOAD from sxmb_moni.

Thanks,

Pooja

Edited by: Pooja Pandey on Dec 18, 2008 1:13 PM

Former Member
0 Kudos

Hi Nor

Everything looks fine.

As Pooja asked. IS this target payload.

Thanks

Gaurav

Former Member
0 Kudos

Hi Nor,

Please close the thread with the solution if your issue is resolved

Thanks

Amit

Former Member
0 Kudos

Hi Nor

Are you trying with your file name

Article A, C02, 07

This file name is not possible. its having comma and spaces

Thanks

Gaurav

Former Member
0 Kudos

Hi all & Happy new year,

I am sorry to answer only now.

I change var2 by var3 but I have already the same problem and in logs I still find references to var2 ! However I launched "sxi_cache".

logs in cc after having to change var2 by var3

1/9/09 6:43:39 PM ddde72f2-cfa6-fbf1-a301-001e4f275e0f

Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var3: 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: var3

When i click on ddde72f2-cfa6-fbf1-a301-001e4f275e0f

La diffusion du message vers l'application via File_http://sap.com/xi/XI/System a échoué en raison de : com.sap.aii.af.ra.ms.api.RecoverableException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var2: 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: var2

Moreover the payload which you can see is an extract of "SXMB_MONI"

--> Inbound Message (CENTRAL) --> Folder "Payloads"

Thanks by advance

NG

Former Member
0 Kudos

Make sure that there is no extra space after your "var2" under the Variable Substitution.

Thanks,

Pooja

Edited by: Pooja Pandey on Dec 18, 2008 10:34 AM

Former Member
0 Kudos

Make sure that "Adapter Specific message Attributes" is unchecked in the CC.

Thanks,

Pooja