You are on page 1of 18

12

Chapter 12: ABAP Report Templates

Contents

In this chapter you will learn:
ƒ

The basic structure of an
ABAP report

First Things First .................................................................................................. 12–2

ƒ

The difference between
traditional and interactive
reports

ƒ

How to build a traditional
report using the report
template

ƒ

How to build an
interactive report using the
report template

ƒ

Useful tips and tricks on
ABAP report development

ABAP Reporting Basics....................................................................................... 12–3
Template Approach to Report Development ..................................................... 12–7
Working With Report Templates ......................................................................... 12–8
Getting the Most from ABAP Report Development: Tips & Tricks................ 12–17
Where to Learn More .......................................................................................... 12–18

Report Development Tools

12–1

Contact your system or security administrator for the required authorization. Ideally. < You should have a basic understanding of ABAP. While ABAP provides numerous features to create excellent programs. the robust functionality of ABAP (combined with the programming styles of many programmers) may make it cumbersome. you should consider ABAP development only after you can answer “yes” to all of the following questions: < Did you do a thorough search of the standard reports to find the report you need? < Did you survey available standard report development tools to determine if a certain tool fits your report needs? < Did you check other report resources (such as user groups and/or OSS—SAP’s Online Support Service)? Fundamentals of Reporting. it may be time to consider ABAP for custom development. Reporting Made Easy . you should be aware of the following prerequisites and assumptions: 12–2 < Your user account is registered as a developer in OSS. < You need to be authorized to develop programs. we focus on helping you build an ABAP report using templates. Writing reports in ABAP can be costly. the first book in the Reporting Made Easy series. Advanced Business Application Program (ABAP). Instead. Before You Consider ABAP The decision to use ABAP to create custom reports requires careful consideration. However. as are the reporting tools outlined in the previous chapters. outlines how to approach the questions listed above. The tactical approach to reporting (see chapter 2 in book 1. This chapter is structured differently than the others. it is not geared solely toward report creation.Chapter 12: ABAP Report Templates First Things First First Things First In the preceding chapters you learned about the different report development tools available in the R/3 environment. time-consuming. you should be able to learn reporting-related ABAP commands. and in many cases unnecessary. Thus. If you have prior programming experience. which can be used to build custom reports. if you still do not have a solution for your reporting requirement. Before You Start If you are an ABAP programmer. This chapter introduces the basics of SAP’s programming language. Fundamentals of Reporting of this guidebook series) recommends that you use ABAP only after you have explored all other options. If your account is not classified as a developer. then contact your system administrator to modify your account classification. It does not present all the features of ABAP—we leave that to the online documentation.

and using them appropriately in the program to make the report produce the desired results in an output list. Each block contains the necessary ABAP code to do its task. ABAP uses its own set of SQL statements called “Open SQL” which are simplified but similar versions of SQL. Process the read-data as required. < You should be familiar with ABAP event-triggering. Basic Structure An ABAP report consists of the following basic blocks (or sections): 1. Think of these functions as the basic building blocks of any report. Report Development Tools 12–3 . As shown in the graphic on the following page. 2. Understanding which event statement is relevant to which building block of a report helps speed up report development. The ABAP code within each block can be further modularized to perform the steps required for a given block to function. ABAP Reporting Basics Writing reports in ABAP is a matter of understanding the various commands relevant to each basic block.Chapter 12: ABAP Report Templates ABAP Reporting Basics < You should have a basic knowledge of Structured Query Language (SQL). ABAP code is written to perform certain functions that typically fall under one of the three blocks listed above. Get the required data from the database. Do not use the production (or any other) system to write ABAP reports. < ABAP report development must always be done in the development system . Output the processed data as a formatted list on the screen or the printer. 3. these functions are performed in a linear sequence and are dependent on each other. < You should know how to create function modules in ABAP.

