2006 Jul 25 8:31 AM
hi allll
In this below coding i want month wish total, how can i calculate. i mentioned
at end of month.
format color 3.
sum.
WRITE : (16) hslvt.
format reset.
endat.
but this function is not working.
My original coding.........
sort GLfinal_tbl by year month.
loop at GLFinal_tbl.
WRITE: / sy-vline,(10) GLFinal_tbl-budat,
' ', (10) GLFinal_tbl-belnr,
' ',(2) GLFinal_tbl-blart,
' '.
IF GLFinal_tbl-shkzg EQ 'H'. "Credit
hslvt = hslvt - GLFinal_tbl-dmbtr.
tot_crdt = tot_crdt + GLFinal_tbl-dmbtr.
WRITE: ' ',
(16) GLFinal_tbl-dmbtr.
ELSE. "Debit
hslvt = hslvt + GLFinal_tbl-dmbtr.
tot_dbt = tot_dbt + GLFinal_tbl-dmbtr.
WRITE: (16) GLFinal_tbl-dmbtr,
' '.
ENDIF.
WRITE : (16) hslvt,
sy-vline.
endloop.
hi allll
In this below coding i want month wish total, how can i calculate. i mentioned
at end of month.
format color 3.
sum.
WRITE : (16) hslvt.
format reset.
endat.
but this function is not working.
My original coding.........
sort GLfinal_tbl by year month.
loop at GLFinal_tbl.
WRITE: / sy-vline,(10) GLFinal_tbl-budat,
' ', (10) GLFinal_tbl-belnr,
' ',(2) GLFinal_tbl-blart,
' '.
IF GLFinal_tbl-shkzg EQ 'H'. "Credit
hslvt = hslvt - GLFinal_tbl-dmbtr.
tot_crdt = tot_crdt + GLFinal_tbl-dmbtr.
WRITE: ' ',
(16) GLFinal_tbl-dmbtr.
ELSE. "Debit
hslvt = hslvt + GLFinal_tbl-dmbtr.
tot_dbt = tot_dbt + GLFinal_tbl-dmbtr.
WRITE: (16) GLFinal_tbl-dmbtr,
' '.
ENDIF.
WRITE : (16) hslvt,
sy-vline.
endloop.
2006 Jul 25 8:42 AM
Hello,
First modify the amount based on the credit/debit indicator. and then ,
sort itab by month
loop at itab.
at end of month.
format color 3.
sum.
WRITE : (16) hslvt.
format reset.
endat.
endloop.
Regards,
Naimesh
2006 Jul 25 8:45 AM
Hi,
Any way u r summing in the internal table...no need to use 'SUM' again...
do this..
at end of month.
format color 3.
WRITE : (16) hslvt.
format reset.
<b>clear hslvt.</b>
endat.
Sreedhar
2006 Jul 25 8:48 AM
2006 Jul 25 9:09 AM
Hello
If feel you dont need to use SUM at the end of Month event, since you are already calculating cummulative total in hslvt . Basically, just print the variable and it should suffice your requirement.
Secondly, you can reset the variable if you wish to re-calculate it for each month.
Regards
Anurag
2006 Jul 25 8:54 AM
Hi,
Try like this...
outside loop:
data : hslvt1 like hslvt.
at end of month.
format color 3.
WRITE : (16) hslvt.
format reset.
<b>hslvt1 = hslvt1 + hslvt.
clear hslvt.</b>
endat.
Out side loop :
write : hslvt1.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |