0% found this document useful (0 votes)
31 views13 pages

SAP ABAP Classical Reports

Uploaded by

gshivachary2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views13 pages

SAP ABAP Classical Reports

Uploaded by

gshivachary2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

SAP ABAP Classical Reports

Contributed by
Sana Shaikh
Under the guidance of TagSkills

SAP ABAP is a programming language used for developing applications within


the SAP environment. One of the important components of SAP ABAP is the
classical report. In this article, we will discuss what a classical report is, its
events, how it is created.

SAP ABAP Classical Reports are the most basic report that contain both
selection screen and an output screen. Classical reports are executed based on
events, and not executed on a line-by-line basis. Classical reports are non-
interactive reports. Basically, they consist of one program that creates a single
list.

The following SAP training tutorials guides various events in classical reports,
provide the syntax for each and then present a simple programming example of
a Classical Report.
Events in Classical Reports.
The following are the list of Events in Classical Reports.
1. Load-of-program: The Load-of-program event loads the program into
memory for execution. Always, Load-of-program is the first event in execution
sequence.
2. Initialization: Initialization is an event that is used for initialize variables,
screen values and other default actions.
3. At Selection-Screen output: One of the selection screen events is used to
manipulate dynamic selection-screen changes.
4. At Selection-Screen on field: It is used to validates the screen input
parameter.
5. At Selection-Screen on value request: This selection screen event allows
for a value help or field help for an input field.
6. At Selection-Screen on help request: This selection screen event enables
function key F1 help for a input field.
7. At Selection-Screen: Selection screen validates various input fields.

Classical Report displaying data of two tables.


Step 1: Go to SE38 Tcode. Type the program name and choose Source Code
from Sub objects and Click on Create button.

6360959192 www.tagskills.com [email protected]


Step 2: Write the Title, select ‘Executable Program’ type in Attributes and then
click on save.

6360959192 www.tagskills.com [email protected]


Now ABAP Editor will open, here write the code given below for report.

Step1: Type Declaration

6360959192 www.tagskills.com [email protected]


Step 2: Data Declarations.

Step 3: Header Information or column names

Step 4: Fetching the data through query

6360959192 www.tagskills.com [email protected]


6360959192 www.tagskills.com [email protected]
Step 5 : Displaying the data:

Output:

6360959192 www.tagskills.com [email protected]


Classical Report of Single Table:

The following program is displaying some useful information of material from


table MARA based on the material number by a select option in the selection
screen.

Here we have created a custom structure of the internal table named it_mara. This
structure ty_mara contains Material No, Creation Date, Name, Material Type and
Group. Hence output will have only these fields. We have declared an work area
wa_mara for internal table. Here the internal table is of standard table type.

Now under INITIALIZATION event we have initialized the Program name, date
and user name which are to be displayed at the Top of page. TOP OF PAGE is
another event where we are declaring the select option s_matnr in a selection
screen for input of material no.

Next we are declaring the START-OF-SELECTION event under which we


mention a subroutine get_mara. Subroutine is declared by the key word perform.
Under this perform we select required fields from MARA into internal table

6360959192 www.tagskills.com [email protected]


it_mara based on the where condition. So after getting proper data from the
MARA table we shall prepare the output in the subroutine of get_output.

Now on the next event END-OF-SELECTION we are declaring a subroutine


get_output and inside there we are looping the internal table it_mara into
wa_mara. Hence we fetch the data from internal table to the work area and then
display it with simple write statement. Since this is a loop, so one by one record
will be fetched into work area and then it will be displayed.

Now we want to display the name of the fields heading at the beginning. To do
this we call control break statement at first & endat inside the loop. At first
statement will be triggered at the first time of the loop. Similarly when the listing
will be completed then At Last - endat statement will be triggered to display
ending of report message.

Next we raise the event TOP-OF-PAGE which is used to display the top message.
On the top we can write program name, user name, date etc.

6360959192 www.tagskills.com [email protected]


6360959192 www.tagskills.com [email protected]
6360959192 www.tagskills.com [email protected]
6360959192 www.tagskills.com [email protected]
6360959192 www.tagskills.com [email protected]
TagSkills
Disclaimer -
© Copyright TagSkills. The copyright in this work is vested in TagSkills.
Please note and abide by copyright laws. This presentation is for
educational purposes only, all logos, photos, and information, etc
used in this Presentation is the property of TagSkills. SAP is a
registered trademark of SAP AG in Germany and many other
countries. We are NOT ASSOCIATED with SAP.

6360959192 www.tagskills.com [email protected]

You might also like