Skip to Content
avatar image
Former Member

To Add Quantity in mapping in case if Line items have same Material and same sales order

Hi all

We have an existing interface file to Idoc (DESDAV).

At present though multiple line items has same Material and same Sales Order quantity is received in each segment.

New requirement is to add Quantity.

Example:

Input:

Order1      Material1     2(Quantity)

Order1      Material1     5(Quantity)

Order4      Material3     1

Order5      Material3     10

Output:

Order1     Material1     7(Quantity)

Order4      Material3     1

Order5      Material3     10

Idoc:

E1EDL24

     KDMAT (Material)

     LFIMG  (Quantity)

     E1EDL41

          BSTNR (sales order)

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Jul 27, 2016 at 03:16 AM

    Hi Anitha!

    In case of data groupping by some key with aggregation you can map message to itself in first step with following transformation:

    In second step you can map result message with same structure and groupped data to IDoc.

    Regards, Evgeniy.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi All

      Thanks for your response.

      I tried all the ways as suggested by you people.

      I can able to Sum the quantities with same material and same Order in line item and suppress item incase of same material and same Order.

      Closing the Thread.

  • Jul 26, 2016 at 02:28 PM

    Hello Anith,

    Try the below logic and UDF.

    Select Context as root node.


    Untitled.png (12.4 kB)
    Capture1.JPG (55.3 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Hi Anitha,

      I was able to accomplish the adding using the following graphical mapping and input/output structure with one small UDF.  Here are the screenshots of the structure, the mapping and then the code for the UDF.

      addValues UDF Code -

      int num = 0;
      for(int i = 0; i < var1.length; i++) {
        num += Integer.parseInt(var1[i]);
      }
      result.addValue(num);
      

      Regards,

      Ryan Crosby

      Capture.PNG (12.6 kB)
      Capture.PNG (23.6 kB)
  • Jul 26, 2016 at 06:59 PM

    Hi Anitha,

    Exactly same what Ryan did with a slight modification and prominent order and material split -

    Thanks,

    Apu


    1.JPG (93.2 kB)
    2.JPG (21.1 kB)
    3.JPG (17.1 kB)
    4.JPG (87.2 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Jul 26, 2016 at 04:09 PM

    Refer this, it has the similar requirement.

    http://scn.sap.com/thread/3935663

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 26, 2016 at 11:03 PM

    Hi Anitha,

    For order you can use this but for the material and qty you can use the UDF-

    assumed your structure is like below -


    Add comment
    10|10000 characters needed characters exceeded