Home > SAP software/management Tips > SAP ABAP/Java developer tips > Print two pages of ABAP code on one page
SAP Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

SAP ABAP/JAVA DEVELOPER TIPS

Print two pages of ABAP code on one page


Ben Meijs
09.16.2002
Rating: -2.65- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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.



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                              *
*&              |          |                                           *
*&---------------------------------------------------------------------*

 REPORT  ZRSZPRAB LINE-SIZE       170
                  LINE-COUNT       58.

*----------------------------------------------------------------------*
* TABLES
*----------------------------------------------------------------------*

*----------------------------------------------------------------------*
* 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
*----------------------------------------------------------------------*


Rate this Tip
To rate tips, you must be a member of SearchSAP.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
SAP ABAP/Java developer tips
How to do additional dialog processing after SAP COMMIT WORK statement
How to find a piece of SAP ABAP code without debugging
How to read an SAP transaction in an ABAP code
How to provide an SAP R/3 4.5B application server with a Web service interface
How to find owners and transports of deleted ABAP programs
Fixing a common OPEN_FORM and START_FORM error in SAPscript
Select Text fields: Case-insensitive
Is this the quickest way to find a BADI?
Easily debug error messages in SAP processes
Accessing private attributes in ABAP Objects

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

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.



NetWeaver SAP White Papers
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
SearchSAP.com is a search service provided by TechTarget and is completely
independent of and not affiliated with SAP AG.
  TechTarget - The IT Media ROI Experts