on 04-11-2011 5:42 PM
Hi,
I have a requirement in scripts like how to print footer windows only after the end of main window.
Likewise in smartforms we check a option to print footer windows only after end of main window,but such option is not available in scripts.
I have even used the system defined variable PAGE(which stores present page number) and SAPSCRIPTS-FORMPAGES(which stores total number of pages) by comparing them with a if condition but it was unsuccessful because total number of pages is triggering at end of page printing.
So i need suggestions regarding that as i was working on a PO print form . If a PO has multiple line items amount in words,tax conditions,remarks and signature should be printed only after the end of all line items.
Regards.
Hi Venkat
I'm almost sure that the way you describe: Compare if current page number equals total number of pages - will actually work.
I'm not sure however, why this was not successful in your case.
Best regards
Thomas
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Thomas,
I used the if condition like
IF sapscripts-formpages eq page.
Then the code for footer windows will be printed.
But in my case both variables have 1 but still if condition failed ,i checked in debugging for single page and multiple page PO's.
Is there any other way to read it.
Regards,
Venkat.
There are different ways of doing, for printing footer window only after the end of main window.
Option#1 : Count the number of line items that will be displayed in your main window, and place a condition in your footer window if line item count equal to the above count, then display the footer.
Example: Total line items are count = 15, and each page can only display 5 line items.
In you main window.
m_Counter = m_counter + 1.
In your footer window.
If count = m_counter.
***Display
Endif.
Option#2.
Create an element footer in your main window after your line items, once all line items are displayed then call the element footer in your main window. But only drawback is footer position will not be fixed it varies from form to form based on line items.
Option #3.
Count number of line items.
Ex: Total items are Count= 25, and first page of your script can print 10 and second page can print 10 and 3rd page can print 10 line items in main window.
Build a logic in your subroutine poll.
Total_count = count / 10. "Total_count = 25 / 10 that is 2.
Rem = count MOD 10. "REM = 25 MOD 10 that is 3.
IF Rem > 0.
Total_count = Total_count + 1. " 2 + 1 that is 3.
ENDIF.
In footer window.
IF TOTAL_COUNT = SAPSCRIPTS-FORMPAGES.
**Display footer
ENDIF.
I hope that above options may help your to close the thread.
Regards,
SaiRam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.