cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping logic to create xml file

former_member593220
Participant
0 Kudos

HI Experts,

I am doing a Proxy to File scenario and my mapping requirement is as follows.

Source structure:

MT_POCreateSource

    Row

      column1

      column2

      column3

        -

        -

      column15

    Row

Target structure sholud be:

MT_POCreateTarget

    POHeader_DTL

        column1 

        column2

        column3

           -

           -

         column8

    POHeader_DTL

        POItem_DTL

            column1

            column2

            column3

            column4

               -

               -

             column9

         POItem_DTL

As per the mapping sheet all the fileds sholud be directly mapped with the respective source filed values. My requirement is PI shold create the XML file in the target directory, which may contains multiple records in the XML. But every record sholud be created with the Header and details part by PI mapping in target directory.

Can anybody please tell me by suing which logic I can produce the two nodes in the target XML from the single source root node.

Requesting you to please help me to write the logic.

Thanks in advance.

--

Regards

Raj

Accepted Solutions (0)

Answers (2)

Answers (2)

gagandeep_batra
Active Contributor
0 Kudos

Hi Raj,

As above said they useOneasmany function.......

check below link.....

http://help.sap.com/saphelp_nw04/helpdata/en/ef/df564b6aa24fc9ab0d685460747de5/content.htm

Regards

gagan

former_member593220
Participant
0 Kudos

HI Gagan,

Thanks for your reply.

In source structure i am having one node Row, and in target structure i need to create PO details with two nodes like header and details, my concern is just about the target nodes Header and Details that how can i create those by using one source root node Row..

Is there any way to create the same by using any other logic..?

Remaining all other source columns will be directly mapped to Target fields.

Or shall I create another node in source structure in Proxy structure..? to map the two target node to create the simple xml structure..?

Please suggest me..?

Thanks in advance..

--

Regards

Raj

nabendu_sen
Active Contributor
0 Kudos

Single Source field can be mapped to multiple target fields in your PI mapping editor, just drag and drop. Just Map like:

MT_POCreateSource/Row  ---> MT_POCreateTarget/POHeader_DTL

MT_POCreateSource/Row  ---> MT_POCreateTarget/POItem_DTL

You dont need to map anything to 'MT_POCreateTarget'.

former_member593220
Participant
0 Kudos

Hi Sen,

Thanks for your reply. I have already tried with this but when testing, PI is not creating the target nodes (header,details) in sequence.

it is creating like : Row

                               Header

                                  DTL

                            Row

                                  DTL

                                  DTL

                             Row

                                Header

                                Header

Please suggest me soming to achieve this.

--

Regards

Raj

nabendu_sen
Active Contributor
0 Kudos

Hi Raj,

Can you please attached screenshot of the mapping which is generating the above mentioned data?

gagandeep_batra
Active Contributor
0 Kudos

hi raj

can you post ur  source xml and expected target xml for batter unnderstanding with example.......

means with values...............

regards

Gagan

former_member201264
Active Contributor
0 Kudos

Hi Raj,

You can use UseOneAsMany Node Function in the mapping.

Regards,

Sreeni.