Monday, September 21, 2020

Interview questions for SAP ABAP.

Interview questions for Technical Round in SAP ABAP.


 

Most important Interview questions for 2020 Technical Round in SAP ABAP.

1.      How do you rate yourself in DDIC

2.      Which type of developments you are doing in your latest client

3.      What is your ABAP team size

4.      What is your Functional team size

5.      What is your current CTC

6.      What is MANDT and what is the use of it.

Ans. It’s the data element used in the table to make the data of that table as client specific i.e. the data of that particular table will be visible in the logical separation in which it is created

 

8.      What are the options in technical settings and meaning of all

Ans.  Data Class:- It determines that in which table space the table will be stored while table

          Creation. A tablespace is a physical file on disk that is used to hold tables. Every table

          is assigned to one tablespace, tables with similar characteristics are usually grouped

          into one tablespace.

          Size category:- It describes the probable space requirement of the table in the

           Database.

          Buffering :- The database interface(component of workprocess) buffers the

          information from the database on the application server. When data is read from the

database, it can be stored in buffer on the application server. This technique reduces

the load on the database server and on the network link between the database and application server.

There are 3 buffering options: - Buffering not allowed,

                                                    Buffering allowed but switched off, and

                                                   Buffering switched on.

There are three buffering types:-

Single record buffering: - With this kind of buffering, only the records of a table which are actually accessed are loaded into the buffer. This buffering should be used for large tables where there are frequent single-record accesses (using SELECT SINGLE ...).

Generic area buffering: - In a read access to a record of a generically buffered table, all the records whose left-justified part of the key (generic area) corresponds are loaded into the buffer. If this type of buffering is selected, the generic area must be defined by specifying a number n of key fields. The first n key fields of the table then define the generic key. The number of key fields to be entered must lie between 1 and the number of key fields -1. For example, only values between 1 and 5 are permitted for a table with 6 key fields. The client field is included here.

Full buffering :- With full buffering, either the complete table or none of the table is in the buffer. If a read access is made to a record, all records of the table are transferred to the buffer.

 

9.      What is delivery class

Ans. Delivery class:- It controls the degree to which SAP or customer is responsible for table

maintenance. The delivery class controls the transport of table data when installing or upgrading, in a client copy and when transporting between customer systems. The delivery class is also used in the extended table maintenance.               

10.  Difference between structure and table

Ans. Structure does not have technical settings but table do have technical settings, Structure does not have primary key but table do have technical settings, Structure does not have associate database table but table have associate database table. 

11.  What is foreign key relationship

Ans. Foreign key is field in a table that is connected to another table via foreign key relationship The purpose of foreign key relationship is to validate the data being entered into one table by checking against a valid set of values in another table. The table that contains foreign key is called foreign key table. The table that contains valid set of values is called check table.

12.  Difference between value table and check table

Ans. Value table:- This is maintained at domain level. Whenever you create a domain, you can enter allowed values. For example you go to Domain   SHKZG - Debit/credit indicator.  Here only allowed values is H or S. Whenever you use this Domain, the system will forces you to enter only these values. This is a sort of master check.

Check table:- The ABAP Dictionary allows you to define relationships between tables using foreign keys. A dependent table is called a foreign key table, and the referenced table is called the check table. Each key field of the check table corresponds to a field in the foreign key table. These fields are called foreign key fields. One of the foreign key fields is designated as the check field for checking the validity of values. The key fields of the check table can serve as input help for the check field. 

13.  What is index and its uses

Ans. An index is an efficiency mechanism for quickly finding rows within a table. It is needed because data is stored in a table in the order in which it was added. It is used to speed up the SQL query but on the other hand updating a table with indexes takes more time than updating a table without indexes (because the indexes also need an update) so we should create index on the field which are frequently searched

14.  What is view.

Ans.  A view also called virtual table is a logical view of one or more than one tables. View or data from view is not physically stored, instead being derived from one or more tables. A view can be used to summarize data which is distributed among several tables. We can add functions like join, where statements to a view and present the data as if the data is coming from a single table. 

15.  What is type group

Ans. A type pool (AKA type group) is a data dictionary object that exist merely to contain one or more types or constants statements. Sometimes we come across certain situation in which we need to declare the same set of variables in a number of ABAP programs, so to reduce the pain of this repetitive declaration we can create just one type-pool and use it in all the programs so in a way it is global data declaration. 

16.  What is native and open SQL and how can we write it in our code

Ans.  Open SQL:- The SQL that we write in general in ABAP editor is called Open SQL.

 Database server converts the open SQL to Native SQL while execution.

 Native SQL:- The pure SQL that database understands is known as Native SQL. We

 can write Native SQL in ABAP editor in between a statement mentioned below:-

           EXEC SQL.

           <Business Logic>

          END EXEC.

If we write Native SQL in ABAP editor then the processing will be faster as

 compared to the Open SQL.

 

17.  Difference between clear, refresh, free in internal table

