‎2006 Oct 05 4:09 PM
Hi all,
I have created a ZMEDRUCK Script which has First page as FaxCover Page and then Actual PO starts printing. Now I want 'Page of Total_Page' to be Displayed
Ex) There are 3 pages in the PO
Fax Cover will display = 1 of 3
Purchase Order = 1 of 3
2 of 3
3 of 3.
I have used Variable &SAPSCRIPT-FORMPAGES& but in no vain.
Can anybody Assist me on this
Thanks in Adv
‎2006 Oct 05 4:11 PM
Hi
You have to insert
&PAGE&/&SAPSCRIPT-FORMPAGES&
&PAGE& is the current page
&SAPSCRIPT-FORMPAGES& is the total number of pages
Max
‎2006 Oct 05 4:18 PM
Hi,
&PAGE& -> will have the Current Page No
&SAPSCRIPT-FORMPAGES& --> Wil have the Totla No of Pages
So write:-
/: &PAGE&/&SAPSCRIPT-FORMPAGES&
Regards
Sudheer
‎2006 Oct 05 4:39 PM
Hello Sudhir,
The output which I am getting is
Fax Cover page = 1/4
PO = 1/4 then 2/4 then 3/4.
That means Initially Script considers Fax Cover Page When we use &SAPSCRIPT-FORMPAGES& but then When it starts printing Actual PO then Starts with 1 and Ends with 3 having 4 as Total Number of Pages.
This is the problem which I am facing
‎2006 Oct 05 4:43 PM
I think you need to use a perform where you reduce the page numbers.
‎2006 Oct 05 5:11 PM
‎2006 Oct 05 6:14 PM
Hi Sanjay,
Define 2 Variables in the Script,
/: DEFINE &CURR_PAGE&
/: DEFINE &TOT_PAGE&
/:perform NAME in program ZTEST
/: using &PAGE&
/: using &SAPSCRIPT-FORMPAGES&
/: changing &CURR_PAGE&
/: Changing &TOT_PAGE&
/:endperform<b>In the Program ZTEST:-</b>
data: L_page type i,
L_Totpage type i.
FORM NAME TABLES INTAB STRUCTURE ITCSY
OUTTAB STRUCTURE ITCSY.
READ TABLE INTAB with key NAME = 'PAGE'
IF sy-subrc = 0.
L_PAGE = INTAB-VALUE.
L_PAGE = L_PAGE - 1. " Current Page - 1
ENDIF.
READ TABLE INTAB with key NAME = 'SAPSCRIPT-FORMPAGES'
IF sy-subrc = 0.
L_Totpage = INTAB-VALUE.
L_Totpage = L_Totpage - 1. " Total Pages - 1
ENDIF.
READ TABLE OUTTAB with key NAME = 'CURR_PAGE'
IF sy-subrc = 0.
OUTTAB-VALUE = L_PAGE.
ENDIF.
Modify OUTTAB index SY-TABIX.
READ TABLE OUTTAB with key NAME = 'TOT_PAGE'
IF sy-subrc = 0.
OUTTAB-VALUE = L_Totpage.
ENDIF.
Modify OUTTAB index SY-TABIX.
ENDFORM.In the Script: After the First page, you can decalre now like
/: &CURR_PAGE& of &TOT_PAGE&.
Mark all the helpful answer
Regards
Sudheer