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: 

Next page not showing in print preview in smartforms.

arijitbarman
Participant
0 Kudos

Hi Abapers,

I have 3 pages in my smartforms. There is no flow of data from 1st page table to next page. Only there is a heading change in each page if compared.

My problem is that in print preview i can only see the 1st page only, 2nd page and 3rd page is not showing. I cannot use copies window for this as then the spool of 3 pages is not getting converted to pdf from RSTXPDFT4. Please help me in showing the next 2 pages in my print preview.

Regards,

Arijit.

1 ACCEPTED SOLUTION

0 Kudos

Hi Arijit,

Try below code while calling smartform in your driver program.

do 3 times.          "looping for 3 times

*set Heading text   

     if sy-index = 1.

          heading_text = 'Page 1'.

     elseif sy-index = 2.

          heading_text = 'page 2'.

     elseif sy-index = 3.

          heading_text = 'Page 3'.

     endif.

call function l_fm_name          " calling smartform

       exporting

               ..

       tables

               ..

       exceptions

               ..

enddo.

Hope this will help you.

-Sunny

9 REPLIES 9

Former Member
0 Kudos

hi,

next page option put same page.

pavanm592
Contributor
0 Kudos

Hi arjit,

as per my understanding you can proceed like this after the main window in page1 create a command1 and call page2 similarly after page2 main window below the command1 create a command2 and call page3 .

assuming your table data will not be flown over multiple pages,correct me if i am wrong.

Regards,

Pavan

0 Kudos

Hi Pava,

If i use command under table then the whole table data goes to next page.

Arijit.

0 Kudos

Hi Arjit,

can you share the screen shot how you called the command ,i don't think the table will move to next page.

is your table data consists of multiple pages of data ?

Regads,

Pavan

0 Kudos

Hi Arijit,

Try below code while calling smartform in your driver program.

do 3 times.          "looping for 3 times

*set Heading text   

     if sy-index = 1.

          heading_text = 'Page 1'.

     elseif sy-index = 2.

          heading_text = 'page 2'.

     elseif sy-index = 3.

          heading_text = 'Page 3'.

     endif.

call function l_fm_name          " calling smartform

       exporting

               ..

       tables

               ..

       exceptions

               ..

enddo.

Hope this will help you.

-Sunny

0 Kudos

HI SUNNY,

It worked. Thanks alot for the logic code.

Only one query i have

Now Pdf is generated with 3 pages but print preview comes with 9 pages.

Can anything be done where print preview is 3 pages and the pdf file also 3 pages.

Arijit

0 Kudos

Hi Arijit,

I assume that earlier your 3 pages were generated but print preview was not visible.

The solution of your Query is to Debug.

There might be chances of misplacing of loop and call of FM for Print preview/PDF.

So, while using loop for 3 times, your 3 pages were generated again which might cause print preview of 3 * 3 = 9 pages.

Please debug and make the call of FMs from proper place and you're done.

-Sunny

0 Kudos

Hi Sunny,

Its working fine now.

Thanks alot for your help.

Regards,

Arijit Barman.

0 Kudos

I would like to post my code for anyone who is having this issue. This will definitely help.

DATA: HD_COPY TYPE CHAR50.

LS_CONTROL_PARAM-NO_OPEN   = 'X'.

LS_CONTROL_PARAM-NO_CLOSE  = 'X'.


CALL FUNCTION 'SSF_OPEN'

       EXPORTING

         USER_SETTINGS      = ''

         CONTROL_PARAMETERS = LS_CONTROL_PARAM

       EXCEPTIONS

         FORMATTING_ERROR   = 1

         INTERNAL_ERROR     = 2

         SEND_ERROR         = 3

         USER_CANCELED      = 4

         OTHERS             = 5.

     DO 3 TIMES.                     "looping for number of pages

*  Set Heading Text in Smartform.

       IF SY-INDEX = 1.

         HD_COPY = 'Original For Buyer'.         "'Page 1'.

       ELSEIF SY-INDEX = 2.

         HD_COPY = 'Duplicate For Transporter'"'page 2'.

       ELSEIF SY-INDEX = 3.

         HD_COPY = 'Triplicate / Extra Copy'.    "'Page 3'.

       ENDIF.

       CALL FUNCTION G_FM_NAME

         EXPORTING

           USER_SETTINGS      = ''

           CONTROL_PARAMETERS = LS_CONTROL_PARAM

           HD_COPY            = HD_COPY     " PASS IN SMARTFORM FORM INTERFACE

         EXCEPTIONS

           FORMATTING_ERROR   = 1

           INTERNAL_ERROR     = 2

           SEND_ERROR         = 3

           USER_CANCELED      = 4

           OTHERS             = 5.

          ENDDO.

     CALL FUNCTION 'SSF_CLOSE'

       EXCEPTIONS

         FORMATTING_ERROR = 1

         INTERNAL_ERROR   = 2

         SEND_ERROR       = 3

         OTHERS           = 4.


ARIJIT