cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform issue

Former Member
0 Kudos

Hello guys.

I have a big issue with an smartform, i'll try to explain it as best i can:

I've got to generate a payroll document; this document will always have at least two pages the odd one with the payroll data, and the even one with some address-personal data. (I have to do it this way because they want to print it out everything and have the data in the front side and the addresses on the back side)

My problem is the following: data, sometimes can be huge, so it doesn't fit in one single page, so i have to generate another one with the rest of the data values and its corresponding back page with addresses.

What i was thinking of was, creating 2 pages in the smartform, setting page two as page one's next page and, obviosuly, page one, as page two's next page; but the problem indeed is that, if i do this, the last page printed out, is always the first one, not the second one (i don't know why and i can't avoid it)

Any ideas?

Example

Thanks in advance.

Edited by: Javier Suárez Zapico on Dec 29, 2009 10:46 AM

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Javier,

The solution to this is you need to create three pages PAGE1 , PAGE2 and PAGE3.

PAGE1 will have main window printing line item data. PAGE2 and PAGE3 will not main window but only print address data.

PAGE1 will have next page = PAGE2 and PAGE2 will have next page = PAGE1.

PAGE3 will have next page = blank.

In Main window in PAGE1 after the table (not under the table) create command line to break the page to PAGE3.

This will serve your purpose.

Let me know in case of any issues.

Thanks,

Former Member
0 Kudos

Put condition in footer of the table SFSY-PAGE = SFSY-FORMPAGES. If condition satisfied the put the command line to break the page.

former_member212002
Active Contributor
0 Kudos

You need to use the dynamic page break here, which will get triggered according to some conditions, in your case in change of employee number .

Flow Logic -> Command.

Have a look on the following link

[http://wiki.sdn.sap.com/wiki/display/ABAP/PageBreakin+SMARTFORMS].

Regards

Abhinab Mishra

Former Member
0 Kudos

Hello again.

Searching through the forum a little bit, i found this:

and i think it might work for me, but i have a problem, i am following every single step, but when i try to perform step 2, i always get printed page number 1 as last page, even when it has no data to show.

Is there any way to avoid this?

Thanks

former_member212002
Active Contributor
0 Kudos

In the command node,

Assign



go to next page as null or keep it blank.

This has worked for me.

Hope this helps.

Regards

Abhinab Mishra

Former Member
0 Kudos

Hello again.

I tried several things, but i couldn't make it work. I'll try to explain it:

I've tried to set the 'MAIN' within the first page, and afther that within de second page, but it looks like when the main is executed the first time, it won't be fired again during the execution. (I set a break-point in the first page, and run an execution with 4 pages, 1-2-1-2. When the first page is rendered, the execution stops at the break-point, follows up to the second page, but when comes again to print de third page, the break-point doesn't stop.

Any ideas on this?

Thank you all.

Sandra_Rossi
Active Contributor
0 Kudos

First of all, be careful with your post title, you should make it meaningful according to forum rules (something like "can't have MAIN on 2 pages in smartform")

About your question, that's normal. You should see the MAIN window as being the "driver" of your form: the MAIN triggers the different pages (and the pages do not trigger the MAIN). When the end of MAIN is reached, then you can't restart it.

I'm not sure to understand your requirement. If we use these conventions:

A = one page of payroll data

B = one page of address-personal data

E = one empty page

Then is it the following that you want to get?

A on 1 page: A / B (A on the recto, and B on the verso)

A on 2 pages: A / E and A / B ???

Moreover, you didn't mention the use of Duplex and Simplex, is it because you don't use it, why?

If the above corresponds to your requirement and we use duplex, then the following might work (note: I assume that you call the smart form once per payroll):


|_ PAYROLLPAGE (next: *EMPTYBACKPAGE*; print mode: *DUPLEX*)
|  |_ MAIN
|     |_ Loop at payroll data
|     |  |_ Print
|     |_ Command Go To ADDRESSBACKPAGE
|     |_ Loop at address data
|     |  |_ Print
|_ ADDRESSBACKPAGE (next: ADDRESSBACKPAGE; print mode: DEFAULT)
|  |_ MAIN (same as in PAYROLLPAGE)
|_ EMPTYBACKPAGE (next: PAYROLLPAGE; print mode: DEFAULT)
|  |_ what you want except MAIN