cancel
Showing results for 
Search instead for 
Did you mean: 

Page total in Script

Former Member
0 Kudos

Hello all,

I want to print page total at the end of the page and grand total in the last page in a script. Please let me know where and how do I need to write the code for totla and grand total.

Yuor help is highly appriciated.

Regards,

Pavan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Check the following link

[Page total in script|http://wiki.sdn.sap.com/wiki/display/ABAP/Displayingspecificnumberofrecordsperpage.]

Hope this helps you.

Regards,

Rajani

Former Member
0 Kudos

Rajani,

I am able to print the values on the page, but the page total and the grand totals are not coming correct.

sridhar_meesala
Active Contributor
0 Kudos

Hi,

What is the problem you are facing?

Thanks,

Sri.

Former Member
0 Kudos

I am printing some 10 values in a page. I want the total of the page at the bottom and grand total in the last page.

sridhar_meesala
Active Contributor
0 Kudos

Hi,

Take a variable and increment it till 10, after that call the total window to print the total.

Thanks,

Sri

Former Member
0 Kudos

I did not create a window for total. I want to print in the main window only.

sridhar_meesala
Active Contributor
0 Kudos

Hi,

Then call the write_form function exporting the total element after checking the condition with IF. To print the grand total use AT LAST.

In Script use SUMMING to add the values at the starting in the main window.

Thanks,

Sri.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hii

Please be clear whether you want to display the page number with the total pages or the total of some field on a page and last page.

If you want to display the page number at the bottom of page you can do as follows.

Make a window and place it at the end. Now insert a field

&page& - For current page

&Sapscript-formpages& - For total pages

eg. &page& / &Sapscript-formpages& will display <current page> / <Total pages>

Please mark the question as answered if i have answered you correctly.

Former Member
0 Kudos

Hi,

To display grand total on the last page :

-


Program which calls the SAP Script Form----


call function OPEN_FORM.....

loop at itab.

call function WRITE_FORM....... To display main window details

AT LAST.

SUM.

call function WRITE_FORM

exporting

ELEMENT = 'ABC'

FUNCTION = 'SET'

TYPE = 'BODY'

WINDOW = 'TOTAL'........................ To display grand total window

ENDAT.

ENDLOOP.

I hope it helps you.