0% found this document useful (0 votes)
334 views24 pages

Sap Abap Reports Questions

Hb

Uploaded by

Om Sonawane
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)
334 views24 pages

Sap Abap Reports Questions

Hb

Uploaded by

Om Sonawane
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/ 24

Sap

Abap
Reports
Ques ons
Sonu Jangir Abap Developer

Prepared By Sonu Jangir +91 9729751248


[email protected]
What is a report?

Report is a program used to fetch data from the database tables and
display it on the screen. It has 2 screens selec on screen(op onal)
and list or output screen.

When the TOP-OF-PAGE event does get triggered?

TOP-OF-PAGE event will be triggered when the first ULINE, WRITE or


SKIP statement occurs in a program.

What is the difference between SKIP and RESERVE?

SKIP provides empty space between lines, while RESERVE executes a


page break on the current page if the number of lines between
current line and the page footer is less than the number specified in
RESERVE statement.

What is the difference between SKIP and NEW-LINE?

SKIP generates a blank line, while the NEW-LINE causes the control to
move to next line.

What is hotspot?

Hotspot is an area on the list where the mouse pointer turns into an
upright hand symbol. A single click on the hotspot does the same
thing as a double-click.

What does HIDE statement do?

Prepared By Sonu Jangir +91 9729751248


[email protected]
The HIDE statement hides the contents of the line along with the line
numbers in a system defined HIDE area. This is used in interac ve
repor ng.

What are the events in classical reports?

INITIALIZATION
AT SELECTION-SCREEN
START-OF-SELECTION
END-OF-SELECTION
TOP-OF-PAGE
END-OF-PAGE

How many detail lists can be created in interac ve repor ng?

20

What is the name of the system variable that holds the contents of
the selected line in interac ve repor ng?

SY-LISEL

Can we set page headers to details lists?

Yes. Use TOP-OF-PAGE DURING LINE-SELECTION event.

What Is Alv?

ALV (ABAP LIST VIEWER) Sap provides a set ofALV (ABAP LIST
VIEWER) func on modules, which can be put into use to embellish
the output of a report. This set of ALV func ons is used to enhance
the readability and func onality of any report output.
Prepared By Sonu Jangir +91 9729751248
[email protected]
Or
ALV stands for ABAP List Viewer. ALV gives us a standard List format
and user interface to all our ABAP reports. ALV is created by a set of
standard func on modules provided by SAP.

What Are The Uses Of Alv Reports?

Sor ng of records
Filtering of records
Totals and Sub-totals
Download the report output to Excel/HTML
Changing the order of the columns in the report
Hide the unwanted columns from the report

What Is Field Catalog In Sap Alv?

We have the following three ways to build a field catalog.


Automa cally through a Data Dic onary structure.
Manually in ABAP program.
Semi-automa cally by combining the above two procedures.
Declare an internal table of type SLIS_T_FIELDCAT_ALV.
Call func on module REUSE_ALV_FIELDCATALOG_MERGE.

What Is Slis In Alv And Standard Type Tables Of It?

SLIS is the type library for ALV grid.


If you'll use the ALV you have to add TYPE-POOLS : SLIS. command
at the beginning of your code.
SLIS_LAYOUT_ALV,
SLIS_T_FIELDCAT_ALV
SLIS_T_LISTHEADER,
SLIS_T_EVENT,
Prepared By Sonu Jangir +91 9729751248
[email protected]
SLIS_SELFIELD.

How Do You Define Default Variant For Alv?

The user can programma cally set the ini al (default) variant for list
display.
The default variant can be found using the func on module
'REUSE_ALV_VARIANT_DEFAULT_GET'.
What Is The Events Table In Alv?

A list of possible events is populated into an event table (I_EVENTS)


when this table is passed from the func on module
REUSE_ALV_EVENT_NAMES_GET. The return table from this func on
module contains all the possible events.
What Are Layout Parameters Op ons Of Alv?
Display op ons:
 Excep ons

 Totals

 Interac on

 Detail screen

 Display variants (only for hierarchical-sequen al lists)

 Color

 Other

What Is Sort Internal Table Op ons In Alv?


