Skip to Content
avatar image
Former Member

SAP PI Map Repeat source field as many times as Context on other field

Hi there experts,

I facing some mapping and I cannot see the logic. Scenario is IDOC to Flat File, and I'm generating at target file as many lines as POSNR (positions) at the IDOC.

Thing is now they want to have more lines at some positions that have inside more values (some box code).

I need to have at the target file:

POS 001 BOX1

POS 001 BOX2

POS 001 BOX3

POS 002 BOX4

POS 003 BOX5

Thing is, to repeat the pos as many times as there are boxes at same context. Is there any UDF easy solution to this?

Cheers, and thanks a lot in advance


img1.png (26.1 kB)
img2.png (23.8 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 29, 2016 at 01:25 AM

    Hi Eduardo!


    public void multiplyQueues(String[] q1, String[] q2, ResultList result1, ResultList result2, Container container) throws StreamTransformationException{

    for (int i=0; i<q1.length; i++)
    for (int j=0; j<q2.length; j++)
    if (!(q1[i].equals(ResultList.SUPPRESS) || q2[j].equals(ResultList.SUPPRESS))) {
    else {

    Execution type: All values of a Context.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded