Report Programming

How can you format the data before write statement in the report?

The reports output can be formatted by using the loop event like below -

  • .at first
  • .at new
  • .at last

Mention what is ALV programming in ABAP? When is this grid used in ABAP?

ALV stands for Application List Viewer. To enhance the report output, SAP provides a set of ALV function modules. The ALV function modules improve the functionality and readability of any report output. It is an efficient tool used for arranging the columns in a report output.

What is pretty printer?
What is the use of 'pretty printer'?
Why is pretty printer user in ABAP?
What need does pretty printer user fulfill in ABAP?
Why you use Pretty Printer?

Pretty printer is used to format the ABAP code.

Explain the difference between dialog program and a report?
Differentiate between report and dialog program?

A report is an executable program and can execute directly without any support. Dialog is a module pool program that executed via a transaction only. Dialog programming is used for customizations of screens.

What are the different types of ABAP reports in SAP?
Types of ABAP reports in SAP?

There are 7 report types in SAP ABAP and those are -

  • Executable program
  • Interface pool
  • Function groups
  • Include
  • Class pool
  • Module pool
  • Subroutine pool

These reports are available in reports attributes screen.

Define ALV programming in ABAP.
Define ALV Programming in SAP ABAP. When is it used?

ALV or Application List Viewer enhances the reports output in SAP systems. This type of programming is achieved to improve the functionality, readability, and modularity of report outputs. ALV programming restores the process of arranging columns in a report output.

What are the functions of message command available in a report? Mention its types.
What is the message command used for in a report?

Messages are used to describe what is happening in the program execution to the programmer or user. Messages represents with a three-digit number. Messages range starts from 000 to 999.
Messages are basically six types. Those are -

A Abend The message appears in a separate dialog box and the program execution get terminated.
When the user has confirmed the message, control returns to the next-highest area menu.
E Error An error dialog appears, or the program terminates depending on the program condition.
I Information The message appears in a separate dialog box.
Once the user has confirmed the message, the program execution continues from the next statement coded immediately after the MESSAGE statement.
S Success The total program execution continues normally, and the message is displayed in the status bar of the screen.
W Warning An error message is displayed in the status bar of the screen and the program execution terminates.
X Exit or Abort No message is displayed.
The program terminates with a short dump.
Program terminations with a short dump normally only occur when a runtime error occurs.

Difference between Sap Script and Report?

SAP Script is the integrated text management system of the SAP R/3 System. SAP Scripts are two types -

  • PC Editor
  • Line Editor

Reports are the way to display data fetched from database table onto screen or directly output it to a printer. Report are two types -

  • Classical
  • Interactive

What are the Events used in ABAP in the order of execution?

The Events used in ABAP are -

  • AT PF<NN>
  • GET
  • AT User Command

Explain what are interactive reports?

An output list that displays the basic details and allow user to interact, so that a new list is populated based on user-selection. With interactive list, the user can actively control data retrieval and display during the session.

What is an Interactive Report? What is the obvious difference of such report compared with classical type reports?

An output list that displays the basic details and allow user to interact, so that a new list is populated based on user-selection. With interactive list, the user can actively control data retrieval and display during the session.
The differences between the interactive report and classical type reports -

  • The list produced by classical report does not allow user to interact with the system whereas the list produced by interactive report allows the user to interact with the system.
  • Once a classical report, executed user loses control whereas Interactive, user has control.
  • In classical report, drilling is not possible whereas in interactive, drilling is possible.

What are the commands used for Interactive Reports?

Top-of-Page during line-selection.

What are the Events used in Interactive Reports?
What are the events in interactive reporting?

There are three events of Interactive Reports -

  • At PF(nn)
  • At line-selection
  • At user-command

How do you move on to the next screen in Interactive Reporting?

Write code of the following -

  • Top-of-Page during line-selection
  • At line-selection

What are differences between at SELECTION-SCREEN and at SELECTION-SCREEN output?
What is the difference between AT SELECTION-SCREEN and AT SELECTION-SCREEN OUTPUT?

AT SELECTION-SCREEN event is triggered in the PAI of the selection screen once the ABAP runtime environment has passed all the input data from the selection screen to the ABAP program.
AT SELECTION-SCREEN OUTPUT event block allows you to modify the selection screen directly before it is displayed.

