Ads

SAP ABAP ALV Reports Interview Questions

SAP ABAP ALV Reports Interview Questions and Answers for Experienced 

Here, I am sharing very important real-time oriented questions that are faced at several interviews on ALV Reports to help freshers and experienced SAP ABAP consultants with appropriate answers.


What is ALV?


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 function modules provided by SAP.


What are the uses of ALV reports?

Sorting 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 are the standard function modules used to create ALV?

REUSE_ALV_LIST_DISPLAY                     Display an ALV list
REUSE_ALV_GRID_DISPLAY                      Display an ALV grid
REUSE_ALV_COMMENTARY_WRITE      Output List header information
REUSE_ALV_VARIANT_F4                       Display variant selection dialog box
REUSE_ALV_VARIANT_EXISTENCE       Checks whether a variant exists
REUSE_ALV_FIELDCATALOG_MERGE       Create field catalog from dictionary structure or internal table


What is Field Catalog in SAP ALV?

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

Automatically through a Data Dictionary structure. (Example in What is SAP ALV?)
Manually in ABAP program. (Example in Create a simple ALV)
Semi-automatically by combining the above two procedures.
Declare an internal table of type SLIS_T_FIELDCAT_ALV.
Call function module REUSE_ALV_FIELDCATALOG_MERGE 


What are 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,
SLIS_SELFIELD.   

How do you define default variant for ALV?

 he user can programmatically set the initial (default) variant for list display.
The default variant can be found using the function 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 function module REUSE_ALV_EVENT_NAMES_GET. The return table from this function module contains all the possible events.

What are the layout Parameters options of ALV?


 Display options
-         Exceptions
-         Totals
-         Interaction
-         Detail screen
-         Display variants (only for hierarchical-sequential lists)
-         Color
-         Other

What is sort of internal table options in ALV?

This internal table has the following fields:
-         spos :  Sort sequence
-         fieldname :  Internal output table field name
-         tabname : Only relevant for hierarchical-sequential lists. Name of the internal output table.
-         up : 'X' = sort in ascending order
-         down : 'X' = sort in descending order
-         subtot : 'X' = subtotal at group value change
-         group : '* ' = new page at group value change ,'UL' = underline at group value change

What is the Main Function module of the ALV Report?

REUSE_ALV_GRID_DISPLAY

What are the Import Parameters of the ALV report Function module?


Import parameters
I_INTERFACE_CHECK: Interface consistency check log output.
I_CALLBACK_PROGRAM: Name of the calling program
I_CALLBACK_PF_STATUS_SET: Set EXIT routine to status.   
I_CALLBACK_USER_COMMAND: EXIT routine for command handling
I_STRUCTURE_NAME: Internal output table structure name     
IS_LAYOUT: List layout specifications 
IT_FIELDCAT: Field catalog with field descriptions
IT_EXCLUDING: Table of inactive function codes   
IT_SPECIAL_GROUPS: Grouping fields for column selection
IT_SORT: Sort criteria for first list display
IT_FILTER: Filter criteria for first list output
IS_SEL_HIDE           : Selection information modification
I_DEFAULT: Initial variant active/inactive logic
I_SAVE: Variants can be saved
IS_VARIANT  : Variant information
IT_EVENTS: Table of events to perform
IT_EVENT_EXIT :  Standard fcode exit requests table 
IS_PRINT: Print information
IS_REPREP_ID: Initialization keys for Re/Re interface
I_SCREEN_START_COLUMN: Coordinates for list in dialog box
I_SCREEN_START_LINE: Coordinates for list in dialog box
I_SCREEN_END_COLUMN: Coordinates for list in dialog box        
I_SCREEN_END_LINE: Coordinates for list in dialog box       
IT_EVENT_EXIT: Standard fcode exit requests table
IS_PRINT: Print information
IS_REPREP_ID: Initialization keys for Re/Re interface
I_SCREEN_START_COLUMN: Coordinates for list in dialog box  
I_SCREEN_START_LINE: Coordinates for list in dialog box       
I_SCREEN_END_COLUMN: Coordinates for list in dialog box        
I_SCREEN_END_LINE: Coordinates for list in dialog box  


What are the Export Parameters of ALV report Function module?

E_EXIT_CAUSED_BY_CALLER: Delete list in CALLBACK_USER_COMMAND
ES_EXIT_CAUSED_BY_USER: How the user left the list Tables       
T_OUTTAB: Table with data to be displayed ---mandatory


How do you create Interactive ALV Report?

We have to pass USER_COMMAND  export parameter by creating Subroutine User_command.

 CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-repid
      i_callback_user_command  = 'USER_COMMAND'

*User actions on ALV
FORM user_command USING r_ucomm TYPE sy-ucomm
                        rs_selfield TYPE slis_selfield.
  CASE r_ucomm.
*User clicks a transaction code and that tcode is called from ALV
    WHEN '&IC1'.
      READ TABLE it_tstc INDEX rs_selfield-tabindex INTO wa_tstc.

Endform.


How many types of ALV reports?

ALV Types

(1) List/Grid ALV

