cancel
Showing results for 
Search instead for 
Did you mean: 

Delete using aggregated quantity in end routine

Former Member
0 Kudos

Is it possible to delete data out in an end routine by aggregated quantity? Or do I need to code it?

I have a DSO being loaded with forecast data. However I dont want to keep any data where there is a quantity less than 200 for any particular material in any given period. However data comes through in lines that are less than two hundred but when aggregated together may be greater than 200.

I tried a simple delete result package statement but due to the fact they are not aggregated at this point it delete out all the lines which add up to be greater than 200. 

Accepted Solutions (1)

Accepted Solutions (1)

former_member185132
Active Contributor
0 Kudos

It is possible, assuming that all the data for a given period and material combination is being loaded with the same DTP request.

If that is the case, then apply a Sem. Grouping for Period and Material in the transformation. Then, write an end routine based on the below pseudocode.


DATA: ls_summary --- a work area containing matl, plant and qty.

DATA: lt_summary --- a HASHED table with line like ls_summary and default key

LOOP AT RESULT_PACKAGE ASSIGNING <RP>.

     Copy Material, Plant and Qty from <RP> to ls_summary.

     COLLECT ls_summary into lt_summary.

ENDLOOP.

LOOP AT lt_summary into ls_summary where qty < 200.

     DELETE from result_package where matl = ls_summary-matl and plant = ls_summary-plant.

ENDLOOP.

Former Member
0 Kudos

Thats pretty much where I had started going. I am using semantic group and it is loaded via the same full DTP request. Thanks.

Answers (0)