Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Sub Total Month Wise

Former Member
0 Likes
789

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.

5 REPLIES 5
Read only

naimesh_patel
Active Contributor
0 Likes
762

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

Read only

Former Member
0 Likes
762

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

Read only

0 Likes
762

hi sridheer

I want month wise hslvt total. Cumultotal.?

Read only

0 Likes
762

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

Read only

Former Member
0 Likes
762

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.