Logic needed in internal table
I have an internal table as follows.
Now i would like to calculate the total number of employees (PERNR) against each Profit Center (PRCTR) into one more table as follows....
How to incorporate code to meet this logic?
Kindly help me out....
Edited by: Pavan Sanganal on Sep 11, 2008 7:26 PM
Valter Oliveira replied
TYPES: BEGIN OF ty_totals, PRCTR TYPE PRCTR, number TYPE i, END OF ty_totals. DATA: itab2 TYPE STANDARD TABLE OF ty_totals, wa2 TYPE ty_totals. LOOP AT itab1 INTO wa1. wa2-PRCTR = wa1-PRCTR. wa2-number = 1. COLLECT wa2 INTO itab2. ENDLOOP.