- SAP ABAP - Web Dynpro
- SAP ABAP - Business Add-Ins
- SAP ABAP - User Exits
- SAP ABAP - Customer Exits
- SAP ABAP - SAPscripts
- SAP ABAP - Smart Forms
- SAP ABAP - Dialog Programming
- SAP ABAP - Report Programming
- SAP ABAP - Object Events
- SAP ABAP - Interfaces
- SAP ABAP - Encapsulation
- SAP ABAP - Polymorphism
- SAP ABAP - Inheritance
- SAP ABAP - Classes
- SAP ABAP - Objects
- SAP ABAP - Object Orientation
- SAP ABAP - Deleting Internal Tables
- SAP ABAP - Reading Internal Tables
- SAP ABAP - Copying Internal Tables
- ABAP - Populating Internal Tables
- SAP ABAP - Creating Internal Tables
- SAP ABAP - Internal Tables
- SAP ABAP - Native SQL Overview
- SAP ABAP - Open SQL Overview
- SAP ABAP - Include Programs
- SAP ABAP - Function Modules
- SAP ABAP - Macros
- SAP ABAP - Subroutines
- SAP ABAP - Modularization
- SAP ABAP - Lock Objects
- SAP ABAP - Search Help
- SAP ABAP - Views
- SAP ABAP - Structures
- SAP ABAP - Tables
- SAP ABAP - Data Elements
- SAP ABAP - Domains
- SAP ABAP - Dictionary
- SAP ABAP - Exception Handling
- SAP ABAP - Formatting Data
- SAP ABAP - Date & Time
- SAP ABAP - Strings
- SAP ABAP - Decisions
- SAP ABAP - Loop Control
- SAP ABAP - Operators
- SAP ABAP - Constants & Literals
- SAP ABAP - Variables
- SAP ABAP - Data Types
- SAP ABAP - Basic Syntax
- SAP ABAP - Screen Navigation
- SAP ABAP - Environment
- SAP ABAP - Overview
- SAP ABAP - Home
SAP ABAP Useful Resources
- SAP ABAP - Discussion
- SAP ABAP - Useful Resources
- SAP ABAP - Quick Guide
- SAP ABAP - Questions Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
SAP ABAP - Report Programming
A report is a presentation of data in an organized structure. Many database management systems include a report writer that enables you to design and generate reports. SAP apppcations support report creation.
A classical report is created by using the output data in the WRITE statement inside a loop. They do not contain any sub-reports. SAP also provides some standard reports such as RSCLTCOP that is used to copy tables across cpents and RSPARAM that is used to display instance parameters.
These reports consist of only one screen as an output. We can use various events such as INITIALIZATON & TOP-OF-PAGE to create a classical report, and each event has its own importance during the creation of a classical report. Each of these events is associated to a specific user action and is triggered only when the user performs that action.
Following is a table describing the events and descriptions −
S.No. | Event & Description |
---|---|
1 | INITIALIZATON Triggered before displaying the selection screen. |
2 | AT SELECTION-SCREEN Triggered after processing of the user input on the selection screen. This event verifies the user input prior to the execution of a program. After processing the user input, the selection screen remains in the active mode. |
3 | START-OF-SELECTION Triggered only after the processing of the selection screen is over; that is, when the user cpcks the Execute icon on the selection screen. |
4 | END-OF-SELECTION Triggered after the last statement in the START-OF-SELECTON event is executed. |
5 | TOP-OF-PAGE Triggered by the first WRITE statement to display the data on a new page. |
6 | END-OF-PAGE Triggered to display the text at the end of a page in a report. Note, that this event is the last event while creating a report, and should be combined with the LINE-COUNT clause of the REPORT statement. |
Example
Let s create a classical report. We will display the information stored in the standard database MARA (contains general material data) by using a sequence of statements in ABAP editor.
REPORT ZREPORT2 LINE-SIZE 75 LINE-COUNT 30(3) NO STANDARD PAGE HEADING. Tables: MARA. TYPES: Begin of itab, MATNR TYPE MARA-MATNR, MBRSH TYPE MARA-MBRSH, MEINS TYPE MARA-MEINS, MTART TYPE MARA-MTART, End of itab. DATA: wa_ma TYPE itab, it_ma TYPE STANDARD TABLE OF itab. SELECT-OPTIONS: MATS FOR MARA-MATNR OBLIGATORY. INITIALIZATION. MATS-LOW = 1 . MATS-HIGH = 500 . APPEND MATS. AT SELECTION-SCREEN. . IF MATS-LOW = . MESSAGE I000(ZKMESSAGE). ELSEIF MATS-HIGH = . MESSAGE I001(ZKMESSAGE). ENDIF. TOP-OF-PAGE. WRITE:/ CLASSICAL REPORT CONTAINING GENERAL MATERIAL DATA FROM THE TABLE MARA COLOR 7. ULINE. WRITE:/ MATERIAL COLOR 1, 24 INDUSTRY COLOR 2, 38 UNITS COLOR 3, 53 MATERIAL TYPE COLOR 4. ULINE. END-OF-PAGE. START-OF-SELECTION. SELECT MATNR MBRSH MEINS MTART FROM MARA INTO TABLE it_ma WHERE MATNR IN MATS. LOOP AT it_ma into wa_ma. WRITE:/ wa_ma-MATNR, 25 wa_ma-MBRSH, 40 wa_ma-MEINS, 55 wa_ma-MTART. ENDLOOP. END-OF-SELECTION. ULINE. WRITE:/ CLASSICAL REPORT HAS BEEN CREATED COLOR 7. ULINE. SKIP.
The above code produces the following output containing the general material data from the standard table MARA −
Advertisements