cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms: Printing page numbers when calling multiple forms

Former Member
0 Kudos

We are outputting 3 different forms in 1 spool request. When I use the "page x of y" output using SFSY-JOBPAGES, the total number of pages is correct, but the current page number resets between forms.

Example:

Form 1:

Page 1 of 7

Page 2 of 7

Page 3 of 7

Form 2:

Page 1 of 7 (Should be Page 4 of 7)

Page 2 of 7 (Should be Page 5 of 7)

Form 3:

Page 1 of 7 (Should be Page 6 of 7)

Page 2 of 7 (Should be Page 7 of 7)

The setup of the pages is such that the page mode is set to "Increase Counter" for each page of each form.

Any ideas how to remedy this?

Thank you,

-=Rob=-

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Please use a global variable in the driver program and pass it to the three forms interface.

Then in each form just increment and display in each form.

Regards,

Ram

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you for the answers guys. I have a workaround already but was hoping there was a standard way. Thanks again for you responses.

Former Member
0 Kudos

Form page no is limited to one layout only.It can't be carried to multiple layouts.The only link to multiple layouts should be the driver program. so Declare a variable 'x' in the program and while displaying in the form use page no as x+sfsy-page. and at the end of that form add sfsy-formpages to x.

Former Member
0 Kudos

Hi,

for every new FORM &SFSY-PAGE& starts with page '1'. so that might be the reason its printing wrongly.

what u can do is, u create a variable & increase the variable value by 1 when new page comes, and print this varaible for ur requirement.

Eg:

DATA : gv_page TYPE i. --->Declare this in GLOBAL DEFINITIONS..

create a text node in MAIN Window, LOOP of the Internal table & write the code like below in it:

LOOP AT itab.

IF sfsy-page NE gv_page.

gv_page = gv_page + 1.

ENDIF.

gv_page = SFSY-PAGE.

ENDLOOP.

Now, print 'Page &gv_page& of &sfsy-formpages&.

NOTE: Also, make sure that, whenever we print &sfsy-formpages&, the window type should be of 'FINAL WINDOW' & u should give &SFSY-FORMPAGES(3CZ)& for total pages...

Hope it helps!!

Rgds,

Pavan