Skip to Content
0
Former Member
Jan 26, 2011 at 02:23 AM

How to display the total for the last page

18 Views

Dear Sir,

The final total value not appears when the last line item reached the page end. Is there any suggestion to solve this?

Thanks.

Below is the program.

LOOP AT itab INTO wa_itab.

move wa_itab-vblnr to reguh-vblnr.

move wa_itab-lifnr to reguh-lifnr.

move wa_itab-rbetr to reguh-rbetr.

reguh-rbetr = reguh-rbetr * -1.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'MAIN'

element = 'DETAIL'.

t_rbetr = reguh-rbetr + t_rbetr.

AT LAST.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

window = 'LINE'.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

WINDOW = 'MAIN'

element = 'TOTAL'

type = 'BOTTOM'.

ENDAT.

ENDLOOP.