‎2008 Nov 13 10:15 AM
Hi ,
Could you please tell me how is multiple pages trigerred in scripts.
Say the second page.
Is this done through the print program?
Are there any specific control commands to do so?
<<text removed by moderator>>
Thanks in advance,
Suchi.
Edited by: Matt on Nov 13, 2008 2:04 PM - do not use ASAP or urgent.
‎2008 Nov 13 10:35 AM
When you're on the last line of the page, you'll go to the next page. This can be set by page definition (next page etc.) or hardcoded in the print program.
You can control the new page by the NEW-PAGE statement in the script or by the control function module with NEW-PAGE in the print program.
regards,
Hans
‎2008 Nov 13 10:32 AM
Hi,
Shows the page flow information you must define atleast two pages. In Pages->Standard Attribute you can specify Page as First , in Next page you can specify the next page name.
The first page specifies the next page. The last page recursively defines the next page as itself.
Regards,
Bhaskar
‎2008 Nov 13 10:35 AM
When you're on the last line of the page, you'll go to the next page. This can be set by page definition (next page etc.) or hardcoded in the print program.
You can control the new page by the NEW-PAGE statement in the script or by the control function module with NEW-PAGE in the print program.
regards,
Hans
‎2008 Nov 13 10:36 AM
Actually the new page will be triggered automatically in scripts.
we can also include explicit page break.
in print program.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'
EXCEPTIONS
UNOPENED = 1
UNSTARTED = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
in scripts...just give the command NEW-PAGE where ever required.
‎2008 Nov 13 10:44 AM
The common way in which a new page is triggered in scripts is, when the main window of the current page fills up completely and there are still other entries that need to be written on the script. This will automatically written to a second page. There are other commands to manually trigger a new page without the main window filling up completely. These commands have already been mentioned by the fellow SDN members already. Say you have to display a materials info on a single page and for each material a new page has to be triggered. In this case you go for commands for triggering new pages.
‎2008 Nov 13 12:13 PM
Hello all,
Thanx a lot for ur replies.
In the debugger mode ,I am able to see the page changing from first to next page,
but then while executing the print program I see only a single page.
I have used the following code:
&----
*& Report Z_75354_SCRIPT_SESSION
*&
&----
*&
*&
&----
REPORT z_75354_script_session.
TABLES : z75354_emp.
TYPES :BEGIN OF ty_empdetail,
zempno TYPE z75354_emp-zempno,
zmailid TYPE z75354_emp-zmailid,
zpu TYPE z75354_emp-zpu,
zmark1 TYPE z75354_emp-zmark1,
zmark2 TYPE z75354_emp-zmark2,
zmark3 TYPE z75354_emp-zmark3,
zmark4 TYPE z75354_emp-zmark4,
zmark5 TYPE z75354_emp-zmark5,
zmark6 TYPE z75354_emp-zmark6,
zmark7 TYPE z75354_emp-zmark7,
zmark8 TYPE z75354_emp-zmark8,
zmark9 TYPE z75354_emp-zmark9,
zmark10 TYPE z75354_emp-zmark10,
zgrade1 TYPE z75354_emp-zgrade1,
zgrade2 TYPE z75354_emp-zgrade2,
zgrade3 TYPE z75354_emp-zgrade3,
zgrade4 TYPE z75354_emp-zgrade4,
zgrade5 TYPE z75354_emp-zgrade5,
zgrade6 TYPE z75354_emp-zgrade6,
zgrade7 TYPE z75354_emp-zgrade7,
zgrade8 TYPE z75354_emp-zgrade8,
zgrade9 TYPE z75354_emp-zgrade9,
zgrade10 TYPE z75354_emp-zgrade10,
v_total TYPE i,
END OF ty_empdetail.
DATA : i_empdetail TYPE STANDARD TABLE OF ty_empdetail WITH HEADER LINE,
wa_empdetail TYPE ty_empdetail,
wa_empdetail_temp TYPE ty_empdetail,
l_sum1 TYPE i.
v_total TYPE char250.
SELECT-OPTIONS : i_empno FOR z75354_emp-zempno .
START-OF-SELECTION.
SELECT zempno
zmailid
zpu
zmark1
zmark2
zmark3
zmark4
zmark5
zmark6
zmark7
zmark8
zmark9
zmark10
zgrade1
zgrade2
zgrade3
zgrade4
zgrade4
zgrade5
zgrade6
zgrade7
zgrade8
zgrade9
zgrade10
FROM z75354_emp INTO CORRESPONDING FIELDS OF TABLE i_empdetail
WHERE zempno IN i_empno.
SORT i_empdetail BY zempno zmark10.
LOOP AT i_empdetail INTO wa_empdetail.
wa_empdetail_temp = wa_empdetail.
l_sum1 = wa_empdetail_temp-zmark1
+ wa_empdetail_temp-zmark2 + wa_empdetail_temp-zmark3 +
wa_empdetail_temp-zmark4 + wa_empdetail_temp-zmark5 +
wa_empdetail_temp-zmark6 +
wa_empdetail_temp-zmark7
+ wa_empdetail_temp-zmark8 + wa_empdetail_temp-zmark9 +
wa_empdetail_temp-zmark10.
*
AT END OF zempno.
MOVE l_sum1 TO wa_empdetail_temp-v_total.
MODIFY i_empdetail FROM wa_empdetail_temp TRANSPORTING
v_total.
CLEAR :
l_sum1,
wa_empdetail_temp,
wa_empdetail.
ENDAT.
ENDLOOP.
END-OF-SELECTION.
CALL FUNCTION 'OPEN_FORM'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX =
ARCHIVE_PARAMS =
DEVICE = 'PRINTER'
DIALOG = 'X'
form = 'Z_TEST_75354'
language = sy-langu
OPTIONS =
MAIL_SENDER =
MAIL_RECIPIENT =
MAIL_APPL_OBJECT =
RAW_DATA_INTERFACE = '*'
SPONUMIV =
IMPORTING
LANGUAGE =
NEW_ARCHIVE_PARAMS =
RESULT =
EXCEPTIONS
CANCELED = 1
DEVICE = 2
FORM = 3
OPTIONS = 4
UNCLOSED = 5
MAIL_OPTIONS = 6
ARCHIVE_ERROR = 7
INVALID_FAX_NUMBER = 8
MORE_PARAMS_NEEDED_IN_BATCH = 9
SPOOL_ERROR = 10
CODEPAGE = 11
OTHERS = 12
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT i_empdetail. "
CALL FUNCTION 'WRITE_FORM'
EXPORTING
element = 'MAIN'
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.
CALL FUNCTION 'CONTROL_FORM'
EXPORTING
COMMAND = 'NEW-PAGE'
EXCEPTIONS
UNOPENED = 1
UNSTARTED = 2
OTHERS = 3
.
IF SY-SUBRC NE 0.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDLOOP.
CALL FUNCTION 'CLOSE_FORM'
IMPORTING
RESULT =
RDI_RESULT =
TABLES
OTFDATA =
EXCEPTIONS
UNOPENED = 1
BAD_PAGEFORMAT_FOR_PRINT = 2
SEND_ERROR = 3
SPOOL_ERROR = 4
CODEPAGE = 5
OTHERS = 6
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Please help.