Ans. Clear :- Deletes the header line. If the internal table is with header line then clear will

 work in below mentioned way:-

         Clear: itab,            “ will delete the header line of internal table

                    Itab[].        “ will delete the body of internal table

         Refresh:- Deletes the body of internal table

         Free:- It will free the memory occupied by the internal table        

 

18.  How many types of reports are there

Ans. Classical Report, ALV Report, Interactive Report.

 

19.  Events of reports and when are they triggered

Ans. Load of program:- It allocates memory for the variables used in your program. This event is triggered only if the type of the program is M,F,S and 1.

          Initialization:- It is used to assign values to the variables you have used in the

programs. It is triggered when report is loaded in the memory

          At selection-screen output:- This event is used to hide/unhide the parameters. This is triggered when the selection-screen is loaded in memory before being displayed.

          At selection-screen:- It is used to perform check on the user’s input. This is triggered before leaving the selection screen.

           Start-of-selection:- The first and default event for displaying the report, data retrieval logic is written under this event.

           Top-of-page:- This event is used for writing the header information or message on top of the report. This event is triggered when it gets the first write statement of the code.

          End-of-page:- This event is used for writing the footer information or message at bottom of the report. This event is triggered considering the line count statement written in the report (Report <Report_name> Line count <Page length>)

 

20.  Sy fields used in interactive reports

Ans. Sy-subrc, Sy-lsind (Shows the Interaction level of interactive report), Sy-lilli (Gives the index of line, counting from the top of the page of the report’s output), Sy-lisel (Gives the work area on which the user have double clicked), Sy-ucomm (Gives the user’s action) 

21.  Control break statement in SAP

Ans. Control break Statement:- Stop, Check, Exit

                              Stop:- It is usually used in Start-of-selection, At selection screen, and Get. And if the stop condition succeeds then the control will move to the End-of-selection event.

                              Exit:- Exit statement takes the control out of the processing block once it succeeds.

                              Check:- Inside a loop it works as continue and inside a processing block it works as exit statement.

 

22.  What is BDC and what are the ways to run BDC program, call transaction statement in BDC

Ans. BDC (Batch Data Communication) is a interfacing technique used to transfer data from SAP to SAP system or from Non-SAP to SAP system. It uses normal T-codes to transfer the data. There are 2 ways to run BDC program:- Using Call Transaction, Using Batch Input Session(SM35). Call transaction method is much faster and is useful for transferring large amount of data as compared to Batch Input Session.

 

 

 

 

23.  What is message class, types of messages and how to include it in your program

Ans. Message class is a group of logically related messages which we can include in our program by using message-id statement (Report <report_name> message-id <messageclass_name>)

 

24.  Difference between sap script and smart forms.

Ans. Smartform is a advanced version of SAPScript with more advanced functionality and more GUI friendly

 

25.  What will you do if you want to optimize a program(performance tuning)

Ans.

 Data declaration:-

1.      Never use internal table with header line

2.      Always create type groups rather than taking all fields of the tables

 Data fetching:-

1.      Avoid using “Select- End Select” Statement

2.      Never use select query inside a loop                                                                                                        

3.      Use “Sy-subrc “ after the query to avoid useless execution if in case query fails to        fetch data as per your need

4.      Avoid using * in the select query, fetch only needful fields from the table

5.      Never use “into corresponding field of table”, always maintain the order of the fields in declaration in type groups and in the query

6.      While using “For all entries in”, check that the table used in for all entries in is initial or not. Sort the table by fields in where clause

7.      Delete the adjacent duplicates from the driver table otherwise for the same entry system will check redundantly

8.      If a field used in where clause is used frequently in the program and in other programs also then create a secondary index on them

 

 Processing the fetched data:-

1.      Never use “sort” statement in loop

2.      Use delete adjacent duplicate after sorting so as to avoid redundant data

3.      Always clear all the work areas used in the loop at the end of looping statement

4.      While “Reading Table” sort the table by key field used in read table statement.

5.      Use binary search in read table statement as it reduces the runtime of the search for the large table.

6.      Check if the read statement has executed successfully or not by using sy-subrc, so as to avoid useless execution if the read statement fails in it is purpose.

 

After developing the program:- SLIN (Extended program check) & SCI (Code Inspector)

Extended Program Check (SLIN)


Many checks are excluded from the standard syntax check for performance reasons. The extended program check performs a complete check that includes the interfaces of external procedures called from your program.

The extended program check returns both errors and warnings and it is possible to run either specialized tests or one whole standard check.

Errors in the extended program check cause exceptions when you run the program which, in turn, lead to runtime errors. You must therefore correct them. The exception to this is coding that cannot be reached. However, you should delete this to minimize the size of your program and make the source code easier to understand. 

