Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Internal Table process subset of entries

Hi ABAP Colleagues

I have an internal table as follows:

ORDER        COST ELEMENT           AMOUNT

921188         601123                         200

921188         601124                         100

921188         601124                         300

921188         601124                         300

921188         601125                         100

921188         601125                         200

921189         601123                         200

921189         601124                         100

921189         601124                         250

921189         601125                         400

Within any order number, if the cost element 601125 occurs more than once, I need to append a record underneath that 601125 record which is a total of the preceeding 601125 records. If within any order number the cost element 601125 only occurs once, then do not append any record. So the above should look like this after processing:

ORDER        COST ELEMENT           AMOUNT

921188         601123                         200

921188         601124                         100

921188         601124                         300

921188         601124                         300

921188         601125                         100

921188         601125                         200

921188         601125                         300  <<-- insert a record which is total of preceeding 2 601125 records

921189         601123                         200

921189         601124                         100

921189         601124                         250

921189         601125                         400  <<-- no need to insert/append a record here as only 1 601125 record exists.

Can you advise please how might I achieve this? We are not on 740 ABAP release.

Thanks and regards

Not what you were looking for? View more on this topic or Ask a question