Print two pages of ABAP code on one page

Here's a handy ABAP snippet that can be used to print two pages of ABAP code on one page (landscape format). And to save even more paper, people could print the sourcecode in duplex mode, so one piece of paper would contain 4 pages of ABAP code.

*& Report  ZRSZPRAB                                                    *
*&                                                                     *
*& Author   :  Ben Meijs   C/TAC                                       *
*& Date     :  01-05-1998                                              *
*& SAP rel. :  R/3 3.0 vv                                              *
*& Purpose  :  Print part of abap/4 sources two pages on one
*& Maintenance history                                                 *
*& Author       |Date      |Correction Nr                              *
*&              |          |                                           *

                  LINE-COUNT       58.



    Requires Free Membership to View

DATA *----------------------------------------------------------------------* * Internal table with header line DATA: BEGIN OF TA_REPID OCCURS 0, "omschrijving LINE(72) , END OF TA_REPID. * DATA: TA_EDIT LIKE TA_REPID OCCURS 0, * other help data TP_OFFSET LIKE SY-FDPOS , "line number of abap source TP_LINNR(6) TYPE N . "line number of abap source *----------------------------------------------------------------------* * CONSTANTS *----------------------------------------------------------------------* CONSTANTS: TRUE TYPE C VALUE 'X', "boolean meaning TRUE FALSE TYPE C VALUE ' '. "boolean meaning FALSE *----------------------------------------------------------------------* * SELECT-OPTIONS and PARAMETERS *----------------------------------------------------------------------* SELECT-OPTIONS: SO_LINNR FOR TP_LINNR "omschrijving NO-EXTENSION. PARAMETERS : "omschrijving PA_NAME LIKE TRDIR-NAME OBLIGATORY, PA_EDITR AS CHECKBOX. *----------------------------------------------------------------------* * TOP-OF-PAGE *----------------------------------------------------------------------* TOP-OF-PAGE. *----------------------------------------------------------------------* * START-OF-SELECTION : executed after Execute *----------------------------------------------------------------------* START-OF-SELECTION. FORMAT COLOR COL_NORMAL INTENSIFIED OFF. READ REPORT PA_NAME INTO TA_REPID . IF SY-SUBRC NE 0. WRITE: 'ABAP', PA_NAME , 'bestaat niet!' . ELSE. SY-TVAR1 = PA_NAME. * afdrukken TP_OFFSET = 0. LOOP AT TA_REPID. TP_LINNR = SY-TABIX * 10. CHECK SO_LINNR. IF PA_EDITR = TRUE. APPEND TA_REPID TO TA_EDIT. ELSE. WRITE: AT /TP_OFFSET(6) TP_LINNR NO-GAP, ' ' COLOR OFF NO-GAP, TA_REPID-LINE , SY-VLINE . IF SY-LINNO = 57 . IF TP_OFFSET = 82. NEW-PAGE. TP_OFFSET = 0. ELSE. TP_OFFSET = 82. SKIP TO LINE 3. ENDIF. ENDIF. ENDIF. ENDLOOP. ENDIF. *----------------------------------------------------------------------* * END-OF-SELECTION : executed after start-of-selection or STOP *----------------------------------------------------------------------* END-OF-SELECTION. IF PA_EDITR = TRUE. EDITOR-CALL FOR TA_EDIT. ENDIF. *----------------------------------------------------------------------* * FORMS *----------------------------------------------------------------------*

This was first published in September 2002

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.