Skip to Content
0
Former Member
Nov 08, 2011 at 01:18 PM

Provide the java code for the following scenario.

30 Views

Hi Experts,

I have tried with all the combinations for this scenario. As per my understanding i require java code for the following scenario

so that it becomes easy........

I require a Message mapping for this Logic.

In the Source there are 4 fields and, the Target side, the fields should appear like this.

Source Structure- File

Record

|-> Header

Order_No

Date

|-> Item

Mat_No

Quantity

Target Structure-IDoc

IDoc

|-> Header

|-> Segment

Delivery_Order_No

Recv_Date

|-> Item

|-> Segment

Delivery_Order_No

Material_Num

Recv_Quantity.

The Logic is for every Order number an IDOC is generated.And if the Material num matches then the quantity should be added. and important note is that the material numbers are different for every order number. That means if a material number is 2 in the order number A. Then the material number can never be 2 in any of the order numbers.Here is the following with an example for the above scenario.

For example:-

we have

Source Structure- File

Order-no Date Mat_No Quantity

1 01/02/2011 A 10

1 01/02/2011 B 15

1 01/02/2011 A 10

2 01/02/2011 C 10

2 01/02/2011 C 10

3 01/02/2011 D 20

3 01/02/2011 D 10

3 01/02/2011 E 25

Target Structure-IDoc

Delivery_Order_No Recv_Date Material_Num Recv_Quantity

1 01/02/2011 A 20

1 01/02/2011 B 15

2 01/02/2011 C 20

3 01/02/2011 D 30

3 01/02/2011 E 25

So for this example total of 5-Idocs created. That means for this example if Order_No is 1 When the Mat_No is A 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) is generated by adding the quantity field in the Target Side. Similarly if Order_No is 1 when the Mat_No is B then separate IDoc is generated 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 2 when the Mat_No is C, an IDoc is generated with four Fields 2 in Header(Delivery_Order_No, Recv_Date) and 2 in Item(Material_Num, Recv_Quantity) by adding the quantity field in the Target Side. ike wise the process goes on upto 3.Kindly do the needy..

Kindly provide the java code.

Thanq very much in advance..