on 07-05-2011 9:25 AM
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)
>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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Hi,
Change the context of E1EDPT1 and check the condition ...this will work..
HTH
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.