grouping.Chapter 12: ABAP Report Templates ABAP Reporting Basics Basic Report Blocks Basic Block Tasks • Define data containers to store and output data Get required data • Define selection parameters as a basis for data retrieval • Read relevant data into selection parameters • Refine retrieved data (sorting. the report processes the read-data.) Process the read data • Refine authorization filters • Perform desired calculations against the data • Prepare a list page layout (header. a traditional report sends all output data to a single list called a basic list.) Types of ABAP Reports As shown in the graphic below. An interactive report allows the user to interact with the report list. 12–4 Reporting Made Easy . color. the report program execution concludes and no further interaction or user input is possible. Once the report list is displayed on the screen or sent to a print spool. the execution of the report is finished as soon as the output list is displayed. size. and displays a list for output. etc. comments. etc. allows the user to enter selection parameters as key input for retrieving the data from the database. footer. indentation.) Output processed data as a list • Write and format the fields data (header. An interactive report is an extension of a traditional report. With a traditional report. etc. Interactive Report Traditional Traditional Report Report Traditional Reports A traditional report. also called a “classic” report. If the output is sent to the screen. icon. Then. there are two types of ABAP reports: < Traditional reports < Interactive reports Both report types share the same basic structure and functionality.

it sends data to the basic list just like a traditional report. an event is triggered. Any additional information is presented as a secondary list. an interactive report is written so that for every user input. To program the output list. Typically. which may either completely replace the previous basic or secondary list. a set of available ABAP commands is used. some source code is executed. or appear in a secondary window on the same screen. or jumping to system transaction < Displaying summarized results or totals in a new window < Downloading to desktop applications < Printing of selected fields on the displayed list The first time an interactive report issues output. this expanded functionality is particularly useful for reports that require: < Controlling the number of displayed fields on the screen < Interactively sorting in any order of any field on the screen < Calling up another report. or jumps to a new screen. and the report responds back with either a new secondary list. As shown in the graphic above.Chapter 12: ABAP Report Templates ABAP Reporting Basics Traditional Report Interactive Report Interactive Report User User enters enters selection selection parameters parameters Traditional Traditional Report Report User User enters enters selection selection parameters parameters Read Read data data is is processed processed Read Read data data is is processed processed Basic Basic report report list list is is generated generated Basic Basic report report list list is is generated generated Display on screen OR Display on screen Send to print spool OR Send to print spool Secondary list Plus • • • • • Download to desktop applications Control number of fields displayed Call up another report Jump to a system transaction Display summarized results or totals in a new window • Print selected fields • Interactive sorting of fields Interactive Reports Interactive reporting builds on the standard functionality of a traditional report. An interactive report performs all the functions of a traditional report and provides the user with the means to interact with the report even after the list is displayed on the screen. Report Development Tools 12–5 .

and total calculation. and provide a menu button to view detailed line item information as a secondary list in a new window. Even if the report is complex in nature. writing an interactive report is probably not worth the development effort. detailed line information. then a traditional report is recommended. consider an interactive report. and faster to develop and maintain.0 you can use a new tool called the ABAP List Viewer (ALV) and a set of function modules to build interactive reporting functionality without having to program. or monthly basis. Presentation If the report is used for frequent presentation purposes. an interactive report is useful. You can enhance the displayed list visually by suppressing the output of lengthy fields. The ALV can help save time on display formatting. For more information on ALV. Width of data fields If the report requires the simultaneous display of many large data fields. Reporting Made Easy . Ease of programming Traditional reports are typically easier to program. a traditional report can always be enhanced to become an interactive report without significant source code changes. an interactive report carries a stronger impact. If the report is to be run more frequently. weekly. an interactive report (which allows further analysis) is probably preferable. If needed.Chapter 12: ABAP Report Templates ABAP Reporting Basics In Release 4. then choose interactive reporting style. Traditional Versus Interactive Reports We suggest using the following guidelines to decide whether to develop a traditional report (basic list display) or an interactive report (interactive data retrieval). It also handles many basic interactive features such as sorting. Background processing only A traditional report is recommended since user interaction is irrelevant in this case. or for an online demonstration of a successful project (such as employee achievements). Number of users Choose the interactive reporting style for any report that is used by many users and is normally executed online for tracking purposes on a daily. or requires a multilayered output list. User interaction If the specifications require some form of user interaction. 12–6 Criteria Recommended Report Type Frequency of report use If the report is run quarterly or annually. refer to appendix A. Number of calculations If the report uses numerous mathematical calculations and displays multitotaled field results.

The programmer then completes the detail. This is especially helpful when other programmers have to maintain the report in the future. you can create your templates by refining the ones supplied with this guidebook. a template is not specific to any report. and the report functionality. < Saves time: A report template is a good way to jumpstart the development effort and save time. Note: A template approach to report development is a convenient and effective way to start writing reports. A template can be easily expanded to include new subroutines and new program code relevant to the report requirements. the template can be instantly used to insert the necessary source code in the various program sections. and may end up taking more time than starting a report from scratch. templates eliminate the process of copying an existing report. The template itself cannot be generated. These processes are awkward. Any statement can have its parameter names changed while still keeping it syntactically correct. It only serves as a roadmap for starting a report development project. Because each report has its own requirements. < Eliminates cumbersome copying: For instance. Report Development Tools 12–7 . which allows a template to be well structured and highly customizable. few things take the place of well-integrated comments. Why Use a Report Template? Report templates offer the following advantages: < Modular structure: Reports in general are modular. You must have basic ABAP knowledge to convert the template to executable code. to help future programmers understand report code. Once the programmer identifies the database tables to work with. It includes the ABAP statements and events. the selection criteria. deleting many lines of source code. We recommend that customers adopt a template approach for all of their custom report development. (However. we suggest designing a company standard report template for use by all programmers who write reports.) < Syntax: Even experienced programmers sometimes forget the exact syntax of a command and have to look it up. or modifying source code that is relevant but uses different field names.Chapter 12: ABAP Report Templates Template Approach to Report Development Template Approach to Report Development A report template is a generic program that contains all the necessary report elements common to any report. If needed. as they would typically be placed in a report. It consists of many empty placeholders for which custom source code is programmed. If your company does not use templates. Consequently you cannot execute a template. < Consistency: Using templates ensures consistency of source code and structural uniformity across many reports. Templates include frequently used program statements in their correct syntax form.

Change the words in italics and insert new ABAP commands similar in functionality under those sections. and try to apply them according to your report needs. an electronic version (Microsoft Word document) of the specification form is included on the companion CD supplied with this guidebook series. To help customers and consultants streamline the process of developing reports. Sections that are common to both templates have been described only once in the traditional report template. Report Specification Form and Report Templates A report specification form serves as the starting point for ABAP report development. To illustrate in where particular report section parameters would be found. A detailed and complete specification is important for efficient report development. a developer can fill many of the placeholders in the report template simply by pulling related information blocks from the specification form. 12–8 Reporting Made Easy . In addition.Chapter 12: ABAP Report Templates Working With Report Templates Working With Report Templates In this section you learn to work with the following types of report templates when writing a report: < Traditional report template < Interactive report template To work with a template. parameters for the ABAP statements included in this template are shown in italics.saplabs. Note: A ready-to-use template containing the necessary source code for an interactive and traditional report is included in the CD supplied with this guidebook.com/rme. etc. of this guidebook series. a sample report specification form is shown in book 1.com/rme. follow the steps and hints shown.saplabs. It provides the developer with vital information about the reporting project. We suggest making use of the report specification form to supply the information for some of the blocks (for example. As shown in the table on the next page.) in the report template. You can also download the specification form from www. or modify it to suit your requirements. Additionally. You can use the report specification form as is. You can also download the templates from our website at: http://www. database tables. the descriptive names of the parameters have also been included. Fundamentals of Reporting. report name.

modularize the source code using several subroutines if necessary. From the SAP main menu. Choose Create. the system will not let you create an ABAP report. Data declarations (Tables statement) Item 5: Please indicate any known tables or fields desired in the report (Page 2). You could use subroutine names that are different from the ones shown in italics.Chapter 12: ABAP Report Templates Working With Report Templates Information a Developer Needs for the ABAP Report Blocks Where Found on the Report Specification Form Title Item 1: What is the suggested name of the desired report (Page 2)? Documentation Item 2: Give a short description of the desired report (Page 2). Contact your system administrator for more information. Instead. Also. In the Program field. Report Development Tools 12–9 . Note: Although you will enter the source code in the ABAP Editor. then Development → ABAP editor. (Filled out by the person requesting the report) Traditional Report Template To work with this template. choose Tools → ABAP Workbench. the actual screens are not included here. 2. Guided Tour 1. 3. only the source code you would enter in ABAP Editor is shown. Attributes or Application Item 4: Name the application(s) or data area(s) for the report (Page 2). enter a name for your report. enter the relevant information in each section as described here. This template uses a prefix convention for each program object. 3 2 If your user account does not have developer status.

< Enter all include program names used by the report (for example. and the change description. DDIC_View1. DDIC_Structure1. < Define all the necessary internal tables where the program needs to store the data. “ Table description “ Table description “ Table view description “ Structure description ************************************************************** * DATA . Field2 LIKE table-field2. < Report attributes such as program name and title when the report is first saved. ProgramName. system icons. DDIC_tab2. or structures in this section. < Change history including date. symbols. views. <symbols>. Field1 LIKE table-field1. END OF ITAB_tab1. Reporting Made Easy . 12–10 REPORT REPORTNAME. or the names of include programs that contain source code the report uses) < Define report tables. LINE-SIZE XX LINE-COUNT YY ************************************************************** * * Program Info: (information IN ADDITION to what is already * captured in program ATTRIBUTES and DOCUMENTATION) * ************************************************************** * * Change History: (in addition to what is found in Version * Management) * * Date/Author: * Reason/Description of Change: * * Date/Author: * Reason/Description of Change: * ************************************************************** ************************************************************** * DATA DECLARATIONS . ************************************************************** * PROGRAM TABLES / STRUCTURES / VIEWS ************************************************************** TABLES: DDIC_tab1.Chapter 12: ABAP Report Templates Working With Report Templates Enter: < Report name and width of the list.BEGIN ************************************************************** ************************************************************** * INCLUDES ************************************************************** Include Include Include Include <icons>. <system include>.INTERNAL TABLES (ITAB_tablename) ************************************************************** DATA: BEGIN OF ITAB_tab1 OCCURS n. Object names are not always descriptive. and include the text description of each object. name of person changing the report.

You usually initialize any data fields or structures before working with them.STRUCTURES (WA_structurename) ************************************************************** DATA: BEGIN OF WA_structure1. PARAMETERS: P_RB000 RADIOBUTTON GROUP G1 DEFAULT 'X'. ************************************************************** * DATA . SELECT-OPTIONS: SEL_field2 FOR DDIC_tab2-field1 [options].Chapter 12: ABAP Report Templates Working With Report Templates < Define the internal structures or work areas the program uses to store and work with temporary header data. INCLUDE STRUCTURE DDIC_tab2. P_RB001 RADIOBUTTON GROUP G1. DATA: END OF WA_structure1. < This event is used to control the display of the selection screen interface. ************************************************************** * SELECTION-SCREEN / PARAMETERS (P_parametername. < Global data fields are declared in this section with a G_ prefix for ease of recognition in the program code. G_field4 like DDIC_tab1-field1 value ‘value’.END ************************************************************** < In this section you define the selection criteria of the report. ************************************************************** * DATA DECLARATIONS . G_header2 TYPE C value is initial. G_header1 TYPE C value is initial. SELECT-OPTIONS: SEL_field1 FOR DDIC_tab1-field1 [options]. You use the parameters or the select-options statement with various options to draw the selection screen interface. * SEL_fieldname) ************************************************************** SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE T1. 12–11 . PERFORM ATSelOut100_MODIFY_SCREEN < All initialization occurs once at the beginning of the report. PERFORM INIT100_Program_Variables. ************************************************************** * DATA – Global Work Fields (G_fieldname) ************************************************************** DATA: G_field3 TYPE C value is initial. ************************************************************** * AT SELECTION SCREEN OUTPUT (ATSelOutxxx Events) ************************************************************** AT SELECTION-SCREEN OUTPUT. Report Development Tools ************************************************************** * INITIALIZATION (INITxxx Events) ************************************************************** INITIALIZATION. SELECTION-SCREEN END OF BLOCK B1.

Reporting Made Easy . insert appropriate authorization checks < This section is used to output the data as a list. <AUTHORITY-CHECK OBJECT Object name> CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING TEXT = T2 EXCEPTIONS OTHERS = 1. PERFORM EndPage100_Print_Report_Footers. 12–12 ************************************************************** * END-OF-SELECTION (EndSelxxx Events) ************************************************************** END-OF-SELECTION. < Each output list has a top-of-page. PERFORM TopPage100_Print_Report_Headers. and text headers for data fields in this section.Chapter 12: ABAP Report Templates Working With Report Templates < At this point. and preferably placed in one subroutine ************************************************************** * START-OF-SELECTION (StartSelxxx Events) ************************************************************** START-OF-SELECTION. You program the page headers. PERFORM StartSe100_Main_Processing. ************************************************************** * END-OF-PAGE (EndPagexxx Events) ************************************************************** END-OF-PAGE. PERFORM EndSel100_Output_Processing. You program the display of the data fields under this event. < Depending on your authorization requirements. < Each output list also has an end-of-page. information lines. ************************************************************** * TOP-OF-PAGE (TopPagexxx Events) ************************************************************** TOP-OF-PAGE. The WRITE statement is used with various options to format the list output. All data selection and processing source code is programmed under this event. Page footers are programmed in this section. the report starts reading data from the database based on the selection criteria entered.

“ text element T3 = TEXT-300. “ text element T2 = TEXT-200. L_field1 = L_field1 + SY-TABIX. ENDSELECT. SY-VLINE NO- ENDFORM. ITAB_tab1-field3 = DDIC_tab1-field5. < List display is programmed at this point. CLEAR: G_field3. COL_KEY. ENDLOOP. WRITE:(5) ITAB_tab1-field1 GAP. ITAB_tab1-field1 = DDIC_tab1-field3 + L_field1. < This subroutine is used to initialize the data structures of the report. < Remember: The source code found here and elsewhere is only to illustrate the logic. SQL statements are programmed to retrieve data from the database according to the entered selection criteria. FORMAT INTENSIFIED OFF COLOR LOOP at ITAB_tab1. Report Development Tools 12–13 . ITAB_tab1-field2 = DDIC_tab1-field4. WRITE:/ SY-VLINE NO-GAP. < Data selection occurs in this form. G_field4. SELECT field3 FROM WHERE AND field4 field5 DDIC_tab1 Key_field1 IN SEL_field1 Key_field2 = P_field2. ENDFORM. T1 = TEXT-100. ITAB_tab2. WA_Structure1.Chapter 12: ABAP Report Templates Working With Report Templates < This section contains the source code of the subroutines used. and store them in the internal tables. ENDFORM. WRITE:(6) ITAB_tab1-field2 WRITE:(7) ITAB_tab1-field3 GAP. DATA: L_field1 TYPE I VALUE is INITIAL. SY-VLINE NO-GAP. “ text element G_header1 = Text-400. ************************************************************** FORM EndSel100_Output_Processing. NO-GAP CENTERED. SY-VLINE NONO-GAP. APPEND ITAB_tab1. Each output data field is sent to the screen with the WRITE statement along with the formatting options. ************************************************************** * FORMS / (SUBROUTINES) ************************************************************** FORM Init100_program_variables REFRESH: ITAB_tab1. The actual source code of your report is likely to vary. “ INIT100_PROGRAM_VARIABLES ************************************************************** FORM StartSel100_Main_Processing. G_header2 = Text-500. It could also be used to fill internal tables with data that is not part of the report data processing. NO-GAP CENTERED.

CALL FUNCTION 'Z_COMPANY_REPORT_HEADER' EXCEPTIONS OTHERS = 1. ************************************************************** < At the bottom of each page. ************************************************************** < This helper subroutine centers any text string according to the width-size of the list. 020 G_header2.Chapter 12: ABAP Report Templates Working With Report Templates < A list can have several pages. L_LENGTH = STRLEN( P_STRING ). L_STARTPOS TYPE I. AT SY-LINSZ SPACE. ************************************************************** 12–14 Reporting Made Easy . FORM EndPage100_Print_Report_Footers. the report footer information is displayed. At the top of each page. a report header and text description of data fields are displayed. with a subroutine to handle the centering of the text. FORM TopPage100_Print_Report_Headers. PERFORM TopPage200_print_centered using T3. L_STARTPOS = CEIL( ( SY-LINSZ . WRITE: /L_STARTPOS P_STRING. Use this form to program any footer information the report uses. CALL FUNCTION 'Z_COMPANY_REPORT_FOOTER' EXCEPTIONS OTHERS = 1. WRITE: /000 G_header1. DATA: L_LENGTH TYPE I. ENDFORM. ULINE.L_LENGTH ) / 2 ). ENDFORM. ENDFORM. We recommend you use a company standard header. ************************************************************** FORM TopPage200_print_centered using p_string type c.

< Interactive reporting uses a secondary list that in turn uses pages for output. Modify the existing source code. Append the sections described below to the traditional template. Start with the traditional template illustrated in the previous section. Each button will have a function code Fcode to execute the necessary steps. PERFORM AtLineSel100_LINE_SELECTION. 2. PERFORM AtUsrCmd100_USER_COMMAND. **************************************************************** * TOP-OF-PAGE DURING LINE-SELECTION ( TopLinSelxxx Events) **************************************************************** TOP-OF-PAGE DURING LINE-SELECTION. < This event is used to control screen list events that occur when the user selects or double-clicks on a list line. Report Development Tools **************************************************************** * AT USER-COMMAND (AtUsrCmdxxx Events) **************************************************************** AT USER-COMMAND. Guided Tour < This event is triggered when the user pushes a button on the screen. 12–15 . 3. This event is used to reexecute the top-ofpage code. **************************************************************** * AT LINE-SELECTION (AtLineSelxxx Events) **************************************************************** AT LINE-SELECTION.Chapter 12: ABAP Report Templates Working With Report Templates Interactive Report Template To work with the interactive template: 1. PERFORM TopPage100_Print_Report_Headers.

which ends up executing some steps. DATA: L_FIELD1(40) TYPE C. **************************************************************** * FORMS / (SUBROUTINES) **************************************************************** FORM AtUsrCmd100_USER_COMMAND. MODIFY CURRENT LINE L_LINE1 FORMAT INTENSIFIED ON. ENDFORM. CASE SY-UCOMM. WHEN 'Fcode1'. WHEN 'ITAB_tab1-field1'. Reporting Made Easy . **************************************************************** FORM AtLineSel100_LINE_SELECTION. WHEN 'Fcode2'. L_FIELD1(40) TYPE C. or selects a hotspot area. GET CURSOR FIELD L_FIELD1 VALUE L_VALUE1 LINE L_LINE1. Submit report ReportName and return. **************************************************************** FORM AtUsrCmd200_Sort_List. The line contents are usually used to execute further program steps. and regenerating the list display. PERFORM EndSel100_Output_Processing. WHEN 'G_header1'. 12–16 SORT ITAB_tab1 ascending by field1 ENDFORM. GET CURSOR FIELD L_FIELD1 VALUE L_VALUE1. L_VALUE1 LIKE SY-LISEL. SUBTRACT 1 FROM SY-LSIND. < User line input on a particular line of the displayed list is handled in a similar way as user commands. This event is triggered when the user double-clicks on a line. Call transaction ‘TRAN’ and skip first screen. ENDFORM. L_VALUE1(44) TYPE C. ENDCASE. < This subroutine is used to demonstrate the sorting of the list when the user pushes a sort button on the menu. GET recognizes global fields only. CASE L_FIELD1. DATA: L_LINE1 LIKE SY-LILLI.Chapter 12: ABAP Report Templates Working With Report Templates < User input from the menu or pushbuttons is usually handled in a subroutine using a case statement for each possible function code. ENDCASE. PERFORM AtUsrCmd200_Sort_List.

Use the include programs and function modules if the program is too large. or create new ones for use. Rather. < When creating interactive reports. processing. It is important to discover omitted data fields to include in the program for instance. < Icons and symbols in lists enhance the visual appeal of a list. Report Development Tools 12–17 . and detailed field information. For example. OLE allows automatic transfer of list data to an Excel spreadsheet without having to format the data as a delimiter file. Include icons where they help a user better understand the meaning of the data. the focus should be on developing the report and not on setting specifications. Report specifications and requirements will often change throughout the project and before the report is complete. In addition. or as part of the selection screen interface. < Use OLE (Object Linking and Embedding) to enable reports to be downloaded into desktop applications such as Microsoft Excel or Word.Chapter 12: ABAP Report Templates Getting the Most from ABAP Report Development: Tips & Tricks Getting the Most from ABAP Report Development: Tips & Tricks < Assess the complexity and size of your report based on: ƒ Report specifications ƒ SAP application areas involved ƒ Number of database tables the report uses ƒ Complexity of data selection and processing ƒ Various display formats or so-called report flavors requested for output < Start building your report from an empty template. < Use descriptive colors for field display. or yellow for totals. and aware of the functions of the original report. and display. sort sequencing. Note: If the primary objective is to download data to another application. However. or to group common source code together. < If many output fields need to be displayed. use of dynamic field offset and size for the output of data fields helps when programming interactive scrolling or hiding fields from the display. but programmers should be very careful. a green traffic light usually means that the data is valid or has been updated. < Researching and finding the report specifications along the way does not fall under report writing. use dynamic field offset and size for the output of data fields. report writing should include researching tables. < Use a standard report header and footer for all custom reports. < Modularize data selection and processing. Some reports can be created with reference to other reports. Just like text elements. or alternate line color to make the list easier to read. for example. Use existing function modules. red for negative quantities. key fields involved in data selection. you can use color stripes. it is important to note that the use of OLE increases the processing time. provide helpful line functions such as multiple row and column highlighting.

General Programming Hints < Use text elements instead of typed text in the program. you will find more information on ABAP. This is a standard procedure to fix or change the logic or the list format. the data in the development system is unavailable. Do not mix comments and source code on the same line unless necessary. Think of ways you can make your report easily modifiable. < Attach comments to your source code as much as possible. To order printed copies use product number 50014371. < Future maintenance of any program is essential during the life of the report. < Use the debugger and set break points when testing the report.0B. You can also purchase this book from www. < Use a consistent naming convention for all program objects. is incorrect. Reporting Made Easy . Often.computerliteracy. Where to Learn More 12–18 < R/3 Library (Online help): In Release 4.Chapter 12: ABAP Report Templates Where to Learn More < A good approach for testing reports is to use dummy data to test the logic and the report display.com < BC405: ABAP/4 Development Workbench—Reporting. Check the data in the system before modifying the report source code. Go to R/3 Library → BC → Basis Components → ABAP Workbench. and the report does not run as expected. or changes frequently. a five-day training course offered by SAP Education and Training. < Always document changes at the top of the report. Remember that text elements can be changed without having to change the source code. a comprehensive documentation set published by SAP AG. < ABAP/4 Development Workbench.