REUSE_ALV_GRID_DISPLAY

REUSE_ALV_LIST_DISPLAY

(2) Block List ALV

REUSE_ALV_BLOCK_LIST_INIT: is used to initialize blocked list ALV.

REUSE_ALV_BLOCK_LIST_APPEND: is used to add blocked list ALV's(we can add multiple).

REUSE_ALV_BLOCK_LIST_DISPLAY: is used to display blocked list ALV.

(3) Heirerchial Sequential

*key infomation for the header and item table
  key-header01 = 'TABNAME'.
  key-item01 = 'TABNAME'.

CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
      i_callback_program = sy-cprog
      is_layout          = it_layout
      it_fieldcat        = it_fieldcat
      i_tabname_header   = 'IT_DD02L' Header Table
      i_tabname_item     = 'IT_DD03L' Item table
      is_keyinfo         = key
    TABLES
      t_outtab_header    = it_dd02l

How do you upload Upload Logo for ALV 


USING REUSE_ALV_COMMENTARY_WRITE function module.

 you can import a customer-specific logo and a background picture into the R/3 System. These will be displayed in the header area of reports in HR Funds and Position Management.
From the SPRO

Goto the transaction OAER
2.  Enter the class name as 'PICTURES'
3.  Enter the class type as 'OT'
4.  Enter the object key as the name of the logo you wish to give
5.  Execute
6.  Then in the new screen select Standard doc. types in bottom window
     Click on the Screen icon 
     Now, it will ask for the file path where you have to upload the logo
7.  Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE

What is a report? 

There are 2 type of reports. 
Interactive report
Classic reports
In classic reports,we can see the output in single list where as in interactive reports we can see the output in multiple list.


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.
INTIALIZATION: This event triggers before selection screen display.
AT-SELECTION-SCREEN: This event triggers after proccesing user input still selection screen is in active mode.
START OF SELECTION: Start of selection screen triggers after proceesing selection screen.
END-OF-SELECTION : It is for Logical Database Reporting.


What are the Interactive 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 Interactive 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)

Interactive 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 function keys...
AT USER-COMMAND : It provides user functions keys.
TOP-OF-PAGE DURING LINE-SELECTION :top of page event for secondary list.


How Many types of Tables are there in Data Dictionary and what they.


Ans: 3

Transparent table

CLUSTER Cluster table

POOL Pooled table


Can we Join a transparent and cluster Table?

Ans: No

What is meant by buffering and how many types of bufferings are there.


Single Record. Only selected records are stored in Buffer

Generic Area Bufferred with Number of Keys

Fully Bufferred Full table is stored in the buffering area

Can we add new records to the already displayed ALV list.



Add new records to the Internal table and

RS_SELFIELD-REFRESH = 'X'. "Refresh



What are pricing tables?


Pricing Tables starts with A* like A001, A002, A900 like that.

KONH – Condition Header

KONP – Condition Detail


Can u give an example of cluster table?


CDPOS Change Documents Detail Table

BSEG Accounting Document Segment


 Can u list out some of the tables in Finance?


SKA1 GL Accoun (SAKNR)

T004 Chart of Accounts (KTOPL)

T001 Company Code (BURKS)

BKPF Accounting Doc Header

BSEG Accounting Doc Detail


 Can you list out some of the tables in SD?


VBAK, VBAP, VBPA

LIKP, LIPS Delivery Tables

VBRK, VBRP Invoice Tables

VTTK, VTTP, VTTS Shipment Tables

MKPF, MSEG

VBUK - Document Status

VBUP - Document Line item status

VBFA - Document Flow (It links Sales orders and Deliveries)

VBFS - Error Log in Collective processing


How to know the number of records in an internal table?


Ans: DESCRIBE TABLE LINES.


How many secondary lists can be produced?


One Basic List and 19 secondary lists.


What is a table maintenance generator.

To allow users to maintain table using SM30 transaction 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 Connections table (RFCDES), Batch Jobs (TBTCO and TBTCP) are not client dependant.


What is the difference between at selection screen and at selection 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 selection.


AT SELECTION-SCREEN: This would be triggered if you hit any thing (Enter, Drop-Down, Help, Execute) after the selection screen is displayed.


Which one will be trigger first?


AT SELECTION-SCREEN OUTPUT


What is the difference between clear, refresh


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 selection screen?


Create a variant in the ALV Report with what ever 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 creating the table using Tcode SE11.

