on 07-04-2012 11:24 PM
Hi All,
I have the following mapping requirement :
Source Structure : Multiple delivery document with line numbers,batch numbers ,toteid's & Serial numbers.Each row in the table below is a record (0.. many).
One Target Idoc is created for one delivery.
DEl# | Line# | Batch# | Material | Serial | ToteID | Qty |
123 | 10 | 1 | ABC | 8123 | 2 | |
123 | 20 | 1 | DEF | 8123 | 3 | |
124 | 10 | 89 | ABC | 8123 | 2 | |
124 | 10 | 90 | ABC | 8124 | 4 | |
124 | 20 | 1 | DEF | 8123 | 3 | |
125 | 10 | 1 | XYZ | 78 | 810 | 5 |
125 | 10 | 1 | XYZ | 79 | 810 | 1 |
125 | 10 | 1 | XYZ | 80 | 810 | 1 |
125 | 10 | 1 | XYZ | 81 | 810 | 1 |
125 | 20 | 1 | DEF | 810 | 3 |
How segments should be created
IDOC ( 1...9999) 1 delivery per Idoc
|
E1EDL20 ( 1...9999) ONLY 1 segment per Idoc
|_______E1EDL24 (0...9999) multiple segments per line item and batch# combination for a delivery
|
The output should be as follows for a delivery Idoc
IDOC (Del#124)
|
E1EDL20
|_______E1ED24
|____HIPO = 10
|_______E1ED24
|____HIPO = 10
|_______E1ED24
|____HIPO = <Blank>
Thanks,
Collins
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
You can try this mapping:
The output is:
Apologies for the late response, I was on vacation
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Collins,
Please try this mapping. I think this is giving correct output.
I wrote two UDF here- Tile and multiple_occurance
Title is having execution type as " all value in context"
===================================
MappingTrace trace;
trace = container.getTrace();
trace.addWarning("length "+var1.length);
int i=0;
for (i=0 ; i<var1.length-1; i++)
{
result.addValue(var1[i]);
if (var1[i+1]!=var1[i])
result.addContextChange();
}
result.addValue(var1[i]);
======================================
and another is UDF is multiple_occrance
and its code is here-
This is also having execution type as " all value in context"
/////////////////////////////////////////////////////////////////////////////////
int i=0;
i=var1.length;
if (i>1)
{
for (int j=0; j<i;j++)
result.addValue(var1[j]);
}
else
result.addValue("");
//////////////////////////////////////////////////////////////////////////////////////
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.