on 03-18-2014 11:32 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.