This internal table has the following fields:

 Sops: Sort sequence.


 Fieldname: Internal output table field name.
 Tab name : Only relevant for hierarchical-sequen al lists. Name
of the internal output table.
 Up: 'X' = sort in ascending order.
Prepared By Sonu Jangir +91 9729751248
[email protected]
Down: 'X' = sort in descending order.
 Sub tot : 'X' = subtotal at group value change.

 Group: '* ' = new page at group value change ,'UL' = underline

at group value change.


What Is The Main Func on Module Of Alv Report?

REUSE_ALV_GRID_DISPLAY

What Are The Export Parameters Of Alv Reports Func on


Modules?

Ans: E_EXIT_CAUSED_BY_CALLER: Delete list in


CALLBACK_USER_COMMAND
ES_EXIT_CAUSED_BY_USER: How the user le the list Tables
T_OUTTAB: Table with data to be displayed ---mandatory

What Is A Report?

There are 2 type of reports:


1. Interac ve report
2. Classic reports
In classic reports, we can see the output in single list where as in
interac ve reports we can see the output in mul ple lists.

What Are Classical Reports?

These are the most simple reports. Programmers learn this one first.
It is just an output of data using the Write statement inside a loop.
Classical reports are normal reports. These reports are not having any
sub reports. IT IS HAVING ONLY ONE SCREEN/LIST FOR OUTPUT.

Events In Classical Reports:


Prepared By Sonu Jangir +91 9729751248
[email protected]
INTIALIZATION: This event triggers before selec on screen display.
AT-SELECTION-SCREEN: This event triggers a er processing user
input s ll selec on screen is in ac ve mode.
START OF SELECTION: Start of selec on screen triggers a er
processing selec on screen.
END-OF-SELECTION: It is for Logical Database Repor ng.

What Are The Interac ve Reports?


The user can Interact with the report. We can have a drill down into
the report data.
We can have a basic list (number starts from 0) and 20 secondary lists
(1 to 21).

Events associated with Interac ve Reports are:

AT LINE-SELECTION
AT USER-COMMAND
AT PF<key>
TOP-OF-PAGE DURING LINE-SELECTION.
HIDE statement holds the data to be displayed in the secondary list.
sy-lisel : contains data of the selected line.
sy-lsind : contains the level of report (from 0 to 21)

Interac ve Report Events:

AT LINE-SELECTION : This Event triggers when we double click a line


on the list, when the event is triggered a new sub list is going to be
generated. Under this event what ever the statements that are been
return will be displayed on newly generated sub list.
AT PFn: For predefined func on keys...
Prepared By Sonu Jangir +91 9729751248
[email protected]
AT USER-COMMAND : It provides user func ons keys.

TOP-OF-PAGE DURING LINE-SELECTION : Top of page event for


secondary list.

How Many Types Of Tables Are There In Data Dic onary And What
They?
 Transparent table

 CLUSTER Cluster table

 POOL Pooled table

What Are Pricing Tables?

Pricing Tables starts with A* like A001, A002, A900 like that.
KONH – Condi on Header
KONP – Condi on Detail

What Is A Table Maintenance Generator?

To allow users to maintain table using SM30 transac on you use


Table Maintenance generator.

What Is The Difference Between Client Dependent And


Independent Tables?

If you have MANDT as the first field that is Client Dependant table
otherwise it is not. Usually most of the tables are client dependent.
Only few like RFC Connec ons table (RFCDES), Batch Jobs (TBTCO and
TBTCP) are not client dependant.

Prepared By Sonu Jangir +91 9729751248


[email protected]
What Is The Difference Between At Selec on Screen And At
Selec on Screen Output?

AT SELECTION-SCREEN OUTPUT is like Process Before Output Event.


This would get triggered before screen is displayed. This can be used
to make fields invisible/visible based on selec on.
AT SELECTION-SCREEN: This would be triggered if you hit anything
(Enter, Drop-Down, Help, Execute) a er the selec on screen is
displayed.
What Is The Difference Between Clear, Refresh?
Ans: CLEAR: It clears any field, structure or Header line of internal
table.
REFRESH: Deletes all entries of internal table.
In Alv's How Would You Get Default Values In The Selec on
Screen?