Warnings in the extended program check should also be corrected. If your program contains statements that are definitely correct but still produce warnings in the extended program check, you can exclude them from the check using pseudo comments ("#EC ...). 

 

SCI (Code Inspector)

The Code Inspector is a tool for checking Repository objects regarding performance, security, syntax, and adherence to name conventions

 

26.  Events in module-pool programming and sequence of it

Ans. PBO, PAI, POV, POH

PBO event

      This event is triggered before the screen is displayed. The processing of screen before the display of screen is done in this event. For example, filling in default values in the screen                fields.

 

PAI event

      This event is responsible for processing of screen after the user enters the data and clicks               pushbutton. The processing of screen can include displaying another screen, or just              displaying list or quitting the transaction itself and many more things. These operations

can be carried out in the PAI event. OKCODE plays an important role in this operation

 

 

POV event

      Process on value request is triggered when the user clicks F4 key. You can handle this

       event when the user presses. F4 key by writing code for the same in module pool

       program. Normally when the user presses F4, list of possible values are displayed. The

      standard list produced by system is adequate for applications you develop yourself.

      However, you can also have the option of setting up your own documentation and lists of

      possible values that are more detailed.

 

 

POH event

      Normally when the user places the cursor on the field and presses F1 function key, the

      System displays its own Help for that particular field. You can add your own

 functionality to the Help button by writing code for the same in the POH event.

 

 

27.  How to call BAdI from Zprogram

Ans. Through Get BAdI and Call BAdI statements

 

 

28.  Why we are using Chain and end chain

Ans. Chain endchain statement is used to validate the group of fields

 

29.  How to create f4 help in module pool programming.

Ans. Module <module_name> on <field_name> input

 

30.  What is the flow of SD

Ans.  Flow of SD:-

·         Inquiry

·         Quotation

·         Sales order generation

·         Delivery:- Transfer order:- Transfer of goods from warehouse to loading point

                            PGI (Post goods issue):- Maintaining the record of the goods delivered by

                            posting it in FI.

·         Invoice generation

·         Receipt of Payment

 

  Flow of MM:-

·         Purchase requisition

·         RFQ (Request for quotation)

·         Quotation maintenance:- keeping the records of quotations

·         Purchase order generation

·         MIGO (Goods received)

·         MIRO (Invoice verification)

                                  

31.  What is Unicode and non- Unicode

Ans.  Unicode system supports multi languages

           Non-Unicode system supports only 2 languages (English & German) only

          

         We can see that if the system supports Unicode or non-unicode by:-

             Logon to SAPà Click on system/status

 

32.  What is binary search used in read statement

Ans. Binary search option in read statement fastens the read of internal table.

 


How you can maintain Logs (or) Error records in Session method in SAP ABAP.

 

How you can maintain Logs (or) Error records in Session method?



Answer:

In Session method SAP is providing a Log file by default

No need to create a Log file for handling error records

You can find Log file by using SM35

Ø Go to SM35

Ø Select your session

Ø Select Log option (F7)

Ø Select your session

Ø Select Display button

Difference between Implicit & Explicit Enhancement In SAP ABAP.

Ques: What is the difference between Implicit & Explicit Enhancement?


Implicit & Explicit Enhancement in SAP ABAP.

Answer:

 Under implicit enhancement you can write your own code

 Adding Z-enhancement in already existing one is called Explicit enhancement

Example:

 Go to SE93

 Transaction Code: VA01

 Display

 Double click on Program Name

 You will find a spot given by SAP

 Enhance

 Right click ES_SAPMV45A

 Enhancement Implementation ----Create Implementation

Details about Internal Table in SAP ABAP.

Details about Internal Table in SAP ABAP.



Internal Table:

Ø Internal table is a temporary table created in RAM in Application Server

Ø It is created & filled with data during run time (execution time)

Ø Once execution is performed it is rolled out (or) discarded

 

Note:

Use Internal table for storing multiple records during run time

 

Difference between Database table & Internal table:

                   Database Table                                          Internal Table

1.     It is created in Database Server ------- 1. It is created in Application Server

2.     It holds data permanently                   ------- 2. It holds data temporarily

3.     It holds only specific type of data ----- 3. It holds data of different tables of at one place

 

Que: What is exact purpose of Internal table. Do you think should be created in ABAP

         programming?

Ans: In real time we are creating Internal table for storing different types of application data

         from different tables at one place

 

Every Internal table is having 2 parts

They are:

1.     Internal Table Body

2.     Header Line

 

1. Internal Table Body:

The name Internal table itself specifies body of Internal table & it holds multiple records

 

2. Header Line:

It is a default Work Area & holds single record

 

Note:

Header Line is system defined Work Area & Work Area is user defined Header Line

 

Syntax:

DATA:  BEGIN    OF   it_kna1   OCCURS   0,

              customer(20)    TYPE   C,

              name(20)          TYPE   C,

              city(20)            TYPE   C,

              END       OF    it_kna1.


 

Note:

1.     With above syntax an Internal table it_kna1 is crated in Application Server

2.     You can provide any name. But in real time Internal table should always begins with it_ (or) i_ followed by table name

3.     With BEGIN option Header Line is created & OCCURS option Body is created

4.     0, 1, 2, 3, …..9 is called Size Category

5.     Both Header Line & Body name is same (it_kna1)

 

Flow of Data in Internal Table:

1.     Database Table ----à Body---à Header Line--à Virtual Page ---à Presentation Server

2.     Database Table ---à Body---à Presentation Server