Hello Muniyappan
The logic and code you provided worked perfectly fine if only one kind of REGION records are coming from source table. But now there is change in requirement and accordingly I need to change mapping and UDF code.
Previously I took example of getting records for only one REGION at a time, but using SELECT query in sender cc we cannot restrict to pick up one kind of REGION in 1st call and then other kind of REGION in second call. In source table REGION are many e.g. BRA, NEU, LATAM etc.
Using stored procedure this can be done or not, I have no idea. If this can be achieved then my problem is resolved otherwise need to do changes in mapping.
Sender CC can fetch records like below
Table in ECC contains one Sales_Org for BRA and seven Sales_Org for NEU
According to above input I need to achieve:
One IDOC for both BRA
Two segments of E1MARAM
One segment of E1MVKEM under both E1MARAM
One IDOC for NEU
One segment of E1MARAM
Seven segment of E1MVKEM under one E1MARAM
IDOC
E1MARAM
E1MVKEM
E1MARAM
E1MVKEM
IDOC
E1MARAM
E1MVKEM
E1MVKEM
E1MVKEM
E1MVKEM
E1MVKEM
E1MVKEM
E1MVKEM
I am able to achieve
IDOC
E1MARAM
E1MARAM
IDOC
E1MARAM
but E1MVKEM contexts are in wrong shape
Mapping screenshots are below
Mapping of E1MVKEM
Display Queue of RFC Lookup
Display Queue of Divide
Wrong input and output values. It should be [1], [1] and [7]
Display Queue of ContextChange
Input 1 should be [1], [1], [7]
Output should be [BRA]
Context Change
[BRA]
Context Change
[NEU]
[NEU]
[NEU]
[NEU]
[NEU]
[NEU]
[NEU]
I tried to modify you code but did not succeed. I am not good in Java.
IDOC Mapping
E1MARAM Mapping
Please reply ASAP need this urgently.
Thanks
Dheeraj Kumar