Skip to Content
avatar image
Former Member

To create multiple target IDoc node E1BPMEPOTEXT

Hi All,

Scenario is HTTP to IDoc.

Sender is sending multiple POLINE(occurence 1toUnbound) in which ITEM_DESCRIPTION(1to1) is different for each POLINE. And the ITEM_DISCRIPTION is mapped to TEXT_LINE(0to1) of E1BPMEPOTEXT(0to999999999). TEXT_LINE length is 132.

ITEM_DESCRIPTION is mapped with E1BPMEPOTEXT using UDF for multiple creation of E1BPMEPOTEXT

for (int i=0; i<=((itemText[0].length()/132)); i++)

{

result.addValue("");

}

The sender PO_NUMBER is mapped using useOneAsMany as first input, in second input the ITEM_DESCRIPTION is mapped using above udf, and again in third input ITEM_DESCRIPTION again mapped using same udf. useOneAsMany mapped to SplitByValue(EachValue) and to PO_NUMBER of IDoc.

The same mapping using useOneAsMany the LINE_NUM is mapped to PO_ITEM.

For TEXT_LINE, the ITEM_DESCRIPTION is mapped using another udf to SplitByValue(EachValue) and to TEXT_LINE.

This mapping is working fine as long as only one POLINE is generating in sender structure. But when multiple POLINEs occuring with multiple different ITEM_DESCRIPTIONs the logic is not becoming ideal.

Now requirement is, multiple ITEM_DESCRIPTIONs should create multiple E1BPMEPOTEXT along with its elements, where TEXT_LINE lenght is 132. Is this possible?

Please suggest me some solution.

Capture.JPG (15.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 19, 2014 at 01:02 AM

    Hello,

    Always try to explain mapping doubts along with source and target structure.

    Now coming to ur question, i think ur u are not using correct UDF. Check this:

    Execution type: all values of a context

    Input: var1

    if(!var1[0].equals("")) { int len = var1[0].length(); int divide = len/132; String out = ""; int temp = 0; if(len%132== 0) { for(int i=0;i<divide;i++) { temp = 132*i; out = var1[0].substring (0+temp,132+temp); result.addValue(out); } } else { for(int j=0;j<divide;j++) { temp = 132*j; out = var1[0].substring (0+temp,132+temp); result.addValue(out); } result.addValue (var1[0].substring (divide*132, len)); } } else result.addSuppress();

    Thanks

    Amit Srivastava


    Capture.PNG (44.0 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Mar 18, 2014 at 11:41 PM

    Hi Naveen - When ITEM_DESCRIPTION(field) is different for each POLINE(parenet node) and when you want to create separate E1BPMEPOTEXT(target node) for each ITEM_DESCRIPTION then why don't you map POLINE node to E1BPMEPOTEXT?

    If my assumption is wrong, i would request to share the source xml and expected output..

    Add comment
    10|10000 characters needed characters exceeded