cancel
Showing results for 
Search instead for 
Did you mean: 

Need Mapping Help

Former Member
0 Kudos

Hi Experts,

I am doing outbound scenario IDoc(invoic.invoice05) to file. in that based on the material number and ID we should replicate the target structure.

Source structure fields,

E1EDP01        0..Unbound

    Z1EDPM1    0..Unbound

        ID             1...1

    E1EDP02      0..Unbound

        Mterail Number  1..1

Trget Structure is

RequestMessages>       1..1

  <RequestMessage>     1..Unbound

<Searchcriterias>            1..1

           <SearchCriteria>  1..Unbound

                 <ID>

                 <Mterail Number>

if Mterial is exist then we should replicate <RequestMessage> and <SearchCriteria> nodes.

ex:

Material

ID

1

A1

A2

2

B1

B2

B3

3

expected output xml should be

RequestMessages>     

  <RequestMessage>    

        <Searchcriterias>           

               <SearchCriteria>

                     <ID>A1</ID>

                     <Mterail Number>1</Mterail Number>

                  </SearchCriteria>

                <SearchCriteria>

                      <ID>A2</ID>

                     <Mterail Number>1</Mterail Number>

                  </SearchCriteria>

            </Searchcriterias>   

   </RequestMessage>

<RequestMessage>    

        <Searchcriterias>           

               <SearchCriteria>

                     <ID>B11</ID>

                     <Mterail Number>2</Mterail Number>

                 </SearchCriteria>

                <SearchCriteria>

                      <ID>B2</ID>

                     <Mterail Number>2</Mterail Number>

                  </SearchCriteria>

                  <SearchCriteria>

                      <ID>B3</ID>

                      <Mterail Number>2</Mterail Number>

                  </SearchCriteria>

            </Searchcriterias>   

   </RequestMessage>

  <RequestMessage>    

        <Searchcriterias>           

               <SearchCriteria>

                     <ID></ID>

                     <Mterail Number>3</Mterail Number>

            </Searchcriterias>   

   </RequestMessage>

This how target is expecting how to handle the context? Please help me on this and highly appreciated for your help. 

Regards,

Sanjay.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sanjay

Do the mapping as below

Output:

Answers (1)

Answers (1)

Harish
Active Contributor
0 Kudos

Hi Sanjay,

The node SearchCriteria is need to generate as many times as ID in Z1EDPM1 Context.

you need to format Material no as per this node to repeat.

node RequestMessage needs to be created for unique material no, so

material no -> collapse context -> splitbyvalue -> RequestMessage

hope this is help.

Regards,
Harish

Former Member
0 Kudos

Hi Sirish,

Thanka for prompt reply.

As you mentioned above if i am using material no -> collapse context -> splitbyvalue -> RequestMessage this condition it should genrate one Request message only. we need to create 3 Request mesages.

Regards,

Sanjay.

Harish
Active Contributor
0 Kudos

Hi Sanjay,

try this

material no -> remove context -> split by value value change -> collapse context -> splitbyvalue each value -> RequestMessage

Regards,

Harish