cancel
Showing results for 
Search instead for 
Did you mean: 

Reg:Variable Substitution in Receiver File Adapter

Former Member
0 Kudos

Hi...

In the Source File,

I am gtting the Field "Product_Name". Based on the Product Name, i need to map the Target Field.

In The Target, I am having Filed as Folder Path.

This Folder_Path is mapped based on the condition like.

if Product_Name = DD, and Server Name = DISB,then the Folder Path should be "/home/corpuser/Disbursement/DD" else /home/corpuser/Disbursement/CC

So the ouput file should be placed in the corresponding Target Directory based on the Folder Path.

For this i am using Variable Substitution.

in Target Directory, i am giving the value as "/home/corpuser/Disbursement/%var1%"

Variable Name -


var1

Variable Reference Name -


payload:MTI_Payment_Disbursement,1,Folder_Path,1

Structure for the Target Message is like...

Messages

Message1

MTI_Payment_Disbursement --- 0 to unbounded

Folder_Path

Can you please tell where i ahve done wrong.

Thanks & Regards,

Leela Ratnam M

Accepted Solutions (0)

Answers (3)

Answers (3)

Shabarish_Nair
Active Contributor
0 Kudos

>

> in Target Directory, i am giving the value as "/home/corpuser/Disbursement/%var1%"

>

> Variable Name -


var1

> Variable Reference Name -


payload:MTI_Payment_Disbursement,1,Folder_Path,1

<Folder_Path>/home/corpuser/Disbursement/DD</Folder_Path>

1. provide only %var1% and try

2. delete the current variable you have given. Make sure there is no special characters involved when you type it (even a white space can be of issue)

3. Why not use dynamic configuration? It is much flexible than variable substitution

ref:

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

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

Former Member
0 Kudos

Hi,

Is Folder_Path field holding the value as "/home/corpuser/Disbursement/DD" or "/home/corpuser/Disbursement/CC" or its just holding "DD" or "CC"?

If its containing the whole path, then you need to specify the whole path as "%var1%" in target directory and not just the last part.

If its just holding "DD" or "CC", then you need to check out your message mapping. The Folder_Path field is not getting populated properly while executing the mapping.

Also check the "Adapter Specific Attributes" box in file receiver adapter.

Please confirm.

Thanks,

Subhajit.

former_member750652
Contributor
0 Kudos

Hi leela,

Every thing seems to be fine from your above problem description.Can you please write the error that you are getting..?

Thanks,

Ram.

Former Member
0 Kudos

Hi...

I am getting the below error when i execute the scenario.

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: var1: 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,

Leela

Former Member
0 Kudos

Hi

Have u witten UDF Dynamic Configuration --> to get "FileName"

Have also checked the box in the receiver file Adapter in advanced option

Filename ???

rgds

srini

Former Member
0 Kudos

Hi,

the field you are mapping to var1 in variable substitution is either blank or not getting generated in your output msg after msg mapping..........so just check in output msg whether your field is having value or not.............if it is not getting generated, then try to send some default value in it for your scenario to execute.

Regards,

Rajeev Gupta

Edited by: RAJEEV GUPTA on Mar 17, 2009 6:40 AM

Former Member
0 Kudos

Hi...

I am not using nay UDF there.

Thanks,

Leela

Former Member
0 Kudos

Hi...

I am to get the field value in the target structure.

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

- <MTI_Payment_Disbursement>

- <Disbursement>

<Transactional_ref_num>123456</Transactional_ref_num>

<CorporateID>SATCOMP</CorporateID>

<UseridUploader />

<UseridAuthorizer1 />

<UseridAuthorizer2 />

<UseridAuthorizer3 />

<UseridAuthorizer4 />

<UseridAuthorizer5 />

<ProductID>D</ProductID>

<BeneficiaryName>143</BeneficiaryName>

<Amount>5000000</Amount>

<BeneficiaryAdd1>Hyderabad</BeneficiaryAdd1>

<BeneficiaryCity>Jubli Hills</BeneficiaryCity>

<BeneficiaryState>Andhra Pradesh</BeneficiaryState>

<BeneficiaryPinCode>533124</BeneficiaryPinCode>

<CorporateAccoutNo>ICICI48500</CorporateAccoutNo>

<PayableLocation />

<PayeeDate>2009-03-09 00:00:00.0</PayeeDate>

<CustRefNo>143</CustRefNo>

<ChequeNo />

<PaymentDetail1 />

<PaymentDetail2 />

<PaymentDetail3 />

<PaymentDetail4 />

<PaymentDetail5 />

<PaymentDetail6 />

</Disbursement>

<Folder_Path>/home/corpuser/Disbursement/DD</Folder_Path>

</MTI_Payment_Disbursement>

Former Member
0 Kudos

Hi,

in your target msg, in Folder_Path you have the complete path of the folder, so in ID in reciver file comm channel in target directory just specify %var1%

moreover, check for extra spaces in variable substitution and check for case-sensitive in msg fields..........

also in reciver file comm channel in adpater specific msg attributes, check Directory option.........

Regards,

Rajeev Gupta