Create a variant in the ALV Report with whatever columns you would
like to see and set sort criteria and column widths and save as a
default variant.
You could get the default variant by calling FM
REUSE_ALV_VARIANT_DEFAULT_GET

What Are The Steps To Create Custom Table?

Create all the Domains and Data elements as needed using Txn SE11.
Start crea ng the table using Tcode SE11.
Maintain Delivery Class (A-Applica on Table, C-Customizing, etc)
Enter all the fields (MANDT must be the first field) and appropriate
data elements or Built in Types for each field.
Make sure you select the Primary Key for this table.
Maintain the Technical Se ngs (Data class, Size, Buffering info)
Create Secondary indexes as needed
Prepared By Sonu Jangir +91 9729751248
[email protected]
Ac vate the Table

How To Set Hotspot In Alv Reports For A Field?

In the Field Catalog table, you set the HOTSPOT property of the field
to X.

What Is Use Of Reuse_alv_fieldcatalog_merge?

Using this func on module, you can get the Field catalog for a given
Internal table or DD Structure. Once you get the Field catalog, you
could change the proper es of each field.
What Is Significance Of Hide?

In Interac ve reports, HIDE statement stores the value of that field


for that line. If the user places the cursor on a line and click on
something those values are automa cally populated to that hidden
fields.

What Is The Difference Between Select Single And Select Up To One


Row?

SELECT SINGLE can be used if you know the full key to select a record.
If you do not have the full Key to select and you are interested in one
single row, you could use SELECT UPTO 1 ROWS. If you use a SELECT
SINGLE without a full key, you would get a warning message in
Extended Program checks.
If you have the full Key use SELECT SINGLE
If you do not have the full Key to select and you are interested in one
single row, you could use SELECT UPTO 1 ROWS..

What Is The Secondary Index?


Prepared By Sonu Jangir +91 9729751248
[email protected]
There is an Index created by default for the Primary Key of the table
and that is called Primary Index. If you create, any other index that is
called Secondary Index for that table. Secondary Indexes are created
to improve the performance of SELECT statements.

How To Create Secondary Index?

Using SE11, Enter the table name and click on Change.


Click on Indexes and select fields and create a secondary index. Note:
Always try to include MANDT as the first field unless you have a
reason..
How Do You Modify A Table?

You can modify a record using MODIFY statement or UPDATE


Statement.
What Is An Abap Memory And Sap Memory And How To Use
Them?

ABAP memory is a memory area that all ABAP programs within the
same internal session can access using the EXPORT and IMPORT
statements.
SAP memory is a memory area to which all main sessions within a
SAPgui have access. You can use SAP memory either to pass data
from one program to another within a session, or to pass data from
one session to another. Applica on programs that use SAP memory
must do so using SPA/GPA parameters (also known as SET/GET
parameters).

When The Top-of-page Event Does Get Triggered?

Prepared By Sonu Jangir +91 9729751248


[email protected]
TOP-OF-PAGE event will be triggered when the first ULINE, WRITE or
SKIP statement occurs in a program.

What Is The Difference Between Skip And Reserve?

SKIP provides empty space between lines, while RESERVE executes a


page break on the current page if the number of lines between
current line and the page footer is less than the number specified in
RESERVE statement.

What Is The Difference Between Skip And New-line?

SKIP generates a blank line, while the NEW-LINE causes the control to
move to next line.

Can We Set Page Headers To Details Lists?

Yes. Use TOP-OF-PAGE DURING LINE-SELECTION event.

What Are Oss Notes?

SAP provides support in the form of Notes also and this is called OSS.
Can check the link Sree provided.
Just for an example if you face any error in your system. Then there is
error number associated with the error. Then you can search for the
OSS not for the error number, and the note will give you possible
solu on to your problem.

What Is The Command To Be Used To Transfer The Data From One


Internal Table To Another Internal?

Move itab1 to itab2


Prepared By Sonu Jangir +91 9729751248
[email protected]
We can use APPEND for copying data from one ITAB to another ITAB
by keeping in a loop. But it is not efficient. Instead we can use as
follows:
ITAB1[]=ITAB2[].

How Can Validate Input Values In Selec on Screen And Which Event
Was Fired?

