cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform: PAGE/FORM PAGES

Former Member
0 Kudos

HI All,

Currently i am using the format SFSY-PAGE and SFSY-FORMPAGES to display in the format "current page / total pages".....

But the requirement is to split the Total pages based on the new record being printed in the output. Say Total pages in original are 12, out of which there are 2 PO's (One PO with 5 Pages of data and second with the rest of 7 pages output)

then my output should look like 1/5...2/5....till 5/5 and again the numbering should start like 1/7...2/7....3/7....till 7/7 and so on....

Could any body suggest on this?

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

So system varible wont work in ur case,u have to handle the page no.

In similar case like this what i did is.

I declared internal table with 2 fields one for PONO and the other for total pages for that po.Examle it_page-po,it_page-page.

So first run the loop and calculate for particular po no of pages.

Example:

loop at itab.

at new po.

it_page-po = itab-po.

endat.

it_page-page = it_page-page + 1.

at end po.

append it_page.

clear it_page.

endat.

endloop.

***So above u will get the pages for each po

Next when u run the loop again set the varible for each page and calculate the pages.

Say for example page is the varible.

loop at itab.

at new.

endat.

page = page + 1.

display the output.

endloop.

So in the smartform the out put should be

PAGE/IT_PAGE-PAGE

Try in this way in the smartform u can suceed.Let me know if u face any problem.

Regards

Former Member
0 Kudos

Hi Ravi,

Thanks for your response....but, i cannot go for calculating the number of pages for a particular PO as my window's content is dynamic. Hope you understand the point here. The window content is not fixed to go with the logic of calculating no of pages on a PO....

Regards

Former Member
0 Kudos

What exactly are u printing in the window and H u are triggering the new page.

Former Member
0 Kudos

I have totally 4 windows, of which the last one is the main window.....

Let me explain the total design....I have one page in which first two windows are fixed content which will be repeated on every page... third window is the page number window where i am writing &SFSY-PAGE& / &SFSY-FORMPAGES&....

Fourth one is the main window with some logic related activity being performed.

So, in this scenario, I would like to split the PAGE and FORMPAGES for every new record of the header. Hope this gives some idea of the design ...Thanks for your help in advance....

Regards

Ravuri...

Former Member
0 Kudos

Hi

Have you tried my solution?

Max

Former Member
0 Kudos

What content are u printing in the main window.Give me ur mail id so that we can have more detailed discussion.

Former Member
0 Kudos

Hi

U should run the smartform for each PO u have to printed and you'll have what you need automatically. So you should run the sf as many times as many documents you have.

Max

Former Member
0 Kudos

Hi,

Thanks for your quick response....but the case is that, i have a select option provided to go for multiple PO's at a stretch...and the FM is called only once in the print program. I need to do something explicit in the form layout instead of normal functioning.

Regards

Former Member
0 Kudos

Hi

U can try to create in your smartform another first page:

- FIRST,

- FIRST_B,

- NEXT,

The link between the pages is:

- FIRST -> NEXT

- FIRST_B -> NEXT

- NEXT -> NEXT

In the GENERAL ATTRIBUTES of FIRST_B you should set the option INITIALIZE COUNTER in MODE section.

So in the smartform when a new po is coming you do NEW-PAGE statament and trigger the page FIRST_B.

Max

Former Member
0 Kudos

Could you please explain? I didnot get it clearly.....

Former Member
0 Kudos

I don't know how many pages are in your smartforms, anyway a smartform has usually two page the FIRST and the NEXT.

The FIRST page should have the NEXT page as next one and NEXT one should have the NEXT page.

If you check the MODE of GENERAL ATTRIBUTES tab of the page you should see:

- MODE for the FIRST page is: INITIALIZE COUNTER

- MODE for the NEXT page is: INCREASE COUNTER

This means every time the FIRST page is called the page counter is setted to 1.

U can try to use this chararteristic forcing to trigger the first page while a new po is coming.

Now the problem is the FIRST page is used once at the beginning, so you can copy the FIRST in a new page (FIRST_B) and you call this new page, in this way the system should inizialize the page counter.

Perhaps you can call the same FIRST page (i.e you don't need to create a new page), I don't know but u can try.

So you should try to call a page with INIZIALIZE COUNTER option setted when a new PO has to be printed.

Max

Former Member
0 Kudos

HI Max,

Thanks for your explanation. Looks like i have missed out a minor point of your explanation.

Initially i had only 1 page with Increase counter. As suggested by you, I have made a next page similar to my first page with initialise counter and increase counter respectively.

But, now i see the case as something like this.....

Say first po has only 1 page of output, the result is 1/1 (Which is correct)

second PO has 3 pages then the output is 1/1, 2/1 and 3/1 (Going wrong with the total pages). I believe something is going wrong with the increment of the FORMPAGES. Could you please quickly respond to this? Thanks for your continued support on this...

Regards

Ravuri...

Former Member
0 Kudos

Hi

I believe the problem is FORM PAGES is printed only at the end and so it's printed only the last value.

Max