cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Help required for ORDER Idoc to EDI file

Former Member
0 Kudos

Hi

My source strcture is as follows

E1EDP01

E1EDP01

E1EDPT1 (TDID=0001)

E1EDPT2

TDLINE = abcd

E1EDPT1 (TDID=0001)

E1EDPT2

TDLINE = XYZ

and my target line item is mapped with TDLINE(Context E1EDP01)-exist then createif LineItem(This is working fine but item filed is failing)

The logic to populate itemFIELD1 is if E1EDT1(TDID==0001) then pass TDLINE to ItemFIELD1, how to map this

(Sometimes E1EDPT2 populate multiple times for one E1EDPT1)

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

>and my target line item is mapped with TDLINE(Context E1EDP01)-exist then createif LineItem(This is working fine but item filed is failing)

Why don't you create the LineItems only when TDID = 0001 because this will ensure to populate item fields with correct value.

The mapping logic to produce the LineItems should be like this..

IF (TDID = 0001) THEN (TDLINE set context to E1EDPT1)---RemoveContext---LineItem.

>The logic to populate itemFIELD1 is if E1EDT1(TDID==0001) then pass TDLINE to ItemFIELD1, how to map this

In this mapping make sure the context of TDLINE is set to E1EDPT1 and then use RemoveContext ---SplitByValue to the output of "IF" function. e.g.

IF (TDID = 0001) THEN (TDLINE set context to E1EDPT1)---RemoveContext---SplitByValue---FIELD1.

Former Member
0 Kudos

actullly my target strcrutre is as follows

E1EDP01------LINEITEM1

TDLINE(Context E1EDP01)existcreateif--LINEITEM2

TDLNEWHEN TDID is 0001ITEMFIELD1

if i am following above logic for the starting source example the ITEM2 field is populating in first occurenace of ITEM1, which should not populate in that one.

Former Member
0 Kudos

Can you show how your target structure looks like and what are the conditions to generte the target nodes.

Former Member
0 Kudos

source Idoc is

<IDOC>

<E1EDP01>

<E1EDP01>

<E1EDPT1>

<TDID>0001</TDID>

<E1EDT2>

<TDLINE>First</TDLINE>

<E1EDPT1>

<TDID>0001</TDID>

<E1EDT2>

<TDLINE>Second</TDLINE>

I need Traget strcture like below

<ROOT>

<HITEM>

<HITEM>

<LITEM>

<FIELD>First</FIELD>

<LITEM>

<FIELD>First</FIELD>

Edited by: nareshchandra on Jul 5, 2011 3:28 PM

Former Member
0 Kudos

one E1EDPT1 can have multiple E1EDPT2( the same TDLINE)

Former Member
0 Kudos

Use the If function for your requirement. Keep the context of both TDID and TDLINE as E1EDP01 or E1EDPT1. After the If function, use a RemoveContext and SplitByValue.

TDID --> EqualS (001)
                            ----------->If-->RemoveContext-->SplitByValue-->FIELD1
TDLINE

Former Member
0 Kudos

if E1EDT1 TDID=001 and it cintains two E1EDPT2 TDLINES it is going to next item field.

Former Member
0 Kudos

Try concatenating the TDLINEs under a E1EDPT1 before passing to the If function.

Former Member
0 Kudos

i tried but still it is misplacing the velueds in different postiotions

Former Member
0 Kudos

You would need to write a small UDF to concat all the TDLINES under one E1EDPT1 into one text value. The concat function under text will not be sufficient for this.

You can use a context function for this :

Input parameter tdline

String ret = "";
for(int i=0;i<tdline.length;i++)
  ret = ret.concat(tdline<i>);

result.addValue(ret);

keep the context of TDLINE as E1EDPT1. The output of the UDF goes to your If function.

Former Member
0 Kudos

Hi,

Change the context of E1EDPT1 and check the condition ...this will work..

HTH

Rajesh

Former Member
0 Kudos

no I need E1EDP01 context to populate line item