All About ABAP Report Programming

SAP-ABAP supports two types of Programs -  Report Programs & Dialog Programs. Report Programs are used when large amounts of data needs to be displayed

In this tutorial you will learn:

Purpose/Use of Report Programs

Important Points to Note About Report Program

  • Report Programs are always Executable Programs. Program Type is always 1.
  • Every Report program corresponds to a particular Application Type i.e. either with Sales & Distribution, FI - CO etc. It can also be Cross Application i.e. type '*'.
  • Report Programming is an Event-driven programming.
  • The first line of a report program is always Report <report-name>.
  • To suppress the list heading or the name of the program the addition No Standard Page Heading is used.
  • The line size for a particular report can be set by using the addition line-size <size>.
  • The line count for a particular page can be set by using the addition line-count n(n1). N is the number of lines for the page and N1 is the number of lines reserved for the page footer.
  • To display any information or error message we add a message class to the program using the addition: Message-id <message class name>. Message classes are maintained in SE91.
Therefore an ideal report program should start with:
Report <report name> no standard page heading

line-size <size>

line-count <n(n1)>

message-id <message class>.

Selection Screen

"Selection screen"  is the screen where one specifies the input values for which the program should run.

The selection screen is normally generated from the

  1. Parameters
  2. Select-Options

Syntax

Selection-screen begin of screen <screen #>
selection-screen begin of block <#>  with frame title <text>
.........
.........
selection-screen end of block <#>
selection-screen end of screen <screen #>

Parameters

Parameters help one to do dynamic selection. They can accommodate only one value for one cycle of execution of the program.

Syntax

Defining parameters as a data type

Parameters p_id(30) type c.

Defining parameters like a table field.

Parameter p_id like <table name>-<field name>.

Parameters can be Checkboxes as well as Radiobuttons.

Parameters p_id as checkbox.Parameters p_id1 radiobutton group <group name>.
Parameters p_id2  radiobutton group <group name>.

Parameters can be listbox.

Parameter p_id like <table name>-<field name> as listbox

Select Options

A Select-Option is used to input a range of values or a set of values to a program

Syntax

select-options s_vbeln for vbak-vbeln.

Formatting the report

ABAP allows the reports to be formatted as the user wants it to be. For example, "Alternate Lines" must appear in different colors and the "Totals" line should appear in Yellow.

Syntax

Format Color n

Format Color n Intensified On

n may correspond to various numbers

Please note that there are other additions along with format as well

FORMAT COLOR OFF INTENSIFIED OFF INVERSE OFF HOTSPOT OFF INPUT OFF

Interactive Report Programming

Some commands used for interactive programming
Hotspot
If one drags the mouse over the data displayed in the report the cursor changes to a Hand with an Outstretched Index finger. An hotspot can be achieved using the FORMAT statement.

Syntax:      Format Hotspot On (Off).

Hide
This command helps you to store the field names based on which one will be doing further processing to get a detailed list. It is written directly after the WRITE statement for a field. When a row is selected the values get automatically filled in the variables for further use.

Syntax:     Hide <field-name>.

Logical Databases

Advantages of a logical database over normal Select queries.

  1. It offers check conditions to see whether the input is correct, complete and plausible
  2. It contains central authorization checks for database access
  3. Enhancements such as improvement in performance immediately apply to all reports which use logical database.
Note: Due to the complexities involved, logical databases are not used in most of the cases

 

YOU MIGHT LIKE: