‎2006 Jul 25 4:10 PM
Hi
i used the following two satements in main window of my script.
/: BOX FRAME 10 TW
Page &PAGE& of &SAPSCRIPT-FORMPAGES&
I get abox and a message in page 1 of 5 onl;y in my first page.
I want this to to be extended for all pages i.e i need abox and a message saying page 2 of 5 in second page.
can anyone help me regarding this.
AND WHAT THE SYMBOLS MEAN , I AM CONFUSED AS TO WHICH ONE I NEED TO USE SYMBOLS MEAN *,/:,/e etc
‎2006 Jul 25 6:10 PM
Hi, I HAVE TRIED WITH THIS CODE TOO
I DISPLAYS THE DATE AFTER EVERY RECORD AND THAT TOO IN ONLY FIRST PAGE.
/E DATA
/: if &prev& EQ &page& .
page &page& of &sapscript-formpages&
/: &prev& = &prev& + 1 .
/: endif .
&ITAB-MATNR&,,,,&ITAB-KOSTL&
I WANT SOME THING LIKE THIS
FIRST PAGE
PAGE 1 OF 5
123 456
234 567
---
SECOND PAGE
PAGE 2 OF 5
345 567
334 788
--
SECOND PAGE
PAGE 3 OF 5
345 888
222 999
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DATA'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
OTHERS = 9
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
‎2006 Jul 25 4:16 PM
hi kajol,
write this under a text element.
/E Details
/: BOX FRAME 10 TW
Page &PAGE& of &SAPSCRIPT-FORMPAGES&
in driver program.
loop at itab.
call function 'WRITE_FORM'
EXPORTING
ELEMENT = 'DETAILS'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
CODEPAGE = 9
OTHERS = 10
.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
WHAT THE SYMBOLS MEAN , I AM CONFUSED AS TO WHICH ONE I NEED TO USE SYMBOLS MEAN *,/:,/e etc
/E-> Text element.
/: -> Command line
*-> Default Paragraph.
hope this helps,
do reward if it helps,
priya.
‎2006 Jul 25 4:22 PM
Hi ,
I HAVE THAT WRITTEN IN MAIN WINDOW .BUT FOR SOME REASON IT WORKS ONLY FOR FIRST PAGE.
can you help me to extend it to all pages
‎2006 Jul 25 4:24 PM
Hi,
Can you paste us the code in main window . I guess you did not have this piece of code under the element .Priya has already suggested this . PLease go through Priya's response once again .
regards,
Varun .
Message was edited by: varun sonu
‎2006 Jul 25 4:19 PM
Hi Kajol,
In which window are you trying to print the data ? how many pages are there and is the window in which you are trying to print the data is in all the pages ? I guess you are not porinting in the main window .
/: is a command line whihc you can use to specfiy command statements like BOX, POSITION IF, CASE etc .
/E is an elemnt command whihc is used to link the form with the print program .
/E main
you use this variable in the FM write_form to specify that you want to write data to the main window .
Regards,
Varun .
‎2006 Jul 25 4:29 PM
Hi Kajol,
1) If your page 1 of 5 is part of main window then do coding as suggested by Priya.
2) If not create a separate window and write these two statements under script editor.
3) The first two columns in the script editor descirbes about the action to be taken on text elements.Just press F4 at this column, then it will gives the descriptions of these columns.
<b>/: Command Line
/* Comment Line
/E Text Element
= Extended Line</b>
( Raw Line
/ Line Feed
/= Line Feed and Extended Line
/( Line Feed and Raw Line
Thanks,
Vinay
‎2006 Jul 25 4:37 PM
HI GUYS,
The page number is displaying for all pages but the problem is that its displaying after every record
This is my main window code
/E DATA
PAGE &PAGE& OF &SAPSCRIPT-FORMPAGES&
/: BOX FRAME 10 TW
&ITAB-MATNR&,,,,&ITAB-KOSTL&
O/P IS LIKE THIS
PAGE 1 OF 15
1233 123
PAGE 1 OF 15
12344 3434
INSTEAD I WANT PAGE 1 OF 15 ONLY ONCE AT THE TOP OF THE MAIN WINDOW AND THAT TOO AT RIGHT HAND CORNER
PLEASE GUIDE ME FOR THIS
‎2006 Jul 25 4:39 PM
Hi Kajol,
1) This is happened due to your WRITE_FORM as this ELEMENT E in a LOOP...ENDLOOP.
2) So,remove the PAGE statement from ELEMENT E and place out side of ELEMENT E.
3) Try with this replacement in your script editor.
<b>* PAGE &PAGE& OF &SAPSCRIPT-FORMPAGES&
/E DATA
/: BOX FRAME 10 TW
&ITAB-MATNR&,,,,&ITAB-KOSTL&</b>
Note: Plz reward points to all helpful answers and close the thread once problem is solved.
Thanks,
Vinay
‎2006 Jul 25 4:40 PM
Hi,
Kajol, rewrite your code like this :
/E lines
PAGE &PAGE& OF &SAPSCRIPT-FORMPAGES&
/E DATA
&ITAB-MATNR&,,,,&ITAB-KOSTL&
I think Vinay gave you the better answer.
Regards,
Varun .
Message was edited by: varun sonu
‎2006 Jul 25 4:43 PM
Hi,
I already tried that .If i do that i dont see the page number for for my second page .
I have created two pages
first page ,second page
the second page repeats
‎2006 Jul 25 4:49 PM
Hi,
Try to create a new window and have the same window on both pages above the main window .In the editor of that window have your code :
&page& of &formpages&
This should resolve your problem .
Regards,
Varun .
‎2006 Jul 25 5:04 PM
Hi ,
If i do that i doesn't the no of pages the data will take so its displays only like page 1 of thats it.
‎2006 Jul 25 5:13 PM
Hi,
Declare a variable in the print program :
data : prev type n value 1 .
In the main window use this code :
/E DATA
/: if &prev& EQ &page& .
page &page& of &sapscript-formpages&
/: &prev& = &prev& + 1 .
/: endif .
&ITAB-MATNR&,,,,&ITAB-KOSTL&
Regards,
Varun .
Message was edited by: varun sonu
Message was edited by: varun sonu
‎2006 Jul 25 5:37 PM
hi kajol,
I WANT PAGE 1 OF 15 ONLY ONCE AT THE TOP OF THE MAIN WINDOW AND THAT TOO AT RIGHT HAND CORNER
,,,,,(give tab space for right)Page: &PAGE& of &SAPSCRIPT-FORMPAGES&
hope this helps,
do reward if it helps,
priya.
‎2006 Jul 25 6:10 PM
Hi, I HAVE TRIED WITH THIS CODE TOO
I DISPLAYS THE DATE AFTER EVERY RECORD AND THAT TOO IN ONLY FIRST PAGE.
/E DATA
/: if &prev& EQ &page& .
page &page& of &sapscript-formpages&
/: &prev& = &prev& + 1 .
/: endif .
&ITAB-MATNR&,,,,&ITAB-KOSTL&
I WANT SOME THING LIKE THIS
FIRST PAGE
PAGE 1 OF 5
123 456
234 567
---
SECOND PAGE
PAGE 2 OF 5
345 567
334 788
--
SECOND PAGE
PAGE 3 OF 5
345 888
222 999
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DATA'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
OTHERS = 9
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
‎2006 Jul 25 6:14 PM
Hi,
Did you check wether prev value is getting updated ?
Regads,
Varun.
‎2006 Jul 25 6:14 PM
‎2006 Jul 25 6:15 PM
HI,
Goto se71 and follow the navigation : utilities -> activate debugger and then run the program .
Also try this :
LOOP AT ITAB.
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT = 'DATA'
FUNCTION = 'SET'
TYPE = 'BODY'
WINDOW = 'MAIN'
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT = 1
FUNCTION = 2
TYPE = 3
UNOPENED = 4
UNSTARTED = 5
WINDOW = 6
BAD_PAGEFORMAT_FOR_PRINT = 7
SPOOL_ERROR = 8
OTHERS = 9
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
<u><b>prev = prev +1 .</b></u>
ENDLOOP.
IN the form editor remove &prev& = &prev& + 1
Regards,
Varun .
Message was edited by: varun sonu
Message was edited by: varun sonu
‎2006 Jul 25 6:21 PM
Hi Kajol,
1) Just place <b>&PAGE& OF &SAPSCRIPT-FORMPAGES&</b> statement between <b>TOP...ENDTOP</b>.
2) As for main window, you can determine lines, which are always O/P automatically at the top of the window with TOP...ENDTOP.
3) So, use this code in your script editor.
<b>/: TOP.
PAGE &PAGE& OF &SAPSCRIPT-FORMPAGES&
/: ENDTOP.
/E DATA
/: BOX FRAME 10 TW
&ITAB-MATNR&,,,,&ITAB-KOSTL&</b>
4) <b>To activate the debugger</b> in scripts,Select <b>Utilities</b> menu and select <b>Activate Debugger</b>.
Note: Plz reward points to all helpful answers and close the thread once problem is solved.
Thanks,
Vinay
‎2006 Jul 25 6:42 PM