Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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.

Former Member
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question