Application Development 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: 

SAP Script - Need to display total on the last page

Former Member
0 Kudos

Hello Friends,

I like to display the total in the Main window of last page of the form.

I tried Nextpage = 0 N SAPSCRIPT-FORMPAGES, but these variables are getting the right value only when the form reaches footer of the last page.

Could any one please help out in this regard.

Thank you,

Senthil

1 REPLY 1

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Just have a separated element for your total. You are probably looping a table in the print program and writing some detail lines. After that loop just write the Totals element. Doing this will put the totals on the last page of the sapscript.

Loop at itab.

      call function 'WRITE_FORM'
         EXPORTING
              element = 'ITEMS'
              window  = 'MAIN'
         EXCEPTIONS
              others  = 1.


endloop.


* Now write the totals.
    call function 'WRITE_FORM'
         EXPORTING
              element = 'TOTALS'
              window  = 'MAIN'
         EXCEPTIONS
              others  = 1.

Regards,

Rich Heilman