Skip to Content
avatar image
Former Member

Mapping Help Needed

Hello Gurus,

I need help in message mapping. I have a requirement as below.

E1EDP01 segment contains many E1EDP19 segments

E1EDP19 segment contains QUALF, KTEXT and many other fields.

in the output field, for every QUALF = "002", I need the value of KTEXT of the same E1EDP19.

the output group is repeated per E1EDP01 (this is working fine)

The problem is that KTEXT segment is not coming in every E1EDP19, so the result is erratic.

the present code looks like

  Qualf (context E1EDP01)--
                            Equals  --  
               const-002 --           IF   --Outputfield
           KTEXT(context E1EDP01)--

I tried many other things as well, but result is not as expected

pls help.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Nov 03, 2009 at 03:21 PM

    Use node function 'exists' and then use 'If then else' to check if the node doesnot exist pass a blank value for KTEXT .

    This is just to prevent mismatch when you check QUALF value for 002 and corresponding KTEXT.

    But while mapping to the output field, check if QUALF=002 and KTEXT != blank, then only create target field.

    Edited by: nagarjuna _s on Nov 3, 2009 4:22 PM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      > I tried "exists", but it did nt work. can you pls explain how to insert blank to KTEXT and continue to get the output.


      Ideally the "exists" should work for your case but in case you are seeing issues with that,

      you can try to use "mapWithDefault" function with the KTEXT to insert blank to KTEXT.


  • avatar image
    Former Member
    Nov 03, 2009 at 03:51 PM


    Please use following mapping.

    1. Use If then else.

    u2022 If condition should be QUALF -->Map with default = constant value 002

    u2022 If condition satisfies, then pass KTEXT --> Map with default

    u2022 Else constant value Blank Space

    2. Output of "If then else" -->Remove context -->Sort (descending Order) -->collapse context --> target field.

    Please keep context of all fields E1EDP19.

    Let us know output.

    Warm Regards,


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member


      Thanks for your help.

      Gouri's hints (FormatbyExample & context) helped alot.

      but I could get the results with the same configuration as above (in my initial post), by changing the context & adding the "FormatbyExample" for both QUALF & KTEXT. Need not do all what is mentioned in Gouri's answer.

      also, I think it is a type 'o' error in your second line to mention QUALF (instead of KTEXT).

      thanks again


  • avatar image
    Former Member
    Nov 03, 2009 at 03:15 PM

    whats is occurrence for E1EDP01 node?

    Can you also provide a sample input and an expected output ?


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Pooja,

      Thanks for looking into it...

      I have given the concerned part of the input as sample

      1) <E1EDP01> - occurs multiple times (but thats not causing any issue)

      2) <E1EDP01>...

      <E1EDP19 SEGMENT="1"><QUALF>001</QUALF><IDTNR>81116080</IDTNR></E1EDP19><E1EDP19 SEGMENT="1"><QUALF>013</QUALF><IDTNR>00111016080</IDTNR></E1EDP19><E1EDP19 SEGMENT="1"><QUALF>900</QUALF><IDTNR>11T</IDTNR></E1EDP19><E1EDP19 SEGMENT="1"><QUALF>901</QUALF><KTEXT>1.000</KTEXT></E1EDP19><E1EDP19 SEGMENT="1"><QUALF>902</QUALF><IDTNR>92213047</IDTNR></E1EDP19><E1EDP19 SEGMENT="1"><QUALF>903</QUALF><IDTNR>422000</IDTNR></E1EDP19><E1EDP19 SEGMENT="1"><QUALF>002</QUALF><IDTNR>2216080</IDTNR><KTEXT>Mat desc BOX</KTEXT></E1EDP19><E1EDP19 SEGMENT="1"><QUALF>007</QUALF><IDTNR>8441000</IDTNR></E1EDP19><E1EDP19 SEGMENT="1"><QUALF>003</QUALF><IDTNR>822461067</IDTNR><KTEXT>HE</KTEXT></E1EDP19><E1EDP19 SEGMENT="1"><QUALF>011</QUALF><IDTNR>2211</IDTNR></E1EDP19>....</E1EDP01>

      here in #2, if you notice KTEXT does not come in all E1EDP19 sements, my expected output is when QUALF = 002, I need the KTEXT. I tried different codes (and also the one in my initial question), but I am not getting the required output due to context changes etc...

      pls help