Skip to Content
0
Former Member
May 30, 2008 at 06:54 AM

Sub Total in classical report..........

61 Views

Hi Experts,

I am using calassical report in which i want a subtotal.

Example :

X

a 3

b 2

Subtotal : 5.

Y

a 4

b 5

Subtotal : 9

Report is OK but subtotal is not comming. Pl. see my loop and guide me. I want subtotal of itab_out-typedesc feild.

LOOP AT itab_out.

ON CHANGE OF itab_out-typedesc.

FORMAT COLOR COL_TOTAL.

WRITE:/1 sy-vline, 5 itab_out-typedesc, 130 sy-vline.

WRITE:/1 sy-vline, 5 '===============', 130 sy-vline.

FORMAT COLOR OFF.

ENDON.

ON CHANGE OF itab_out-srno.

ULINE.

FORMAT INTENSIFIED ON.

FORMAT COLOR COL_NORMAL.

WRITE :/1 sy-vline, 5 itab_out-matkl, 15 itab_out-desc.

WRITE : 63 itab_out-dailyqty LEFT-JUSTIFIED DECIMALS 0.

WRITE : 100 itab_out-erfmg LEFT-JUSTIFIED DECIMALS 0.

WRITE : 130 sy-vline.

FORMAT COLOR OFF.

  • AT END OF typedesc.

  • WRITE :/1 'Sub-Total :'.

  • ENDAT.

AT LAST.

ULINE.

SUM.

FORMAT INTENSIFIED ON.

FORMAT COLOR COL_POSITIVE ON.

WRITE:/1 sy-vline, 20 'Total : ' , itab_out-dailyqty UNDER 'Mfg. Qty.' LEFT-JUSTIFIED DECIMALS 0.

WRITE: itab_out-erfmg UNDER 'Cumm. Qty.' LEFT-JUSTIFIED DECIMALS 0.

WRITE: 130 sy-vline.

FORMAT INTENSIFIED OFF.

FORMAT COLOR OFF.

ULINE.

ENDAT.

ENDON.

Yusuf