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

Require a message mapping for the following scenario.

Hi,

I require a Message mapping for this Logic.

In the Source I have 4 fields and in the Target side, the fields should appear like this.

Source Structure- File

Order_No

Date

Mat_No

Quantity

Target Structure-IDoc

IDoc

|-> Header

|-> Delivery_Order_No

|-> Recv_Date

|-> Item

|-> Delivery_Order_No

|-> Material_Num

|-> Recv_Quantity.

That means For the Same Order-no if the Material number matches then Recv_Quantity should be added and for this whole 1 IDoc should be created.

Even if the Item matches but the Order-no doesnot match then separate IDoc should be created

Also If the Order-no matches but not Material number then also separate IDoc should be created.

For example:-

we have

Source Structure- File

Order-no Date Mat_No Quantity

A 01/02/2011 1 10

A 01/02/2011 2 20

A 01/02/2011 1 10

B 01/02/2011 2 10

B 01/02/2011 1 10

C 01/02/2011 1 20

C 01/02/2011 1 10

C 01/02/2011 3 20

Target Structure-IDoc

Delivery_Order_No Recv_Date Material_Num Recv_Quantity

A 01/02/2011 1 20

A 01/02/2011 2 10

B 01/02/2011 1 10

B 01/02/2011 2 10

C 01/02/2011 1 30

C 01/02/2011 3 20

So for this example total of 6-Idocs created. That means for example if Order_No is A When the Mat_No is 1 the quantity gets added. For this Scenario 1 IDoc with four Fields 2 in Header(Delivery_Order_No, Recv_Date) and 2 in Item(Material_Num, Recv_Quantity) in the Target Side. Similarly if Order_No is A when the Mat_No is 2 then separate IDoc needs to be created with four Fields 2 in Header(Delivery_Order_No, Recv_Date) and 2 in Item(Material_Num, Recv_Quantity) in the Target Side. Like wise the process goes on upto C.

Kindly do the needy..

Thanq very much in advance..

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 Sep 12, 2011 at 07:36 AM

    Hi,

    Below is the logic for some fields, use same logic of "Delivery_Order_No" for other field as rest of the fields will have same logic

    1. Idoc

    Mat_num --> Remove Context ---> sort ---> splitByValue(value change) ---> collapse context ---> IDoc

    2. Material-Num

    Mat_num --> Remove Context ---> sort ---> splitByValue(value change) ---> collapse context ---> splitByValue(each Value) ---> IDoc

    3. Delivery_Order_No

    SortByKey ---> formatByExample ---> Collapse Context ---> splitByValue (each Value) ---> Delivery_Order_No

    SortByKey

    1st Input : Mat_num --> Remove Context ---> Ist Input

    2nd Input : Order_No ---> Remove COntext --> 2nd Input

    FormatByExample

    1st Input: Output of SortByKey

    2nd Input: Mat_num --> Remove Context ---> sort ---> splitByValue(value change)

    4.Quantity

    SortByKey ---> formatByExample ---> sum --->Quantity

    SortByKey

    1st Input : Mat_num --> Remove Context ---> Ist Input

    2nd Input : RCVQuantity---> Remove COntext --> 2nd Input

    FormatByExample

    1st Input: Output of SortByKey

    2nd Input: Mat_num --> Remove Context ---> sort ---> splitByValue(value change)

    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.