Top 50 Sap Abap Interview Questions You Must Prepare 23.Jul.2024

Q1. Explain What Is The Difference Between Primary Key And Unique Key?

Primary Key – It can accepts 0 value and cannot be NULL.

Unique Key – It can be NULL.

Q2. How To Upload Data Using Catt?

These are the steps to be followed to Upload data through CATT: Creation of the CATT test case & recording the sample data input. Download of the source file template. Modification of the source file. Upload of the data from the source file.

Q3. What Are The System Fields You Have Worked With? Explain?

I had worked with the following (30) system fields:
1) SY-DBSYS - Central Database
2) SY-HOST - Server
3) SY-OPSYS - Operating System
4) SY-SAPRL - SAP Release
5) SY-SYSID - System Name
6) SY-LANGU - User Logon Language
7) SY-MANDT - Client
8) SY-UNAME - Logon User Name
9) SY-DATLO - Local Date
10) SY-DATUM - Server Date
11) SY-TIMLO - Local Time
12) SY-UZEIT - Server Time
13) SY-DYNNR - Screen Number
14) SY-REPID - Current ABAP program
15) SY-TCODE - Transaction Code
16) SY-ULINE - Horizontal Line
17) SY-VLINE - Vertical Line
18) SY-INDEX - Number of current loop Pass
19) SY-TABIX - Current line of internal table
20) SY-DBCNT - Number of table entries processed
21) SY-SUBRC - Return Code
22) SY-UCOMM - Function Code
23) SY-LINCT - Page Length of list
24) SY-LINNO - Current Line
25) SY-PAGNO - Current Page Number
26) SY-LSIND - Index of List
27) SY-MSGID - Message Class
28) SY-MSGNO - Message Number
29) SY-MSGTY - Message Type
30) SY-SPONO - Spool number during printing 

Q4. Describe The Difference Between Macro And Subroutine?

Macros can only be used in the program they are defined in and only after the definition are expanded at compilation / generation. Subroutines (FORM) can be called from both the program they are defined in and other programs. A MACRO is more or less an abbreviation for some lines of code that are used more than once or twice. A FORM is a local subroutine (which can be called external). A FUNCTION is (more or less) a subroutine that is called external. Since debugging a MACRO is not really possible, prevent the use of them (I’ve never used them, but seen them in action). If the subroutine is used only local (called internal) use a FORM. If the subroutine is called external (used by more than one program) use a FUNCTION.

Q5. How Do You Write A Function Module In Sap? Describe?

  1.  Called program - SE37 - Creating function group, function module by assigning attributes, importing, exporting, tables, and exceptions.
  2.  Calling program - SE38 - In program, click pattern and write function name- provide export, import, tables, exception values.

Q6. Write Special Commands Of List?

There are four specials commands of lists:

  • Write
  • Uline
  • Skip
  • New-Page

Q7. What Is A Collect Statement? How Is It Different From Append?

  • Collect: If an entry with the same key already exists, the COLLECT statement does not append a new line, but adds the contents of the numeric fields in the work area to the contents of the numeric fields in the existing entry.
  • Append : Duplicate entries occurs

Q8. What Is The Syntax Of Packed Number?

Data : NUM type P decimals 2.

Q9. Explain What Are Interactive Reports?

An output list which displays just the basic details & 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.

Q10. How Many Default Tab Strips Are There? How To Insert More Tabs In It?

There are 2 default Tab strips. Screen painter attributes contain Tab Title, which is used to insert more tabs in tab strip.

Q11. 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 which 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.

Q12. Difference Between Domain And Data Element? What Are Aggregate Object?

Domain - Specifies the technical attributes of a data element - its data type, length, possible values, and appearance on the screen. Each data element has an underlying domain. A single domain can be the basis for several data elements. Domains are objects in the ABAP Dictionary.

Data Element - Describes the business function of a table field. Its technical attributes are based on a domain, and its business function is described by its field labels and documentation.

Aggregate Object – Views, Match Code and Lock objects are called aggregate objects because they are formed from several related table.

Q13. What Are Field Symbols And Field Groups? Have You Used Component Idx Of Structure Clause With Field Groups?

Field Symbols – They are placeholder or symbolic names for the other fields. They do not physically reserve space for a field, but point to its contents. It can point to any data objects.
Field-symbols <fs>