At selec on-screen is an event, which is used to validate the


selec on screen input fields, if you want to validate the par cular
input field we use at selec on-screen on event.
AT SELECTION-SCREEN ON event is used to validate input.
What Is The Difference Between Data Element And Domain?

Data element is the collec on of domain with short descrip on,


whereas domain is collec on of datatype and length.
Domain contains only technical a ributes (data type , size) where as
Data Element contains Technical a ribute as well as Seman c
a ributes(Field descrip on).

What Is The Difference Between Internal Table With Header Line


And Without Header Line?

Internal table with header line is nothing but work area name as well
as internal table name is same, whereas internal table without
header line is nothing but work area name as well as internal table
name is different.
FOR INTERNAL TABLE WITH HEADER we need not create work area.
But not advisable because the user may get confused what is work
area and what is internal table since they both will be having same
names.

Prepared By Sonu Jangir +91 9729751248


[email protected]
Which Is The First Event That Is Triggered In A Report?

Load of program is the first triggering event in the classical reports,


where as abaper point of view ini aliza on is the first triggering
event.
LOAD-OF-PROGRAM which gets triggered internally in the SAP
system, then the event INITIALIZATION gets trigger.

What Is Binary Search?

Binary search is a searching algorithm in which the whole data in


spi ed into two parts and searching is started from one of the part.
In normal search data is searched linearly from top to bo om which
is less efficient than binary search.
Binary search is used to get the more data from internal table instead
of linear search ,and binary search is the faster and efficient .

While Prin ng, 10 Columns Are Prin ng In First Page And The Next
4 Cols In Next Page, How Do U Resolve This To Accommodate All
The 14 Columns In A Single Page?

ot line size .. increase line-count


line-size means width of line
line-count means no. of lines per page.

What Events Are Mandatory In Reports?

Report dont need any event to execute the output.It we we put start-
of-selec on there is no compulsory to use end-of-selec on. End-of-
selec on is used when we want to execute some output even when
some excep on occurs to skip start-of-selec on.
Prepared By Sonu Jangir +91 9729751248
[email protected]
There is no mandatory event in the report program. however, if we
don't explicitly write any event, system implicitly starts with start of
selec on event.In case of database selec on, it is a good prac ce of
use end-of-selec on event.

What Is The Transac on Code Sm 31?

SM31 is a new version of the t-code SM30.


SM30 - Call view maintenance & views for SAP tables.
SM31 - used for maintenance for SAP tables.

What Are Text Elements?

Text elements makes program easier to maintain program texts in


different languages. These are used for maintaining list headers,
selec on texts in programs.

Explain Check Table And Value Table?

Check table works at table level and value table works at domain
level.
Check table is nothing but master table that u will create with valid
set of values.
Value table it provides the list of values and it will automa cally
proposed as a check table while crea ng foreign key rela onship.

How Many Types Of Standard Internal Tables?

STANDARD TABLE: The key is, by default, set to NON-UNIQUE. You


may not use the UNIQUE addi on.
SORTED TABLE: Unlike standard tables, sorted table have no default
se ng for the uniqueness a ribute. If you do not specify either
Prepared By Sonu Jangir +91 9729751248
[email protected]
UNIQUE or NON-UNIQUE, the system defines a generic table type,
where uniqueness is irrelevant. You can use generic types to specify
the type of generic subrou ne parameters.
HASHED TABLE: Hashed tables have no default se ng. You must use
the UNIQUE addi on with hashed tables. You may not use NON-
UNIQUE.

What Is Refreshing In Internal Table?

'Refresh' is the keyword which clears the contents of an internal table


body.

What Is The Difference Between Collect And Sum?

COLLECT allows you to create unique or summarized datasets. The


system first tries to find a table entry corresponding to the table key.
The key values are taken either from the header line of the internal
table itab, or from the explicitly-specified work area.
If the system finds an entry, the numeric fields that are not part of
the table key (see ABAP number types) are added to the sum total of
the exis ng entries. If it does not find an entry, the system creates a
new entry instead.

What Are The Ways Of Crea ng Tables?

There are two ways to create table


1. Top-down approach
2. Bo om-up approach

What Is The Significance Of A Stacked List?

