cancel
Showing results for 
Search instead for 
Did you mean: 

Page Numbers Issue in Smart Forms

Former Member
0 Kudos

Dear All,

We have an issue in printing page numbers as we are printing multiple picklist details and each picklist contains multiple sequence numbers.

Eg: For Picklist 1 it may have sequence numbers 1, 2, 3, ... upto n

For Picklist 2 it may have sequence numbers 1, 2, 3, ... upto n.

Note: Sequence Number is not constant.

Each picklist should start in a new page and the page numbers should be displayed as page(1) of (3)(current page no. of total pages for each picklist)

When we display all picklist details in a sequence, we need to display the page numbers as below:

Picklist 1

Page(1) of (3)

(2) of (3)

(3) of (3)

Picklist 2

Page(1) of (2)

(2) of (2)

Picklist 3

Page(1) of (1)

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member205763
Active Contributor
0 Kudos

for this kind of requirement, what we generally do is, loop at the picking list in the driver program and call the smartform fm in this loop, so if there are 3 picking lists we ll loop 3 times over the call fm,

inside the form we can simply use , ( &sfsy-page& / &sfsy-formpages& ) .

Former Member
0 Kudos

Actually we have already tried that logic. But there is another problem attached to that.

If we loop the smartform in the driver program.. To trigger the next Pick list(or we can say as next loop) we need to press back button or F3. The user requirement is, he wants to take the print out with out any manual intervention.

former_member205763
Active Contributor
0 Kudos

Yes pressing the back button is a problem but there is no other option, if u hv variable number of pages for each pick list then there is no way to determine that in smartform.

one more option is to get otf instead of spool, concatenate the otf tables into one table and

use SSFCOMP_PDF_PREVIEW fm to display the preview.

Former Member
0 Kudos

The issue is now solved with the following procedure.

AT FIRST.

w_prntoptin_nb-no_open = space.

w_prntoptin_nb-no_close = 'X'.

w_first_fg = 'X'.

ENDAT.

AT LAST.

w_prntoptin_nb-no_open = 'X'.

w_prntoptin_nb-no_close = space.

w_last_fg = 'X'.

ENDAT.

IF w_first_fg <> 'X' AND w_last_fg <> 'X'.

w_prntoptin_nb-no_open = 'X'.

w_prntoptin_nb-no_close = 'X'.

ENDIF.