Field Groups – Field groups does not reserve storage space but contains pointers to existing fields.
An extract dataset consists of a sequence of records. These records may have different structures. All records with the same structure form a record type. You must define each record type of an extract dataset as a field group, using the FIELD-GROUPS statement.
Field-groups <fg>

Q14. What Do You Do With Errors In Bdc Batch Sessions?

We look into the list of incorrect session and process it again. To correct incorrect session, we analyze the session to determine which screen and value produced the error. For small errors in data we correct them interactively otherwise modify batch input program that has generated the session or many times even the data file.

Q15. What Are The Abap Commands That Link To A Layout Set?

Control Commands, System Commands.

Q16. Different Types Of Luws. What Are They?

Two types of LUW are:

  1.  DB LUW - A database LUW is the mechanism used by the database to ensure that its data is always consistent. A database LUW is an inseparable sequence of database operations that ends with a database commit. The database LUW is either fully executed by the database system or not at all. Once a database LUW has been successfully executed, the database will be in a consistent state. If an error occurs within a database LUW, all of the database changes since the beginning of the database LUW are reversed. This leaves the database in the state it had before the transaction started.  
  2. SAP LUW - A logical unit consisting of dialog steps, whose changes are written to the database in a single database LUW is called an SAP LUW. Unlike a database LUW, an SAP LUW can span several dialog steps, and be executed using a series of different work processes.

Q17. Does Sap Handle Multiple Currencies? Multiple Languages?

Yes.

Q18. What Are The Different Types Of Views In Sap R/3 System?

The different views are:

a. Logical view
b. Software-oriented view
c. User-oriented view

Q19. A Situation: An Abap Program Creates A Batch Input Session. We Need To Submit The Program And The Batch Session In Background. How To Do It?

Go to SM36 and create background job by giving job name, job class and job steps (JOB SCHEDULING).

Q20. If You Are Using Logical Databases How Will You Modify The Selection-screen Elements?

Select-options : dname for deptt-dname.

Q21. What Is Sap Script And Layout Set?

The tool, which is used to create layout set is called SAP Script. Layout set is a design, appearance and structure of document.

Q22. How To Debug A Script In Abap?

Go to SE71, give layout set name, go to utilities select debugger mode on.

Q23. What Are Conversion & Interface Programs In Sap?

  • CONVERSION: Legacy system to flat file.
  • INTERFACE: Flat file to SAP system.

Q24. What Is Get Cursor Field?

GET CURSOR statement transfers the name of the screen element on which the cursor is positioned during a user action into the variable <f>.

GET CURSOR FIELD <f> [OFFSET <off>] [LINE <lin>] [VALUE <val>] LENGTH <len>]. 

Q25. What Is Asynchronous And Synchronous Update?

Asynchronous Update – The program does not wait for the work process to finish the update.
Commit Work.

Synchronous Update – The program wait for the work process to finish the update.
Commit Work and Wait.

Q26. What Are Matchcodes? Describe?

It is similar to table index that gives list of possible values for either primary keys or non-primary keys.

Q27. What Is Function Group? Difference Between Function Group And Function Module?

Function Groups act as containers for Function Modules that logically belong together.
Function Groups
1) These cannot be defined in a Function Module.
2) It cannot be called.
3) They are containers for Function Module.
Function Modules
1) These must be defined in a Function Group.
2) It can be called from any program.
3) They are not containers for Function Group.

Q28. What Is The Difference Between A Substructure And An Append Structure?

• In case of a substructure, the reference originates in the table itself, in the form of a statement include.
• In case of an append structure, the table itself remains unchanged and the reference originates in the append structure.

Q29. Can We Have More Than One Selection-screen And How?

Yes, we can have more than one selection screen.

Selection-screen begin of block honey with frame title text-101.
Select-options : deptno for zrekha_deptt-deptno.
Selection-screen end of block honey.

Selection-screen begin of block honey1 with frame title text-102.
Select-options : dname for zrekha_deptt-dname.
Selection-screen end of block honey1.

Q30. What Are The Data Types Of Internal Tables?

There are three types:

  1.  Line
  2.  Key
  3.  Table

Q31. What Is The Transaction Code For Table Maintenance?

SM30.

Q32. What Are Client Dependant Objects In Abap / Sap?

SAP Script layout, text element, and some DDIC objects.

Q33. Is A Logical Database A Requirement/must To Write An Abap Query?

