Skip to Content
author's profile photo Former Member
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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on 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 a 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.

  • Posted on 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 a 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)
  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 26, 2016 at 04:09 PM

    Refer this, it has the similar requirement.

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.