cancel
Showing results for 
Search instead for 
Did you mean: 

node mapping

Former Member
0 Kudos

hi guys,

i have a source(flatfile) which looks like follow:

note:number of XYZ in a ABC node will be same throughtout for 50 ABC.

ABC|1234 | (0-50 --Parentnode)

XYZ|A| (0-unbounded ---Childnode)

XYZ|V|

XYZ|K|

ABC|5678| (0-50 --Parentnode)

XYZ|L| (0-unbounded ---Childnode)

XYZ|H|

XYZ|G|

.

.

.

.

And the target side structure(xsd) is follows:

customer------mainnode(record)

book

pen

value------child node

V----


child of value

..................................................................................................................

my requirement is, i have to create multiple Customer records based on number of XYZ present in a ABC node.like 3 as above.

And second thing is "value" should create based on number of ABC.like 2 as above.

third one is under each value node first "V" should get the value of first XYZ of first ABC and second "V" should get the value of first XYZ of second ABC.

..................................................................................................................................................

the output should look like :

Customer

book

pen

value

V

value

V

Customer

book

pen

value

V

value

V

Customer

book

pen

value

V

value

V

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Here you are mapping a parent to child and child to parent. Are you sure you got the business requirement correctly?

Please clarify what the Value and V stand for in the target structure.

Can you give a live example with final results instead of the above example?

If your message can have multiple ABC nodes,

and each ABC node can have any number of XYZ nodes,

then you can have the number of customer notes = total no. of XYZ nodes in the entire message.

To achive your mapping you need to change contexts and store those values in the container using user defined functions to re-use them.

Eg: User-defined functions:

String setArg1(argument1)

{

container.getGlobalContainer().setParameter("arg1", argument1);

return somevalue;

)

String getArg1()

{

return container.getGlobalContainer().getParameter("arg1").toString();

}

This is because your context will have more XYZs than ABCs, thus you will have to store the ABCs along with thier first XYZ.

To do so, please refer http://www.riyaz.net/sap/xipi-introduction-to-context-handling-in-message-mapping/5/

Regards,

Priyanka Salvi