on 11-22-2006 10:48 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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...
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.