cancel
Showing results for 
Search instead for 
Did you mean: 

Variable Substitution Error in Receiver Channel

0 Kudos

We have the below message structure,

MarketTraceInformation_Enhanced

HeaderMarketTrace

FileName

VendorID

IntermediateMarketTrace

Shipto_Cust_Num

Shipto_Cust_Name

We are doing variable substitution for 'FileName' variable, so maintain the below configuration in the receiver channel,

filename      payload:MarketingTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1

Even, this while running that channel, we are getting the below error,

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: 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: filename

Could you please suggest on the same.

Regards,

Praloy

Accepted Solutions (0)

Answers (11)

Answers (11)

0 Kudos

Hi Experts,

Thanks for your inputs.

Actually we have interface scenario, 1. ChargeBack & 2. MarketTrace and in both the case, we have used this variable substitution by using the same field.

Moreover, in both the case, we received same length of value. But unfortunately, for Chargeback it is working fine but only getting issue in this Market Trace interface scenario.

Kindly suggest, what would be difference between in these two scenario.

Regards,

Praloy

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Praloy,

You can check at the DT defined for both the scenarios and see if there is any difference.

Otherwise to come to know the root cause, as suggested by Bhargava, just maintain a shorter name in the file name field and trigger a sample data and check the outcome end to end.

In this way, we can come to know atleast whether interface is working or not.

Bhargavakrishna
Active Contributor
0 Kudos

Hi Praloy,

i just reviwed the screenshot which you pasted above.

what is the "FileName" value length?

may be this is not working due to lengthy values coming in the FileName.

Regards

Bhargava Krishna

iaki_vila
Active Contributor
0 Kudos

Hi,

Interesting contribution Bhargava, that length name could be problematic in some OS. I think, Praloy, you should try with a short and easy file name, with "normal" characters. Also pay attention if you don't use a message mapping that the target payload can be validated with your target xsd.

Regards.

0 Kudos

Hi Vinay & Raghuraman,

I maintained the same in the Channel and tried but it didn't worked.

Regards,

Praloy

former_member186851
Active Contributor
0 Kudos

Did you uncheck the adapter specific message attributes?

vinaymittal
Contributor
0 Kudos

Apply substring on filename in the udf take a filename of just 5 characters and try it may happen that the long filename combined with a long path may be a problem just a guess

0 Kudos

Yes Raghuraman, ASMA parameter is unchecked.

pvishnuvardan_reddy
Active Contributor
0 Kudos

The FileName field is coming under HeaderMarketTrace node. So, make sure you enter the path correctly.

payload:MarketingTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1


Also, did you check the value populated in the first occurrence of FileName field in HeaderMarkerTrace.

vinaymittal
Contributor
0 Kudos

Do a cache refresh if not done yet

also make sure to take extreme care in synchronising the capitals and small letters

https://scn.sap.com/thread/2085555

0 Kudos

Hi All,

Please find the below Channel config screen shot,

Regards,

Praloy

Bhargavakrishna
Active Contributor
0 Kudos

Hi Praloy,

Are you using dynamic configuration in mapping to generated the file name?

if so please uncheck the ASMA parameter it will override the dynamic configuration and generate the file as per the variable substitution.

Regards

Bhargava Krishna

vinaymittal
Contributor
0 Kudos

the value in right column should be exactly

payload:MarketingTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1


why did you change it it was alright

former_member186851
Active Contributor
0 Kudos


Hello Praloy,

In the structure it is "FileName"

So change your variable substitution parameter to

payload:MarketingTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1

0 Kudos

Hi Raghuraman, Inaki & Vinay,

I tried with your suggestion but still I am getting the same error,

Message processing failed. Cause: com.sap.engine.interfaces.messaging.api.exception.MessagingException: 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: filename


Regards,

Praloy

former_member186851
Active Contributor
0 Kudos

Praloy please post your filename schemen and variable substitution

vinaymittal
Contributor
0 Kudos

the variable substituion u originally used is right please share screenshot of usage in adapter i.e CC screenshot

pvishnuvardan_reddy
Active Contributor
0 Kudos

Hi Praloy,

The variable substitution path is looking good(payload:MarketingTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1)

Can you check if there is any cache issue.

Also, in the filename level, did you mention %var1% and after enabling the variable substituion did you maintain the varibale name correctly(var1 = payload:MarketingTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1)

Pls share the screenshots of the filename pattern and variable substitution maintained in the channel.

vinaymittal
Contributor
0 Kudos

Did you enable ASMA in the Receiver adapter as well??

Bhargavakrishna
Active Contributor
0 Kudos

Hi Praloy,

plz verify the File name scheme which you specified in the communication channel.

For ex: Generate the file name which should include the Filename value coming in the data.

for Purchase order

Variable name: filename

Reference:  payload:MarketTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1

my File name Schema : PO%filename%.xml

we should mention the variable name in file name scheme which we defined in the advanced tab.

Regards

Bhargava Krishna

0 Kudos

Sorry for the Typo,

The correct Message Type structure is below,

So the variable substitution configuration is correct, I guess,

filename      payload:MarketingTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1


Regards,

Praloy

iaki_vila
Active Contributor
0 Kudos

Hi Praloy,

Yes, it should be right. Have you checked on the monitoring that you are really creating this structure?

Have you defined the variable as filename and you access to it with %filename%, isn't it?

Regards.

former_member186851
Active Contributor
0 Kudos

Hello Praloy,

Too add more,

The name you give in the variable name in the variable subsitution and variable name in the filename scheme should be idenitcal(case-sensitive as well).

iaki_vila
Active Contributor
0 Kudos

Hi Praloy,

Check the payload in the monitoring, pay attention that the XML path is case sensitive in the variable names.

Regards.

vinaymittal
Contributor
0 Kudos

spelling mistake


payload:MarketTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1



also


it should actually be


payload:MarketTraceInformation_Enhanced,1,FileName,1


No Need to mention Header as both filename and Header are at same level


For example, to reference the element that is in bold in the XML structure below, the following expression is used: payload:root,1,e1,1,e2,2

The parser searches for the first occurrence of the root element at the first level.

It then searches for the first occurrence of e1 at the second level and for the second occurrence ofe2at the third level.

The content of the last element (“Example Value”) is set as the value for a specified variable.

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

<root>

  <dummy>

  <e1>

  <e2>Data_1</e2>

  <f/>

  <g attr="abc">text</g>

  <e2>Data_2</e2>

  </e1>

  </dummy>

  <e1>

  <e2>illegal/value</e2>

  <f/>

  <g attr="abc">text</g>

  <e2 attr="fghij">Example Value</e2>

  </e1>

</root>

azharshaikh
Active Contributor
0 Kudos

Hi Praloy,

Seems typo error, you are using incorrect value in Parameter..can you try with this & check

filename      payload:MarketTraceInformation_Enhanced,1,HeaderMarketTrace,1,FileName,1


Regards,
Azhar

gagandeep_batra
Active Contributor
0 Kudos

Hi,

Can you check the message after mapping and also check the Case for file name is it a FileName or filename or somthing else..

Regards

GB

0 Kudos

Hi Gagandeep,

Please find the message after mapping,

Also in the message, it is FileName mentioned.

Regards,

Praloy