Prepared By Sonu Jangir +91 9729751248


[email protected]
The secondary list is also called the stacked list and it will be shown
on the en re screen if we don’t write its coordinates of the command
window.

When It’s The Right Time To U lize The Command Get Cursor In
Interac ve Lists?

The command GET CURSOR will be u lized when the hidden


informa on is not enough for tracing the selected line.

How Do We Describe Start –of-selec on And End-of-selec on?

The start and the finish of the main processing logic, which is default
for every ABAP/4 applica on; the statements from START-OF-
SELECTION to END-OF-SELECTION are executed automa cally, there
is no requirement for having END-OF-SELECTION. Every procedural
statement in ABAP applica ons are dependent by default on the
START-OF-SELECTION.

What is the difference between Classical and Interac ve Reports in


SAP ABAP?

Classical reports generate a single output list, while interac ve


reports allow users to interact and navigate to mul ple screens by
clicking on the output.

What are the events used in Classical Reports?

The main events are START-OF-SELECTION, END-OF-SELECTION, and


TOP-OF-PAGE.

What are ALV reports, and why are they used?


Prepared By Sonu Jangir +91 9729751248
[email protected]
ALV (ABAP List Viewer) reports provide be er forma ng, sor ng,
and filtering capabili es compared to classical reports. They are
commonly used for dynamic and user-friendly report layouts.

How do you op mize the performance of a report?

By using techniques such as proper indexing in SELECT statements,


limi ng data retrieval with WHERE clauses, and avoiding nested
loops. Performance analysis tools like ST22, ST05, and run me
analysis are also important.

What are the types of data retrieval methods in reports?

Reports use SELECT queries for database access. There are also
buffering techniques for faster access to frequently used data.

What is the difference between SY-DBCNT and SY-INDEX in report


programs?

SY-DBCNT gives the number of database records processed, while SY-


INDEX represents the loop itera on number in the program.

How do you handle large data volumes in reports?

By using pagina on, limi ng the data fetched using SELECT op ons,
and leveraging parallel processing.

What is the purpose of START-OF-SELECTION event?

Answer: It is triggered a er the selec on screen is processed and


before data retrieval starts.
Prepared By Sonu Jangir +91 9729751248
[email protected]
Can you explain how interac ve repor ng works?

Interac ve reports use event-driven programming. For example, the


AT LINE-SELECTION event is triggered when the user clicks on a line in
the report.

What is the significance of the HIDE statement in interac ve


reports?

The HIDE statement stores field values for later use when the user
interacts with the report (e.g., clicking a line triggers detailed views).

How do you create an ALV report?

Use the func on modules REUSE_ALV_GRID_DISPLAY or


REUSE_ALV_LIST_DISPLAY to display data in an ALV format.

What are Field Symbols, and how are they used in reports?

Field symbols are placeholders for data objects. They point to data
instead of copying it, which op mizes memory usage in reports.

What is a report variant?

A variant saves a set of input values for the selec on screen,


allowing users to run the report with predefined parameters.

How can you improve the readability of report output?


By using ALV grids, proper column headings, sor ng, filtering, and
custom layouts.

Prepared By Sonu Jangir +91 9729751248


[email protected]
What is a Hotspot in an ABAP report?

A hotspot allows for clickable fields in the output list that trigger
addi onal events, such as naviga ng to detailed informa on.

What is the difference between a Batch Input Session and a Report?

A report retrieves and displays data, whereas a batch input session is


used for data entry into the system, o en involving mass updates.

Explain the use of AT USER-COMMAND event in ALV.

It is triggered when a user performs a custom ac on, such as clicking


a bu on in an ALV toolbar, allowing the report to respond
dynamically.

What are the benefits of using Internal Tables in reports?

Internal tables store data fetched from the database temporarily,


enabling data manipula on and dynamic processing in reports.

What are the different types of reports in SAP ABAP?

The main types include Classical Reports, Interac ve Reports, and


ALV (ABAP List Viewer) Reports.

How do you handle errors in reports?

Use MESSAGE statements for error handling and SY-SUBRC for


monitoring the success or failure of opera ons like SELECT.

Explain the use of Parallel Cursor technique in report op miza on.


