Mappingproblem

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

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

Similar Messages

Maybe you are looking for

  • HT2736 I'm trying to send a tune as a gift but, every time I fill out the info, and press "continue", I get a message that my session has "timed out".

    I'm trying to send a tune as a gift but, every time I fill out the info, and press "continue", I get a message that my session has "timed out". I didn't take me over a minute to fill out the form. How fast does one have to be!?

  • How to view images from PC on MAC

    Have iMAC 10.6.8. Using iPhoto '09. Have lots of pictures saved on CD downloaded from a PC. Problems viewing them on MAC. First, what is an easy way to view them on MAC without transferring them, and secondly, what is the best way to transfer them to

  • Possible to get Apple TV for older TV

    I'm hoping there is a way (and if so, how) to hook up any generation of Apple TV to this television http://www.cnet.com/products/samsung-hln567w/specs/ If so, PLEASE respond ASAP! Thanks so much in advance for any help, Christian

  • Use of Round function

    Hi,    I have a requirement to round off the values. The round offed values should store in another variable. Can u give function module or any operator to achieve this one.    Ex v1 = 12.567.   round of v1  = v2  = 13. Rewards as per answer.

  • "isn't in fpermittedfrontapps"

    Can anyone explain this error and how I might circumvent it?  It appears whether I'm scripting in applescript, from the command line, in automator and other scripting languages.  I tested all to be dead sure it's not my code. The offending applicatio