Dear Expertise ,
I am working on FI sales Revenue Trend Report .
I am stuck with one logic as -
my internal table is like this
NAME DMBTR MONAT(Period) Jan feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
A 10 5
A 20 5
A 30 6
B 10 7
B 20 7
B 30 6
B 40 5
Now, My requirement is - adding total of DMBTR period wise and name wise and displaying accordingly in to months .
Here is my code as-
LOOP AT IT_FINAL INTO WA_FINAL.
READ TABLE IT_FINAL2 INTO WA_FINAL2 WITH KEY POPER = WA_FINAL-MONAT.
WA_FINAL1-NAME3 = WA_FINAL-NAME3.
WA_FINAL1-DMBTR = WA_FINAL-DMBTR.
WA_FINAL1-POPER = WA_FINAL2-POPER.
WA_FINAL1-KTEXT = WA_FINAL2-KTEXT.
IF WA_FINAL1-NAME3 EQ WA_FINAL-NAME3.
IF WA_FINAL1-POPER = '001' AND WA_FINAL1-KTEXT = 'APR'.
T1 = T1 + WA_FINAL-DMBTR.
WA_FINAL1-V1 = T1.
ELSEIF WA_FINAL1-POPER = '002' AND WA_FINAL1-KTEXT = 'MAI'.
T2 = T2 + WA_FINAL-DMBTR.
WA_FINAL1-V2 = T2.
ELSEIF WA_FINAL1-POPER = '003' AND WA_FINAL1-KTEXT = 'JUN'.
T3 = T3 + WA_FINAL-DMBTR.
WA_FINAL1-V3 = T3.
ELSEIF WA_FINAL1-POPER = '004' AND WA_FINAL1-KTEXT = 'JUL'.
T4 = T4 + WA_FINAL-DMBTR.
WA_FINAL1-V4 = T4.
ELSEIF WA_FINAL1-POPER = '005' AND WA_FINAL1-KTEXT = 'AUG'.
T5 = T5 + WA_FINAL-DMBTR.
WA_FINAL1-V5 = T5.
ELSEIF WA_FINAL1-POPER = '006' AND WA_FINAL1-KTEXT = 'SEP'.
T6 = T6 + WA_FINAL-DMBTR.
WA_FINAL1-V6 = T6.
ELSEIF WA_FINAL1-POPER = '007' AND WA_FINAL1-KTEXT = 'OKT'.
T7 = T7 + WA_FINAL-DMBTR.
WA_FINAL1-V7 = T7.
ELSEIF WA_FINAL1-POPER = '008' AND WA_FINAL1-KTEXT = 'NOV'.
T8 = T8 + WA_FINAL-DMBTR.
WA_FINAL1-V8 = T8.
ELSEIF WA_FINAL1-POPER = '009' AND WA_FINAL1-KTEXT = 'DEZ'.
T9 = T9 + WA_FINAL-DMBTR.
WA_FINAL1-V9 = T9.
ELSEIF WA_FINAL1-POPER = '010' AND WA_FINAL1-KTEXT = 'JAN'.
T10 = T10 + WA_FINAL-DMBTR.
WA_FINAL1-V10 = T10.
ELSEIF WA_FINAL1-POPER = '011' AND WA_FINAL1-KTEXT = 'FEB'.
T11 = T11 + WA_FINAL-DMBTR.
WA_FINAL1-V11 = T11.
ELSEIF WA_FINAL1-POPER = '012' AND WA_FINAL1-KTEXT = 'MAR'.
T12 = T12 + WA_FINAL-DMBTR.
WA_FINAL1-V12 = T12.
ENDIF.
IF V1 IS INITIAL.
APPEND WA_FINAL1 TO IT_FINAL1.
ELSE.
MODIFY IT_FINAL1 FROM WA_FINAL1 TRANSPORTING V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12.
In this, IT_Final has suppose 23 entries.
Please see and help guyzz.
Thanks
Karan.