cancel
Showing results for 
Search instead for 
Did you mean: 

require variable substitution

Former Member
0 Kudos

Hi Experts,

We are passing the file name as P160511_0001.txt within input field (input field name is File_Name)itself. the same output we want as P160511_0001.txt using variable substitution.please find the pay load message given below.

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

- <n0:MT_PositivePaycheque xmlns:n0="urn:logica.com/pi/positivepaycheque" xmlns:prx="urn:sap.com:proxy:ERD:/1SAI/TAS920370786C5BED94B7F7:701:2010/02/19">

- <RecordSet>

- <Header>

<Header_Description>UHL</Header_Description>

<Description>PositivePay</Description>

<Reference>R11NOT</Reference>

<Issued_date>15JUN10</Issued_date>

<File_Name>P160511_0001.txt</File_Name>

</Header>

- <Line>

<KeyHouseBank>089074</KeyHouseBank>

<IDAccount>61140019</IDAccount>

Kindly give the step by step proceedure for creating variable substitution.

regards

elton

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

please correct the below steps.

In receiver communication channel,

file name schema: %var1%

file construction mode: create

variable substitution:

variable name: var1

reference: payload:Header,1,File_Name,5

header is the segement

1 is the first segment

File_Name is the 5 th field name which carries the real file name as P280411_0001.txt.

below details are selected

adapter specific message attribute

file name

former_member200962
Active Contributor
0 Kudos
reference: payload:Header,1,File_Name,5
File_Name is the 5 th field name

it should not be treated as position of the field in your XML....it is the number of occrence...as per your setting the file name should be taked from 5th occurence of File_Name....however this wont be the case....you need it from the only occurence present

So it should be Header,1,File_Name,1

below details are selected
adapter specific message attribute
file name

You dont need to set the above as you are using Variable Substitution and not ASMA....these are two different things

Why not implement Dynamic Configuration? Dont you have mapping in your scenario?

former_member181985
Active Contributor
0 Kudos

check these blogs:

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

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

reference: payload:MT_PositivePaycheque,1,Header,1,File_Name,1

Former Member
0 Kudos

customer asked as to go for varaiable substitution

mapping is also there

i am getting the like

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

Edited by: eltonsaranya on May 16, 2011 10:10 AM

KennethEriksen
Participant
0 Kudos

Just a quick note: if you're using variable substitution make sure that this is based on the target payload (after mapping). So the file_name field must be available in the target message structure.

-Kenneth

Former Member
0 Kudos

yes same structure is available

Former Member
0 Kudos

Try using the reference as below:

payload:MT_PositivePaycheque,1,RecordSet,1,Header,1,File_Name,1

Thanks,

Ramana

former_member185881
Active Participant
0 Kudos

Hi

Go to Reveiver file adapter --> under Advanced Tab

click on Enable to enable Variable Substitution.

Under Variable Name write -

FileName

Under Reference write -

payload:MT_PositivePaycheque,1,RecordSet,1,Header,1,File_Name,1

Now go to Target tab

In File Name Scheme give = %FileName%.xml

Regards

Dheeraj Kumar

Answers (0)