cancel
Showing results for 
Search instead for 
Did you mean: 

Problem printing Second Page onwards

Former Member
0 Kudos

Hi,

I have a smart form where information regarding order needs to be printed, such that each order should get printed in one page. I kept condition at the end of Main window such that if current line of order internal table is less than or equal to total lines in order internal table then same page is triggered.

But when I try to print 2 orders, first order is printing properly, but for second order header part is being printed in a new page but Main window is not printing.

Please help.

Thanks in Advance.

Accepted Solutions (0)

Answers (3)

Answers (3)

1MoreDev
Explorer
0 Kudos

Theres only one main window in smartforms, the diference between pages can only be about size.

What u must do is, inside the loop to each document to have an element command to jump page.

Hope i helped 😃

Former Member
0 Kudos

Hi,

Try this way.....

Don't create a new Main window in second page instead copy the main window of the first page and continue creating the text-windows or program lines after the command window.

Check this wiki. This might help you.

https://wiki.sdn.sap.com/wiki/x/bAZqBg

Thanks

Sarves

former_member196280
Active Contributor
0 Kudos

Firstly create program lines inside your loop, program line should populate additional temp variable. and it shouldbe the first one to populate.

Ex: IF lv_vbeln is initial.

LV_VBELN = vbeln.

ENDIF.

Secondly, Place you command in the first line of your loop to trigger new page, with condition as LV_VBELN NE VBELN.

Display all line items in main window.

At the end of your loop.

IF LV_VBELN NE vbeln.

LV_VBELN = VBELN.

ENDIF.

I guess, above solution will give you the expected results.

Regards,

SaiRam

Former Member
0 Kudos

Hi,

Thanks for the mail.

I applied this logic. But couldn't resolve the problem. After execution when clicked on Print Preview/Print button it is still showing only 1 order even though I chose more than 1 order.

Thanks.

former_member196280
Active Contributor
0 Kudos

Apart from the above solution, which I have proposed.

Make sure, go to new page in command is same as the first page... also check whether you have multiple records inside your internal table or not.

Also, check whether you have looped your internal table correctly or not?

Regards,

SaiRam

Former Member
0 Kudos

I hope the above mentioned logic will be sufficient to resolve your issue. If your issue still persists , kindly let us know.