on 10-21-2010 7:27 AM
Hi.
I have a mapping using the INVOIC02 IDoc.
I'm using data in the E1EDK03 segment to populate a field in the E1EDP02 segment.
In the explenation I will just present the effected segment and fields.
Source:
<INVOIC02>
<IDOC BEGIN="">
<E1EDK03 SEGMENT="1">
<IDDAT>012</IDDAT>
<DATUM>20100520</DATUM>
</E1EDK03>
<E1EDK03 SEGMENT="2">
<IDDAT>044</IDDAT>
<DATUM>20100525</DATUM>
</E1EDK03>
<E1EDP01 SEGMENT="">
<E1EDP02 SEGMENT="">
<QUALF>001</QUALF>
</E1EDP02>
<E1EDP02 SEGMENT="">
<QUALF>012</QUALF>
</E1EDP02>
<E1EDP02 SEGMENT="">
<QUALF>021</QUALF>
</E1EDP02>
</E1EDP01>
</IDOC>
</INVOIC02>
When the IDDAT in E!EDK03 has the value 012 the DATUM field should be populating the DATUm field in E!EDP02 if the QUALF field in the same segment has the value 012.
I tried a UDF to acomplish this. It looks as bellow.
public void P02DATUMQALF012(String[] var1, String[] var2, String[] var3, ResultList result, Container container) throws StreamTransformationException{
String text = "";
for (int i=0; i<var1.length; i++) {
if ( var1<i>.equals("012") ){
text = var2<i>;
}
}
for (int i=0; i<var3.length; i++) {
if ( var3<i>.equals("012") ){
result.addValue(String.valueOf(text));
}
else {
result.addValue("");
}
}
}
With this UDF I and SplitByValue after it I get the following result.
<INVOIC02>
<IDOC BEGIN="1">
<E1EDK03 SEGMENT="1">
<IDDAT>012</IDDAT>
<DATUM>20100520</DATUM>
</E1EDK03>
<E1EDK03 SEGMENT="2">
<IDDAT>044</IDDAT>
<DATUM>20100525</DATUM>
</E1EDK03>
<E1EDP01 SEGMENT="1">
<E1EDP02 SEGMENT="1">
<QUALF>001</QUALF>
<DATUM/>
</E1EDP02>
<E1EDP02 SEGMENT="2">
<QUALF>012</QUALF>
<DATUM/>
</E1EDP02>
<E1EDP02 SEGMENT="1">
<QUALF>021</QUALF>
<DATUM>20100520</DATUM>
</E1EDP02>
</E1EDP01>
<E1EDP01 SEGMENT="2">
<E1EDP02 SEGMENT="1">
<QUALF>001</QUALF>
<DATUM/>
</E1EDP02>
<E1EDP02 SEGMENT="2">
<QUALF>012</QUALF>
<DATUM/>
</E1EDP02>
<E1EDP02 SEGMENT="1">
<QUALF>021</QUALF>
<DATUM/>
</E1EDP02>
</E1EDP01>
</IDOC>
</INVOIC02>
What am I doing wrong?
BR
Kalle
I do not see anything wrong, but this is not possible to say just from an extract from the payload.
When you do test, then check the input and output queues of your UDF.
I suppose that the context of the queues are not correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry mised that
var1 = IDDAT (E1EDK03)
var2 = DATUM (E1EDK03)
var3 = QUALF (E1EDP02)
will present queues as follow.
value = white line in queue
value = grey line in queue
var1 queue:
012
012
044
044
var2 queue:
20100520
20100520
20100525
20100525
var3 queue:
001
001
012
012
021
021
Result queue:
[]
[]
20100520
[]
[]
[]
Looks as the resultqueue has no context and making to many [] entrys.
I would like the resultqueue to look as follow:
Result queue:
[]
[]
20100520
20100520
[]
[]
BR
Kalle
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.