Skip to Content
avatar image
Former Member

question related to abap logic

Dear all,

I have a requirement where I need to take quantity field from a EDW dso which is having

keys as document number ,item,schedule line ,process key.

And in DSO1 where I am trying to write lookup is having only keys Document number and item .

Now I need to consider quantity field from processkeys 3. .And in case of multiple schedule lines this quantity needs to be cumulated

eg:--DSO1 DOC NUM ITEM QUANTITY

100 10 60

Lookup dso :-- doc num item schedule line proceskey quantity

100 10 1 3 10

100 10 2 3 20

100 10 3 3 30

Now in my DSO1 I need to get Quantity as 60.I tried to define Internal table and tried to consider quantity from Processkey 3 but how to cumulate in case of multiple schedule lines.I am trying to write this logic at transformation level.

Could you please help.

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 01, 2017 at 02:02 PM

    easiest way would be to load the data from your lookup dso (let's call this lookup1) to a next DSO with only DOC and NUM as key (let's call this lookup2). Due to the design of the dso, data will be aggregated, so for the given example you'll have 100 10 60 in your look up dso lookup2.

    now in your transformation instead of reading lookup1, just read lookup2 with the key and it will return the value 60.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 05, 2017 at 06:19 PM

    Define first internal table with process key fields and quantity -> SELECT All document number/Item number and upload into this first internal table

    Define second internal table with 'Hashed type' with UNIQUE KEYas we only Doc num and Doc item.

    Loop over first internal table and use COLLECT statement to update it into second internal table to add it by default. Then you use the second internal table to populate values in your result package.

    Add comment
    10|10000 characters needed characters exceeded