No, it is not must to use LDB. Apart from it, we have other options:

  •  Table join by Basis Table
  •  Direct Read of table
  •  Data Retrieval by Program

Q34. In Sap Scripts, How Will You Link Form With The Event Driven?

In PAI, define function code and write code for the same.

Q35. What Are The Different Functions Used In Sap Script? What Are The Parameters Used In Each Function?

There are three different functions used in SAP Script:

  1. OPEN_FORM
  2. WRITE_FORM
  3. CLOSE_FORM

Parameters in Each Function:

  1. OPEN_FORM
    • Exporting
    • Form
    • Language
  2. WRITE_FORM
    • Exporting
    • Element
    • Window
  3. CLOSE_FORM

Q36. What Are The Contents In Technical Specifications?

There are five contents in Technical Settings:

  • Data Class
  • Size Category
  • Buffering Permission
  • Buffering Type and
  • Logging.

Q37. What Are The Different Types Of Mode (run Code) In Call Transaction Method?

There are three modes in Call Transaction:

  • A – Displays All Screen
  • E – Display Errors
  • N – Background Processing

Q38. What Is The Structure Of A Bdc Sessions.?

BDCDATA.

Q39. What Will You Code In Start-of-selection & End-of-selection ?

  START-OF-SELECTION  SELECT * FROM DEPTT INTO CORRESPONDING FIELDS OF ITAB  WHERE DEPTNO IN DEPTNO.  APPEND ITAB.  ENDSELECT.  LOOP AT ITAB.  WRITE : / 10 ITAB-DEPTNO.  HIDE : ITAB-DEPTNO.  ENDLOOP.  END-OF-SELECTION 

Q40. What Are Dml Commands In Abap?

Select, Insert, Delete, Modify, Update.

Q41. What Does An Exec Sql Stmt Do In Abap? What Is The Disadvantage Of Using It?

To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:

EXEC SQL [PERFORMING <form>].
<Native SQL statement>
ENDEXEC.

There is no period after Native SQL statements. Furthermore, using inverted commas (") or an asterisk (*) at the beginning of a line in a native SQL statement does not introduce a comment as it would in normal ABAP syntax. You need to know whether table and field names are case-sensitive in your chosen database. 

Q42. What Is The Typical Structure Of An Abap Program?

HEADER, BODY, FOOTER.

Q43. Are Programs Client Dependent?

Yes, group of users can access these programs with a client number.

Q44. What Are Different Types Of Screen Keywords?

There are four types of screen keywords:

  • Module
  • Loop
  • Chain
  • Field.

Q45. What Is An Interactive Report? What Is The Obvious Difference Of Such Report Compared With Classical Type Reports?

An Interactive report is a dynamic drill down report that produces the list on users choice.
Difference: -

  •  The list produced by classical report doesn't allow user to interact with the system where as the list produced by interactive report allows the user to interact with the system.  
  • Once a classical report, executed user looses control where as Interactive, user has control.  
  • In classical report, drilling is not possible where as in interactive, drilling is possible.

Q46. What Is The Difference Between Tables And Structures?

Tables:

  1.  Data is permanently stored in tables in the database.
  2.  Database tables are generated from them.

Structure:

  1.  It contains data temporarily during program run-time.  
  2. No Database tables are generated from it.

Q47. Name A Few System Global Variables You Can Use In Abap Programs?

SY-SUBRC, SY-DBCNT, SY-LILLI, SY-DATUM, SY-UZEIT, SY-UCOMM, SY-TABIX..

Q48. What Is A Batch Input Session?

BATCH INPUT SESSION is an intermediate step between internal table and database table. Data along with the action is stored in session i.e. data for screen fields, to which screen it is passed, program name behind it, and how next screen is processed.

  • Create session – BDC_OPEN_GROUP
  • Insert batch input – BDC_INSERT
  • Close session – BDC_CLOSE_GROUP

Q49. Name A Few Data Dictionary Objects?

Different types of data dictionary objects:

  1.  Tables
  2.  Views
  3.  Data elements
  4.  Structure
  5.  Matchcode
  6.  Domains
  7.  Search Helps
  8.  Local Objects

Q50. What Are The Advantages And Disadvantages Of Abap Query Tool?

  • Advantages: No programming knowledge is required.
  • Disadvantages: Depending on the complexity of the database tables, it may not be easy for the user to select the necessary data correctly.