Quantcast
Channel: SCN: Message List - ABAP Development
Viewing all articles
Browse latest Browse all 10425

calculate key figure in table with loop

$
0
0

I am stuck in a logic problem andI  have delivery tomorrow.
I have  four columns, one keyfig.
I want to apply the following formula for account.
A4000 = A3000 - A2000 - A1000.
The number of costcentre and MPN are unlimited and it is a many to many relation.

Please give me a sample code, or at least pseudo code.


Table A
CostCenter MPN Account  Keyfig.
16509         45      A1000     20
16509         46      A1000     60
16509         45      A2000     30
16509         45      A3000    100
16509         46      A1000     60
16510         45      A3000     60
16510         45      A1000     20
16510         45      A2000     30
16510         45      A3000     60


Result should be:
Table B
CostCenter MPN Account  Keyfig.
16509           45      A4000       50
16509           46      A4000       -20
16510           45      A4000        10


Viewing all articles
Browse latest Browse all 10425

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>