cancel
Showing results for 
Search instead for 
Did you mean: 

Splitting message using multiMapping

Former Member
0 Kudos

Hi All,

I'm testing a simple file to file scenario in which I'm using multi mapping in Message mapping and I used enhanced Interface Determination.

For n input Employees(consisting of n Employees in single input XML file) I want n output xml files depending on the employee names.

For getting output xml file names based on Emp number i used variable Substitution method also.

But when I test the scenario (Even for one or more Employees in the input XML) I'm getting the below mentioned error in receiver file channel.

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

In receiver file channel I have given various fields as below:

File Name Scheme : Emp_%var1%.xml(and checked Create target Directory also)

In advanced mode checked the Enable box under Variable Substitution and given as below:

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

PFB the screen shot of my mapping document.

[http://picasaweb.google.com/prajwal24/MyScenario#]

I'm not sure whether I mapped the input fields to output fields correctly or not according to Multimapping rule.

Please let me know if I have to do any changes in the mapping as well.

Can any one please help me about how to proceed further in this case and split 1 single input file (consisting of n Employees)

into n output Employee files.

Thanks and Regards,

Prajwal

Edited by: Naluvala Prajwal on Sep 17, 2009 10:56 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

If you want to have n output files for n Employees

just map as


Employee----->INF94145_Emp_Outupt_MT

and Map the rest of the source and target field correspondingly

Former Member
0 Kudos

HI Fatima,

As said by you I have mapped Employee to INF94145_Emp_Outupt_MT.

and tested my scenario in test tab of Mapping but I'm getting the following error:

"Cannot produce target element /ns0:Messages/ns0:Message1/ns1:INF94145_Emp_Output_MT[2]/Employee."

Please let me know why I'm getting this error.

Regards,

Prajwal

Former Member
0 Kudos

Hi Prajwal,

Its complaining about the 2nd occurrence of your output. For your INF94145_... map employee with splitby value and then map employee to employee. It is the problem with your mapping. When you test the mapping in test tab you need to get two INF94145, then you will have two output files. If you dont get here then you will not have in output.

Please put here your input test payload and waht you mapped for these segements and for two fields in each segment so that somebody can help you.

Regards,

---Satish

Former Member
0 Kudos

HI Satish,

Thanks for your valuable inputs.

As said by you I have mapped Employee to INF94145_Emp_Output_MT by using split by value.

PFB the details of my mapping and also the link in which I have placed the screenshot of my mapping.

[http://picasaweb.google.com/prajwal24/MyScenario#]

It is a simple one to one mapping except for INF94145_Emp_Output_MT and Employee fields.

For these fields the mapping is as follows:

1) Employee(1...Unbounded)->SplitByValue->INF94145_Emp_Output_MT(0...Unbounded)

2) Employee(1...Unbounded)--->Employee(1...Unbounded)

Now I'm getting two Employee's instead of two INF94145_Emp_Output_MT's .

Please let me know incase of any corrections.

Regards,

Prajwal

Former Member

Hi Prajwal,

Map like this:

Employee --> INF94145_Emp_ouput_MT

constant (doulble click and put space) --> Employee

Details --> Details

Namee --> Name

and map rest of the fields with one to one.

Then you should have the output as expected. I just created teh same datatype and tested it. It gives the result as expected.

Regards,

---Satish

Answers (4)

Answers (4)

Former Member
0 Kudos

Naluvala,

Use the Output_MT structure instead of input_MT and try.

Regards,

Pavan

Former Member
0 Kudos

> In advanced mode checked the Enable box under Variable Substitution and given as below:

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

You should use the Target path for your Variable Substitution, use INF94145_Emp_Output_MT

Former Member
0 Kudos

hi

Put the SplitByValue after createif.

Former Member
0 Kudos

Hi Prajwal,

I see your target message type is INF94145_Emp_Outupt_. But your variable substituion you have given as INF94145_Emp_Input_MT which is wrong. In variable substitution you need to give the fields in target xml paylaod. So cahnge that accordingly, it should be like this:

var1 payload: INF94145_Emp_Outupt_(I cannot see the comoplete name, give the comlete name),1,Employee,1,Details,1,name,1

Make sure you dont have any spaces after comma. Give this a try and let us know.

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

As you said I'va made changes in my receiver channels as below:

var1 payload:INF94145_Emp_Output_MT,1,Employee,1,Details,1,name,1

This time I'm getting only a single file in the output folder even though I'm giving two employee details as input.

And as I'm getting only one file in the output folder, it is taking the file name as first employee name.

I think multimapping part is not working fine(I Guess) with out which we wont get two files at target side and after getting two target files only two files with two Employee Names will be created in the target folder.

Please look into my mapping here and please help me out.

Please let me know if I have to do any changes in the Multi mapping part.

Regards,

Prajwal