Which event is executed first at-selection-screen or at-selection-screen-output in sap ABAP?

Before screen display - AT SELECTION-SCREEN OUTPUT will trigger first.
After screen is displayed - AT SELECTION-SCREEN will trigger first.

What is the inside concept in Select-options?

Select-options are displayed on the selection screen for the user to enter values.
Different Properties of Select-options -

  • Visible Length
  • Matchcode Object
  • Memory ID
  • Lowercase
  • Obligatory
  • No Display
  • Modify ID

What are the page windows? How many main windows will be there in A page window?

In Page Window, we define the margins for left, width, upper and height for the layout of Header, Logo, Main, & Footer.

What is a drill down report?

Drill down report is an Interactive report where the user can get more relevant data by selecting explicitly.

What is the difference between interactive and drill down reports?

  • ABAP/4 provides some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COMMAND (pressing a button). We can use these events to move through layers of information about individual items in a list.
  • Drill down report is nothing but interactive report...drilldown means above paragraph only.

What is ALV programming in ABAP? When is this grid used in ABAP?

ALV is Application List viewer. Sap provides a set of ALV (ABAP LIST VIEWER) function modules that can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length. In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output. The report output can contain up to 90 columns in the display with the wide array of display options.

What do you understand by ALV programming in ABAP?

In ABAP, ALV means Application List Viewer.

What is ALV programming used for?

Some of the functions of the ALV are used to enhance the quality of the report. It also helps in making the report easier to read and understand. Assets like rows and columns can also be inserted with the help of ALV.

Can we display multiple ALV`s in the same screen without using container?

We can display multiple ALV`s in the same screen by using blocked list ALV.

What is the event that will be triggered first in an ABAP report?

Initialization event is triggered first if user executes an ABAP report. However, if the program is of type 1, M, F, or S; then LOAD-OF-PROGRAM is triggered first and then INITIALIZATION event.

What are the differences between simple and interactive ABAP reports?

A simple ABAP report allows the user to interact with the whole business-result data. In case of interactive reports, user can interact with specific result data at a time.

How many lists can be displayed through an interactive report?

Maximum 21 lists can be displayed (1 basic list 20 secondary lists).

You are running a report. It is taking long time for execution. What steps will you do to reduce the execution time?

  • Run time analysis
  • System Trace
  • Extended code check
  • Performance tuning

What is the difference between report and script?

Script is a static form that is used to print company forms like Sales Order, Purchase order etc.
Report is an executable program that can be static or interactive.

In interactive report if user 19 times double clicked, again he wants to main screen. how can do this?

Leave to screen 0. 

When top of the page event is triggered?

After executing first write statement in start-of-selection event.

I have 1 basic list and 15 secondary list in interactive report. If I am in 9th list, how can I come directly to the basic list?

System variable SY-LSIND stores the list number, by using this we can go to basic list.

How do write an ALV program using VBRK-header, VBRP-item?

Billing document

  1. Header -VBRK
  2. Item- VBRP

Input: sales org, billing date, billing document.
Output: invoice no, invoice date, billing type, sales org, invoice quantity, selling price, billing time.


START-OF-SELECTION & END-OF-SELECTION contains the code block that process the data of the logical database.
For example, the code below reads table STDUDENT and writes the logical database information to internal table ISTUDENT.


When do we use END-OF-SELECTION?
How can END-OF-SELECTION be used?
When do we use the END-OF-SELECTION?

We mostly use END-OF-SELECTION for the summary/results of reports.
END-OF-SELECTION is used mostly when logical database used in the report creation and triggered when all selection gets completed from the database.

The END-OF-SELECTION event is triggered in executable programs once the logical database has finished all data reading and before the list processor is started.
END-OF-SELECTION describes the server that all the database reading is completed, and no further reading is going to take place.
Once the system has read and processed all database tables of a logical database, use the keyword END-OF-SELECTION to define a processing block.

If any program with a logical database reading only requires the implementation of event block END-OF-SELECTION. Otherwise, there is no need to implement the event block END-OF-SELECTION.