Prepared By Sonu Jangir +91 9729751248
[email protected]
Parallel Cursor minimizes nested loops when processing internal
tables. It syncs table reads using pointers, reducing the number of
itera ons significantly.

How do you handle large reports and op mize background job


scheduling?

Ensure op mized memory usage by using COMMIT WORK


periodically for large datasets. You can configure reports to output
intermediate results or logs to track progress.

How do you debug performance issues in a report?


Answer: Use transac on codes like ST05 (SQL Trace), SE30 (Run me
Analysis), and SAT (ABAP Trace) to iden fy bo lenecks such as
expensive SQL queries or inefficient loops.

How do you manage data consistency when interac ng with


transac on data in reports?

Implement locking mechanisms (ENQUEUE and DEQUEUE) and


SELECT FOR UPDATE to ensure data consistency. COMMIT WORK
must be used carefully.

What is the purpose of Logical Databases (LDB) in repor ng?

LDBs provide a standardized way to read data from related tables in


a hierarchical structure, used in scenarios with complex data retrieval
logic.

What was the most complex report you’ve worked on, and how did
you approach it?
Prepared By Sonu Jangir +91 9729751248
[email protected]
Provide an example of a report with complex logic, discussing how
you op mized performance, managed data volumes, and ensured
user interac vity.

How do you handle mass data in reports to avoid memory


overflow?

Use internal tables efficiently, apply selec on condi ons, and


consider secondary storage like temporary tables to manage large
data volumes.

How do you ensure scalability and maintainability of reports?

Break large reports into modular sub-programs, use reusable


pa erns such as global classes, and ensure proper documenta on to
facilitate long-term scalability.

What is the use of the VALUE and FILTER operators in ABAP?

Answer: The VALUE operator is used to construct complex data


structures, while the FILTER operator helps filter internal table entries
based on specific condi ons.
Example:
lt_customers = VALUE #(

( name = 'John' country = 'Germany' )

( name = 'Alice' country = 'USA' )

( name = 'Michael' country = 'Germany' )

Prepared By Sonu Jangir +91 9729751248


[email protected]
( name = 'Sophia' country = 'France' )

).
lt_filtered_customers = FILTER #( lt_customers WHERE country =
'Germany' ).

How do you handle authoriza on checks in reports?

Use AUTHORITY-CHECK statements to verify the user's authoriza on


for specific data or transac ons. This should be done before
performing sensi ve data opera ons.

Real-World Applica on of ABAP Reports

In real-world scenarios, reports are essen al for making data-driven


decisions. For example, crea ng reports that track financial
transac ons in a u lity company can help ensure business opera ons
run smoothly.

Transi on to the Next Topic – Interface Transi on

Now that we've covered the key aspects of reports in SAP ABAP as
part of the RICEFW framework, let’s move on to Interfaces, another
cri cal component for seamless data exchange between SAP and
external systems.

What’s Next – Understanding Interfaces in SAP ABAP

Tease Future Content: In the next ar cle, we’ll explore Interfaces in


SAP ABAP, focusing on how they facilitate communica on between
SAP and non-SAP systems, ensuring smooth data integra on and data
consistency.
Prepared By Sonu Jangir +91 9729751248
[email protected]
Call to Ac on: Follow my profile to stay updated, as we dive into
Interfaces and con nue exploring SAP ABAP in greater depth.

What are the 4 parts of a Select-op on?

SIGN(1) - I/E( Include, Exclude)


OPTION(2) -> Rela onal operator( EQ, BT-------)
LOW - Low value
HIGH - High value

If we are passing only a low value in Select-op on, what is the


rela onal operator?

EQ

If we are passing only a low value and High value in Select-op on,
what is the rela onal operator?

BT
Types of user exists, what kind of work is done on these exists ?

File exits, Menu Exits, func on exits

How will you find out where the user exits are available?

CMOD : this transac on allow you to create a projects by iden fy its


ENHANCEMENT (S) .A er determining all of the enhancement that
are part of the PROJECTS , you will have ac vate the projects you will
s ll need to code your user exist therefore you may want to wait un l
this step is completed before ac va ng the projects

Prepared By Sonu Jangir +91 9729751248


[email protected]

You might also like