Skip to Content
author's profile photo Former Member
Former Member

node mapping

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 13, 2011 at 10:37 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.