cancel
Showing results for 
Search instead for 
Did you mean: 

Using Variable Substitution

Former Member
0 Kudos

Hi Im new to XI and Im testing a simple file to file scenario by using Variable Substitution method.

PFB the input payload of my scenario:

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

- <ns0:INF94145_Emp_Input_MT xmlns:ns0="http://infosys.com/xi/projects/adidas/n2">

- <Employee>

- <Details>

<Name>A</Name>

<ID>1</ID>

<Designation>SE</Designation>

<Salary>123456</Salary>

<DOJ>24-02-2008</DOJ>

<Other />

- <Address>

<City>Asd</City>

<ZIP>505001</ZIP>

<Country>India</Country>

</Address>

</Details>

</Employee>

- <Employee>

- <Details>

<Name>B</Name>

<ID>2</ID>

<Designation>SE</Designation>

<Salary>123456</Salary>

<DOJ>24-02-2008</DOJ>

<Other />

- <Address>

<City>Asd</City>

<ZIP>505001</ZIP>

<Country>India</Country>

</Address>

</Details>

</Employee>

</ns0:INF94145_Emp_Input_MT>

***********************************************************************************************************************************

I used the variable substitution feature of Receiver File adapter to get the Output file name as one of the Field value from payload(Employee name in this case).

Now my question is can I be able to get the output files based on employee names.i.e.,for two employee details I should get two out files and for n employee details I should get n output files.

Can anyone tell how the above scenario could be done.

Thanks for your help.

Regards,

Prajwal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Prajwal,

This split should happen in mapping. You need to do multimapping for this. Please do exactly the steps mentioned in this blog, your issue should solve:

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

Once you have done multimapping I mean changing the occurnec then map employee to the target root node, so that for the number of employess you get the same number of targets and each target corresponds to one file.

Now if you want the end file name to be the employee name then you will use variable substitution. Thats the purpose of variable substituion.

Regards,

---Satish

Former Member
0 Kudos

Hi,

I have used multi mapping and I tested the same and is working fine when I test in TEST tab present in mapping.

My scenario is a file to file and also I used same fields in input and output DT(datatype) for understanding purpose.

My input data type is as follows:

- <ns1:INF94145_Emp_Input_MT xmlns:ns1="http://infosys.com/xi/projects/adidas/n2">

- <Employee>

- <Details>

<Name>A</Name>

<ID>1</ID>

<Designation>qw</Designation>

<Salary>122</Salary>

<DOJ>2-22-2222</DOJ>

<Other>asasa</Other>

- <Address>

<City>asdsada</City>

<ZIP>12</ZIP>

<Country>dsada</Country>

</Address>

</Details>

</Employee>

But when coming to END to END testing I'm getting an error in IE as follows:

<SAP:Code area="MAPPING">GENERIC</SAP:Code>

<SAP:P1>Split mapping created no messages</SAP:P1>

Can anyone say what i have to do to overcome this problem.

Thanks and regards,

Prajwal

Former Member
0 Kudos

Hi All,

Now this problem is not coming as I have removed the below mentioned tags from the input payload.

"<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>"

But I have used multimapping along with enhanced Interface determination to get n number of messages in the output folder for n number of input messages(Employees).

But I'm getting the same input payload (which I sent) in the output folder without any splitting of the input message.

I tried pasting my mapping screenshot but I'm unable to paste it here.

(is there any way to do so)

Can anyone help me about the splitting of the messages.

Regards,

Prajwal

Edited by: Naluvala Prajwal on Sep 16, 2009 2:09 AM

Former Member
0 Kudos

Hi Prajwal,

Can you put the input payload and output payload here. While putting your code give it in between

you can see on your right side how you can put code.. After seeing the output payload then somebody can help you out with variable substtituion prajwal.

Regards,

---Satish

Former Member
0 Kudos

Hi Prajwal,

When doing multi mapping, when you add your target Message types in the mesasages tab of MM, make sure that the occurance is 1.This may resolve the split and merge issue..

Please let me know your result..

Regards,

Divya

Former Member
0 Kudos

Hi Divya,

i didnt get you can you please tell me some what clearly........

former_member750652
Contributor
0 Kudos

Hi Prajval,

divya wrote :

When doing multi mapping, when you add your target Message types in the mesasages tab of MM, make sure that the occurance is 1.

(code)

Refer the first two screen shots in the following that's what she mean. "in the message tab set the cardinality in Message mapping" in the multimapping.

http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417700)ID0597094750DB10157703256611146144End...

Thanks,

Ram.

Former Member
0 Kudos

HI Prajwal,

Hope u r fine

let me know if ur issue is fixed?

Regards,

Rajesh

Answers (1)

Answers (1)

abhijitbolakhe
Advisor
Advisor
0 Kudos

Hi

Create varaible substitution as follows.

var1 payload:INF94145_Emp_Input_MT,1,Employee,1,Details,1,Name,1

Now In File Name schema : %var1%.xml

Processing mode : Create.

Now for two employee details you will get two out files and for n employee details you will get n output files.

Regards

Abhijit