SAP ABAP Interview Questions (21 - 30)

21. What is MOVE-CORRESPONDING?

MOVE-CORRESPONDING is used to copy data between structures/internal tables based on matching field names automatically. It avoids writing field-by-field assignments and improves readability.

* MOVE CORRESPONDING example
TYPES: BEGIN OF ty_a,
         id   TYPE i,
         name TYPE string,
       END OF ty_a.

TYPES: BEGIN OF ty_b,
         id   TYPE i,
         name TYPE string,
         city TYPE string,
       END OF ty_b.

DATA: wa_a TYPE ty_a,
      wa_b TYPE ty_b.

wa_a-id = 1.
wa_a-name = 'Pawan'.

MOVE-CORRESPONDING wa_a TO wa_b.

WRITE: wa_b-id, wa_b-name.  "city remains empty

Only fields with same names (id, name) are copied automatically.

22. What is the difference between Classical Report and Interactive Report?

A classical report only shows one main output list to the user. An interactive report lets the user click on a row or value to see more detailed information.

Example

Classical → Simple employee list report.
Interactive → Click employee → shows detailed employee info.

23. What are Events in ABAP report?

Events in ABAP reports are predefined execution steps that control the flow of a program. They tell when a particular block of code should run during report execution.

  • INITIALIZATION - Runs when program loads (set default values).
  • AT SELECTION-SCREEN - Handles user input/validation.
  • START-OF-SELECTION - Main logic starts here.
  • END-OF-SELECTION - Final processing/output.

24. What is AT SELECTION-SCREEN event?

AT SELECTION-SCREEN is an event used to validate user input on the selection screen before execution. It triggers when the user presses Enter/Execute, allowing you to show errors or warnings.

* AT SELECTION-SCREEN example:
PARAMETERS: p_age TYPE i.

AT SELECTION-SCREEN.
  IF p_age < 18.
    MESSAGE 'Age must be >= 18' TYPE 'E'.
  ENDIF.

If validation fails, program stops and shows error on screen.

25. What is TOP-OF-PAGE?

TOP-OF-PAGE is an event used to display header information at the top of each page in a report. It is mainly used for titles, dates, and column headings.

* TOP-OF-PAGE example:
TOP-OF-PAGE.
  WRITE: / 'Employee Report',
         / 'Date:', sy-datum.

START-OF-SELECTION.
  WRITE: / 'Data line 1',
         / 'Data line 2'.

The header is printed automatically at the top of every page.

26. What is the difference between PARAMETERS and SELECT-OPTIONS?

PARAMETERS is used for a single input value from the user. SELECT-OPTIONS is used when the user should be able to enter a range, multiple values, or exclusions.

* Examples:
PARAMETERS: p_matnr TYPE mara-matnr.
SELECT-OPTIONS: s_matnr FOR mara-matnr.

27. What is Logical Database (LDB)?

Logical Database (LDB) in SAP ABAP is a predefined data retrieval program that provides standard selection screens and hierarchical data access. It helps you fetch related data easily without writing complex SELECT queries. It was more common in older SAP reporting, but today developers often prefer direct Open SQL for more control.

28. What is SUBMIT statement?

The SUBMIT statement is used to call and execute another report program from your current program. We can pass values to that report and even control whether the output is shown or returned.

* SUBMIT example:
SUBMIT zsales_report
  WITH p_vkorg = '1000'
  AND RETURN.

The header is printed automatically at the top of every page.

29. What is the difference between SUBMIT and CALL TRANSACTION?

The SUBMIT statement is used to call another report program from the current program. CALL TRANSACTION is used to call a transaction code (like SE38) from the current program.

* SUBMIT example:
SUBMIT z_emp_report WITH p_id = 100 AND RETURN.
* CALL TRANSACTION example:
CALL TRANSACTION 'SE38'.

30. What is Variant in reports?

A variant is a saved set of input values for a report selection screen. It helps users run the same report again without typing the same values every time.

Example: Save a variant with p_date = today and company = 1000, then reuse it anytime while executing the report.