on 02-06-2008 12:46 PM
Hi,
Iam unable to print total number of pages in the First Page of SAPSCRIPT.Iam writing the Logic in the Varibale window.
Please kindly help me.
In First Page , The preview is
Page 1 of 1-
In Second Page , Teh Preview is
Page 2 of 2
The Logic is ....
1. Variable window of Script
PERFORM CHECK_PAGE IN PROGRAM ZZZF_SAPSCRIPT_EXITS
USING &SAPSCRIPT-FORMPAGES&
CHANGING &WS_PAGE&
ENDPERFORM
Page &PAGE(C)& of &WS_PAGE&
2. Program
FORM check_page TABLES p_pagein STRUCTURE itcsy
p_pageout STRUCTURE itcsy.
DATA : p_i TYPE sypagno.
READ TABLE p_pagein INDEX 1.
IF sy-subrc = 0 .
p_i = p_pagein-value.
p_i = p_i - 1 .
READ TABLE p_pageout INDEX 1.
CLEAR p_pageout-value.
*p_pageout-value = p_i+0(3).
WRITE P_I TO p_pageout-value.
condense p_pageout-value no-gaps.
MODIFY p_pageout INDEX sy-tabix.
ENDIF.
ENDFORM. "check_page
Please help me ASAP.
Regards,
Deepthi.
Try this
'On The Form'
IF &NEXTPAGE& EQ 0
DEFINE &DECRE& := '2'
PERFORM SET_TEXT_SYMBOL IN PROGRAM YSS20200
USING &SAPSCRIPT-FORMPAGES&
USING &DECRE&
ENDPERFORM
ENDIF
'In The Program'
DATA : BEGIN OF script_table OCCURS 0.
INCLUDE STRUCTURE itcsy.
DATA END OF script_table.
----
Used to modify total pages so they print correctly
----
FORM set_text_symbol TABLES input_table LIKE script_table[]
output_table LIKE script_table[].
DATA: pageno TYPE i,
intCnt type i,
chrPg(2) type c.
READ TABLE input_table INDEX 1.
MOVE input_table-VALUE TO pageno.
READ TABLE input_table INDEX 2.
MOVE input_table-VALUE TO intCnt.
subtract intcnt from pageno.
write pageno to chrpg.
CALL FUNCTION 'TEXT_SYMBOL_SETVALUE'
EXPORTING
NAME = 'FORMPAGES'
VALUE = chrpg
VALUE_LENGTH = 0
REPLACE_SYMBOLS = ' '
.
ENDFORM.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravishankar,
i have created a new window only in First page & Next Page and copied the SAME code but ima getting as
Page 1 of 3
Page 2 of 3
ie., it is including mail page also.
which should not happen.
I want the Output as
Page 1 of 2.
Page 2 of 2.
Regards,
Deepthi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi Shankar,
If i dont write the code than total number of pages become 3(Mail page , First Page , Next Page).I want only the First page and Next Page to be counted.
So , that is not working.......
Regards,
Deepthi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
/: Page &PAGE& OF &SAPSCRIPT-FORMPAGES&
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anil,
Still it is not solved.
Though i have made the chanegs that were given by u.
Is there any other way..
Please help me.
Regards,
Deepthi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think no need to write code for that pages
just create one window and write it as
pages &PAGES& of &SAPSCRIPT-FORMPAGES&
dont use it in first page write it from ur second page
i used it , it is working fine.
I hope it will work for u.
regards,
ravi shankar reddy
Edited by: Ravi Shankar Reddy S on Feb 7, 2008 11:41 AM
Hi Deepthi,
Please declare P_I as character and take p_pagein-value into it and then move P_I into another variable and do the manipulations....
did u try to debug keeping breakpoint in this subroutine..
check whether the values are populated right or not....
this should be helpful...
Thanks,
Anil
Hi Deepthi,
Change the way u read the table in the subroutine 'check_page'
use like this...
READ TABLE p_pagein WITH KEY 'SAPSCRIPT-FORMPAGES'.
....
....
Also change the other read also as
READ TABLE p_pageout WITH KEY 'WS_PAGE'.
.....
.....
Thanks,
Anil
Please reward if helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I can not use this logic directly.Because.....
I have 3 pages in total in my Script
1. Mail Page
2. First Page
3. Next Page
Here, I have to skip mail page means i should not count mail page..
I have to count only first page & Next page..
So, this logic doesn't work
I have tried doing SAPSCRIPT-formpages - 1.
But that couldn't work...
So , please help me.
Regards,
Deepthi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
DO like this
/: Page &PAGE& OF &SAPSCRIPT-FORMPAGES&
&SAPSCRIPT-FORMPAGES&:
This field contains a number representing the total number of pages of the currently formatted form (any output between START_FORM and END_FORM). The page counter mode (START, INC, HOLD) of the individual pages is ignored. You can use this symbol to formulate information like
Page x of y for your output.
Cheers,
Vasanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
just use this in next page also.
/: Page &PAGE& of &SAPSCRIPT-FORMPAGES&
i hiope it may work,
regards,
ravi shankar reddy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.