Maintain Delivery Class (A-Application 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 Settings (Data class, Size, Buffering info)

Create Secondary indexes as needed

Activate 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 function 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 properties of each field.


What is significance of HIDE?


In Interactive reports, HIDE statement stores the value of that field for that line. If the user places the cursor on a line and click on some thing those values are automatically 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 with out 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?


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 are the Events in the report and the order in which they trigger?


INITIALIZATION

AT SELECTION-SCREEN OUTPUT

AT SELECTION-SCREEN

AT SELECTION-SCREEN ON HELP-REQUEST

AT SELECTION-SCREEN ON VALUE-REQUEST

START-OF-SELECTION

END-OF-SELECTION

TOP-OF-PAGE

TOP-OF-PAGE DURING LINE SELECTION


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. Application 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?


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.

How many detail lists can be created in interactive reporting?


20

What is the name of the system variable that holds the contents of the selected line in interactive reporting?


SY-LISEL

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 solution to your problem.


Commit statement in User-Exits. Can it be used?


We should not write commit statement inside the user exit or badi...standard alone will handle the commit work ....


COMMIT IS A SAP COMMAND WORD USED TO UPDATE DATABASE PERMANANTLY.

Significance of an end-of-selection event



End of selection is required only when a logical database is used marked by the "Get" statement. It shows that the querying of the logical database has ended. In reports without logical database it is not necessary to add end-of-selection.

What is the command to be used to transfer the data from one internal table to another internal.


Move itab1 to itab2


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 selection screen and which event was fired?


At selection-screen is an event, which is used to validate the selection screen input fields, if you want to validate the particular input field we use at selection-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 collection of domain with short description, whereas domain is collection of datatype and length.


Domain contains only technical attributes (data type , size) where as Data Element contains Technical attribute as well as Semantic attributes(Field description).

What is the difference between Internal table with header line and with out 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.

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 initialization 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 spitted into two parts and searching is started from one of the part. In normal search data is searched linearly from top to bottom 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 .

What is diffrence between ON Change of & At New Field??Select Single * from & select Upto 1 rows


ON CHANGE OF & AT NEW FIELD OF: Both triggers when a new record is found in table. But we can use AT NEW FIELD only in loops and ON CHANGE OF can be used any where. SELECT SINGLE * & SELECT UPTO 1: ...


On change of and at new field are the internal table events. the significant difference between them are on change of can be used in any loop but at new field can be used only in internal table loop.

While printing, 10 columns are printing 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?


Not 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.if we we put start-of-selection there is no compulsory to use end-of-selection. End-of-selection is used when we want to execute some output even when some exception occurs to skip start-of-selection.


There is no mandatory event in the report program.
however, if we don't explicitly write any event, system implicitly starts with start of selection event.In case of database selection, it is a good practice of use end-of-selection event.

What is the transaction 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,selection texts in programs


Explain Check Table and Value Table ?

Check tabke 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 automatically proposed as a check table while creating foreing key relationship

How many types of Standard Internal Tables? 


- STANDARD TABLE:


The key is, by default, set to NON-UNIQUE. You may not use the UNIQUE addition.


- SORTED TABLE:

Unlike stadard tables, sorted table have no default setting for the uniqueness attribute. If you do not specify either 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 subroutine parameters.



- HASHED TABLE:

Hashed tables have no default setting. You must use the UNIQUE addition with hashed tables. You may not use NON-UNIQUE.

What is Refresh in Internal Table?


'Refresh' is the keyworld 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 existing entries. If it does not find an entry, the system creates a new entry instead.


What are the ways of creating Tables? 


There are two ways to create table

1) top-down approach

2) bottom-up approach

What is the significance of a stacked list?

The secondary list is also called the stacked list and it will be shown on the entire screen if we don’t write its coordinates of the command window.

When it’s the right time to utilize the command GET CURSOR in interactive lists?

The command GET CURSOR will be utilized when the hidden information is not enough for tracing the selected line, 

How do we describe START –OF-SELECTION and END-OF-SELECTION?

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

What system fields do we use for interactive reporting?

The index of the actual list is found in the system field SY-LSIND , 
at the time of making the main list, SY-LSIND is 0. 

SY-LINCT the whole line number of a list, 

SY-LINNO the number of lines where the cursor is found.
SY-LSIND is the index of the presentation made list( in the time of the actual event-0).
SY-LISTI is the index of the level that invoked the event.
SYLILLI is the line number that invoked the event.
SY-LISEL represents the content of the line that invoked the event.
SY-CUROW represents the place in the window that the line which invoked the event has (beginning from 1).
SY-CUCOL is the place in the window where the column that invoked the event is found (beginning from 2). 
SY-UCOMM represents the function code that invoked the event.
SY-PFKEY has the actual list status.

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 the next line.

Read Also 


Conclusion

If you know more about SAP ABAP ALV Reports Interview Questions, please comment below, or share this post to help others.

Comments

  1. Best trusted Skin Care Treatment Center serving London. Visit our website for Skin Problems Treatment or Aesthetics Doctor Clinic, to book an appointment online at mypureaesthetics.com.

    Aesthetic clinic London

    ReplyDelete
  2. Are you looking for the best Aesthetic clinic in London? If yes, then you are come to right place Faaesthetics.com is the best clinic in london. For more details visit our website.

    london aesthetic clinic

    ReplyDelete

Post a Comment

Popular posts from this blog

BADI Interview Questions in SAP ABAP

Sample SAP ABAP Programming Examples for Practice

Module Pool Programming Interview Questions and Answers in SAP ABAP

Step by Step tutorial on BDC Session Method Program in SAP ABAP

SAP ABAP Interview Questions and Answers for 10 Years Experienced