Sap Abap Interview Questions and Answer
Sap Abap Interview Questions and Answer
LINKEDIN- https://www.linkedin.com/in/bijayasap
Ans – Domain is used for the technical information of the table field such as field type and length. It is created through SE11-
>Domain.
Internal tables provide a means of taking data from a fixed structure and storing it in working memory in ABAP. The data is stored line by line in
memory, and each line has the same structure. In ABAP, internal tables fulfill the function of arrays
IDoc (intermediate document) is a standard data structure used in SAP applications to transfer data to and from SAP system applications
and external systems. Using IDocs, companies with SAP ERP systems, for example, can exchange data with external entities like their partners
or customers
Internal table- stroing data in a fix format working on abap memory. It stores data line by line .
By using abap program we can store data. Standard Internal Table, Sorted Internal Tables, Hashed Internal Tables
Work area- its hold single row data . Work Area refers to a single row of a fixed structure. It is basically used for storing temporary data. It is commonly used while iterating over a loop.
EDI- EDI is an electronic business document exchange between business partners’ computer systems using a common
• Lowered Paperwork
• Reduced costs
• ALE
ALE supports the distribution of the business functions and process across loosely coupled SAP R/3 systems (different versions of SAP R/3). Connections
from R/2 and non SAP systems is also supported.
ALE is used to support distributed yet integrated processes across several SAP systems whereas EDI is used for the exchange of business documents
between the systems of business partners (could be non-SAP systems)
ALE is SAP’s technology for supporting a distributed environment whereas EDI is a process used for exchange of business documents which now
have been given a standard format
Both ALE and EDI require data exchange. An Idoc is a data container which is used for data exchange by both EDI and ALE processes.
BADI stands for Business Add Ins Just like Customer Exits , BADI help hook custom enhancements to SAP functionality
Define a BADI
Implement a BADI
Business Application Programming Interface(BAPI1) are standardized programming interfaces (methods) enabling external applications to access business
processes and data in the R/3 System.
BAPIs are defined in the BOR(Business object repository) as methods of SAP business object types that carry out specific business functions.They are
implemented as RFC-enabled function modules and are created in the Function Builder of the ABAP Workbench.
Ans – BADI is called Business Add-in. There are two types of BADIs – Classical BADI and New BADI.
• BADI is reusable
• Interface
SMARTFORMS
Ans – User Exits are a type of system enhancement that was originally developed for Sales and Distribution (SD) component.
It is a modification, as it requires you to change objects in SAP namespace. It creates a special include in module pool. Naming
After delivering, SAP never altes includes created in this manner. If new user exits have to be delivered in new release, they
Ans – Explicit Enhancement – It is the type of enhancement in which there is some pre-preparation done by SAP.
• ENHANCEMENT-POINT
• ENHANCEMENT-SECTION
• ENHANCEMENT-SPOT
Explicit Enhancement can be implemented getting into the Enhancement Mode by clicking the spiral button -> Right click into
the enhancement point you plan to implement and select Enhancement Implementation->Create. You will be asked a name of
the implementation and a description and after that you can add your code.
Implicit1BAPI Enhancement – It is the type of enhancement in which there is no pre-preparation done by SAP.
You can start this enhancement from anywhere. It can at the start of code, end of code, Start of function module, End of
function module.
You can see what are available by going into editor and go to edit -> Enhancement Operations -> Show Implicit Enhancement
Option.
Classical1 reports are normal reports. These reports are not having any sub reports. IT IS HAVING ONLY ONE SCREEN/LIST FOR OUTPUT.
Interactive1 Reports-As the name suggests, the user can Interact with the report. We can have a drill down into the report data. For example, Column
one of the report displays the material numbers, and the user feels that he needs some more specific data about the vendor for that material, he can
HIDE that data under those material numbers
Alv-abap list viewer enhance the output of report.sap provides a set of alv f-modules which can be used & it also improve the functionality & readability of any
report output.used to arranges the column in a report output.
Function modules--- Function module are sub program that contains set of reusable source code statement with import and export parameters.Function
module are sub prram that contains set of reusable source code statement with import and export parameters.
Output function modules-REUSE_ALV_GRID_DISPLAY,REUSE_ALV_LIST_DISPLA [0
Do you know any other FM s
: 1. REUSE_ALV_FIELDCATALOG_MERGE
2. REUSE_ALV_COMMENTARY_WRITE
3. REUSE_ALV_BLOCK_LIST_INIT
4. REUSE_ALV_BLOCK_LIST_APPEND
5. REUSE_ALV_BLOCK_LIST_DISPLAY
Function modules are general-purpose library routines that are available system-wide.
• TABLES: for passing internal tables only, by reference (that is, by address).
In contrast to LEAVE TO TRANSACTION, the CALL TRANSACTION statement causes the system to start a new SAP LUW. This
second SAP LUW runs parallel to the SAP LUW for the calling transaction.
There are three options for passing selection and parameter data to the report.
• Using SUBMIT…WITH
• SAP Scripting
• Featured snippet from the web
• SAP Scripts is used to generate formatted documents
and for external purposes to print and transfer business
documents. Formatted document contains logos, tables,
and other formatting objects. You can print preformatted
text in forms which are not possible with normal ABAP
codes.
Data Element – It is used not only the technical description but also the semantic information of the table field such as short
description. It can be created through SE11->Data Type -> Data Element option.
What is Data Class in Transparent Table settings?
Ans – It depicts how the data is stored in the table and determines in which tablespace it is stored. It is assigned in the
Classification
• APPL1 – Transaction Data. It is the Data that is related to day-to-day activity and frequently updated.
• APPL2 – Organizational and Customizing Data. It is the data when the system is initialized.
What is a Table maintenance generator in Data Dictionary?
Ans – It is a tool for maintaining the table ie. Users can create, edit and delete the entries in the table.
SE11 -> When table is displayed -> Utilities menu -> Table maintenance generator.
• Authorization Group
• Function Group
• Execute t-code SM30. Enter the table name and click on Maintain Button. Users can create entries for the table.
What are different types of views?
Ans – data are usally distributed among different table. Views is used to summarize these . view is a 'virtual table'
• The different 4 types of views are: Projection View - Just retrieves some fields from a single table.
• Help View - This is used for search help.
• Database View - This is inner join view of one or more tables.
• Maintenance View - Helps in creating maintaining data of the application object. The data can be distributed
among several tables
• It can be used as Online or Offline Interactive form to integrate the outside business user into the business process.
• SAP Adobe form uses Adobe Live-cycle Designer as a form designing tool which is completely integrated into SAPGUI
How to create Lock objects in Data Dictionary?
lock Object is a feature offered by ABAP Dictionary that is used to synchronize access to the same data by more than one program
Lock objects are function modules to avoid accessing data by two or more
users.
There are two types of lock objects are available, DEQUEE, ENQUEE
Type of locks:
Exclusive Lock: The locked data can be read or processed by one user only.
Shared Lock: Several users can read the same data at the same time, but as soon as a user edits the data, a second user can
no longer access this data.
Ans – Lock objects can be created through SE11. It starts with ‘E’ like EZlock. You have to specify the Table Name and Lock
UE_<lockobjectname>. This Enqueue and Dequeue method is used to lock and unlock any object in SAP ABAP.
AT SELECTION-SCREEN-Triggered after processing of the user input on the selection screen. This event verifies the user input prior to the execution of a
program. After processing the user input, the selection screen remains in the active mode.
START-OF-SELECTIONn-Triggered only after the processing of the selection screen is over; that is, when the user clicks the Execute icon on the selection
screen.
TOP-OF-PAGE-Triggered by the first WRITE statement to display the data on a new page
END-OF-PAGE-Triggered to display the text at the end of a page in a report. Note, that this event is the last event while creating a report, and should be
combined with the LINE-COUNT clause of the REPORT statement.
AT LINE-SELECTION
AT USER-COMMAND
AT PF<key>
‘REUSE_ALV_COMMENTARY_WRITE’.
Ans – This concept is basically used in the module pool. This is used to group the fields and used to carry out validations on
For eg:
CHAIN.
FIELD: s_field-ebeln, s_field-ebelp.
MODULE vdate_fields. "Validation contained in PAI module
ENDCHAIN.
Ans – The difference between Table and Template is that Table is dynamic in nature and Template is static in nature.
Which Function Module is used to get name of function module when smartform is activated?
Ans - SSF_FUNCTION_MODULE_NAME – When the SMARTFORM is activated, this function module is used to get the function
Ans –
• Function Module CONVERT_OTF is used to convert the OTF format to PDF
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = W_bin_filesize
TABLES
otf = T_OTF
lines = T_pdf_tab
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
ERR_BAD_OTF = 4
OTHERS = 5.
• To display File SAVE dialog windAt last, defining the Classes and methods as per as requirements of the end-
user.
MARA and MARC are the tables from where you can get the data for Material Master.
When will we go for call transaction and when we will go for a session in BDC?
The GET CURSOR command returns the name of the field at the cursor position in a field specified after the additional field,
and the value of the selected field in a field specified after the value.
Methods describe the functions of classes in ABAP objects. We can call methods using the call method statement.methods are
introduced with the method statement & concluded with the end method statement.methods can only be defined in the
Use table Table TNAPR / NAST in order to find the output type.
SY-DATUM
What is the keyword used to eliminate the leading zeros of a number field?
How can we read selected lines of a database table into an internal table in packages of predefined size?
How can we determine the table to which a field belong to by knowing only field name?
• Then navigate to R/3 Repository -> ABAP Dictionary -> Fields -> Table Fields
DATA DICTIONARY
What is a Data Class?
The Data class determines in which table space the table is stored when it is created in the database.
The Size category describes the probable space requirement of the table in the database.
How many types of size categories and data classes are there?
There are five size categories (0-4) and 11 data classes only three of which are appropriate for application tables:
• APPL2- Organizational data (customizing data that is entered when system is configured and then rarely changed).
• USR
The values specified for the size category and data class are mapped to database-specific values via control tables.
The function of the transport system and the Workbench Organizer is to manage any changes made to objects of the ABAP/4
Development Workbench and to transport these changes between different SAP systems.
A table pool (or pool) is used to combine several logical tables in the ABAP/4 Dictionary. The definition of a pool consists of at
These are logical tables, which must be assigned to a table pool when they are defined. Pooled tables can be used to store
brought together in a single physical record. The records from the cluster tables assigned to a cluster are thus stored in a
Each time you create a new object or change an existing object in the ABAP/4 Dictionary, you branch automatically to the
Domains, Data elements, Tables, Technical settings for tables, Secondary indexes for transparent tables, Structures, Views,
Conversion between ABAP/4 data types and the database layer is done within the database interface.
How is the conversion of data types done between ABAP/4 & the external level?
Conversion between the external layer and the ABAP/4 layer is done in the SAP dialog manager DYNP.
You can specify the extent sizes and the table space (physical storage area in the database) in which a transparent table is to
The correction system manages changes to internal system components. Such as objects of the ABAP/4 Dictionary.
Local objects (Dev class$TMP) are independent of correction and transport system.
Related objects from the ABAP/4 repository are assigned to the same development class. This enables you to correct and
In the ABAP/4 Dictionary Tables can be defined independent of the underlying database (T/F).
True.
ABAP/4 Dictionary contains the Logical definition of the table.
A field containing currency amounts (data type CURR) must be assigned to a reference table and a reference field.
Explain.
As a reference table, a system containing all the valid currencies is assigned or any other table, which contains a field with the
currency key format. This field is called as reference field. The assignment of the field containing currency amounts to the
reference field is made at runtime. The value in the reference field determines the currency of the amount.
A field containing quantity amounts (data type QUAN) must be assigned to a reference table and a reference field.
Explain?
As a reference table, a system table containing all the valid quantity units is assigned or any other table, which contains a field
with the format or quantity units (data type UNIT). This field is called as reference field.
The assignment of the field containing quantity amounts to the reference field is made at runtime. The value in the reference
What is the significance of Technical settings (specified while creating a table in the data dictionary)?
By specifying technical settings we can control how database tables are created in the database. The technical settings allows
us to
• Buffering required.
The table's attributes determine who is responsible for maintaining a table and which types of access are allowed for the table.
• Delivery class.
• Activation type.
• The delivery class controls the degree to which the SAP or the customer is responsible for table maintenance.
copy is performed.
What is the max. no. Of structures that can be included in a table or structure.
Nine.
• Customizing Includes.
• 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.
One.
If a table that is to be extended contains a long field, we cannot use append structures why?
Long fields in a table must always be located in the end, as the last field of the table. If a table has an append structure the
Can we include customizing include or an append structure with Pooled or Cluster tables?
No.
What are the two ways for restricting the value range for a domain?
Structures can contain data only during the runtime of a program (T/F)
True.
• Views
• Match Code.
• Lock Object.
The data of a view is not physically stored, but derived from one or more tables (T/F)
True.
Match code is a tool to help us to search for data records in the system. Match Codes are an efficient and user-friendly search
What is the max no of match code Id's that can be defined for one Match code object?
Can we define our own Match Code ID's for SAP Matchcodes?
Yes, the number 0 to 9 are reserved for us to create our own Match Code Ids for a SAP defined Matchcode object.
If the data in one of the base tables of a matchcode ID changes, the matchcode data has to be updated. The update type
stipulates when the matchcode is to be updated and how it is to be done. The update type also specifies which method is to be
used for Building matchcodes. You must specify the update type when you define a matchcode ID.
Yes.
• Update type I: Access to the matchcode data is managed using a database view.
• Update type L: Access to the matchcode is achieved by calling a function module.
What are the two different ways of building a match code object?
• Logical structure: The matchcode data is set up temporarily at the moment when the match code is accessed.
• Physical Structure: The match code data is physically stored in a separate table in the database. (Update type A, S,
P).
What are the differences between a Database index and a match code?
• Match code can contain fields from several tables whereas an index can contain fields from only one table.
• Match code objects can be built on transparent tables and pooled and cluster tables.
• A domain defines a value range, which sets the permissible data values for the fields, which refers to this domain.
• A single domain can be used as basis for any number of fields that are identical in structure.
No.
• Non-standard conversions from display format to sap internal format and vice-versa are implemented with so-called
conversion routines.
A data element describes the role played by a domain in a technical context. A data element contains semantic information.
Can you delete data element, which is being used by table fields.
No.
Can you define a field without a data element?
Yes. If you want to specify no data element and therefore no domain for a field, you can enter data type and field length and a
What is a view?
A view is a logical view on one or more tables. A view on one or more tables i.e., the data from a view is not actually physically
• Database View
• Help View
• Projection View
• Maintenance View
What is Locking?
When two users simultaneously attempt to access the same data record, this is synchronized by a lock mechanism.
Database utility is the interface between the ABAP/4 Dictionary and the underlying the SAP system.
It is a tool with which you can make data stored in the ABAP/4 Dictionary available.
If s_time has the value '123456' how would you get an output of 12:34:56 with a single 'Write:' statement.
In order to suppress the leading zeroes of a number field the keywords used are NO-ZERO.
The total no of date formats that can be used to display a date during output is MM/DD/YY, DD/MM/YY,
The UNDER Command allows for vertical alignment of fields one below the other.
In order to concatenate strings only for output purposes the command NO-GAP can be used in conjunction with
The no of decimal places for output can be defines within a write statement. (T/F).
Data can be moved from one field to another using a 'Write:' Statement and stored in the desired format. (T/F).
In the statement Write:/15(10) lfa1-lifnr. The values 15 and 11 can also be defined by variables (T/F).
False.
ULINE.
Write: sy-uline.
In order to skip a single line the number of lines need not be given as an assignment (T/F)
TRUE.
The "SKIP TO LINE line number" is dependent on the LINE-COUNT statement included in the report statement of
the program.
In order to skip columns the command used is POSITION <n>.
Background and foreground colors can be interchanged using the command Format Inverse.
In order to restore the system defaults for all changes made with the format statement is Format Reset.
Like ULINE the statement VLINE is used to insert vertical lines. (T/F).
False.
Suppressing the number signs (+/-) is carried out using the addition NO-SIGNS to the Write statement. (T/F).
False.
If SY-UZEIT has the value 6:34:45 it can be displayed as 063445 using No Edit Mask.
If the variable "Text" has the value 'ABCDEF' the output for the statement "Write:/Text+2(3)" will be "CDE"
The fields specified by select-options and parameters statement cannot be grouped together in the selection
screen. (T/F).
False.
When calling an external report the parameters or select-options specified in the external report cannot be called.
(T/F)
FALSE.
Selection Texts in the text elements of the program helps in changing the displayed names of variables in the
parameters statement.
Rounding off of values can be carried out using the write statement. (T/F).
TRUE
How would you define the exponents for a type 'f' field?
Exponent <e>.
How would you format the output as left, centered or right-justified using the write statement.
Left-justified, Centered, Right-justified.
If the same formatting options were used for a WRITE statement that follows the FORMAT statement, which
For each new event, the system resets all formatting options to their default values (T/F)
TRUE.
TRUE.
How would you set the formatting options statically and dynamically within a report? Statically: FORMAT
<option1>[ON|OFF]….</option1>
The processing block following END-OF-PAGE is processed only if you reserve lines for the footer in the LINE-
TRUE.
To execute a page break under the condition that less than a certain number of lines is left on a page is achieved
by RESERVE n lines.
The RESERVE statement only takes effect if output is written to the subsequent page. No blank pages are created
TRUE.
To set the next output line to the first line of a block of lines defined with the RESERVE statement the statement
BACK is used.
What is the limit for the length of a page if the page length is not specified in the report statement.
60,000 lines.
How would you start the printing process from within the program while creating a list?
FALSE.
Hotspots are special areas of an output list used to trigger events. (T/F).
TRUE.
Horizontal lines created with ULINE and blank lines created with SKIP can be formatted as hotspots. (T/F).
FALSE.
How would you suppress the display of a parameter on the selection screen?
For each SELECT-OPTIONS statement, the system creates a selection table. (T/F)
TRUE.
To position a set of parameters or comments on a single line on the selection screen, you must declare the
In the standard setting, you cannot create empty lines with the WRITE statement alone. (T/F).
TRUE.
REPORTING – GENERAL
The system field, which indicates success or failure of a SQL operation, is SY-SUBRC.
What is the syntax for specifying database table name at runtime in SELECT statement.
NAME = 'SPFL1'.
SELECT * FROM (NAME).
……………….
……………….
ENDSELECT.
How do you read selected lines of database table into an internal table in packages of predefined size.
Name the WILDCARD characters which are used for comparisons with character strings & numeric strings. '%'
and '-'.
In SELECT statements can you specify a variable in WHERE condition or a part of the condition, if so what is the
syntax.
Name the ABAP/4 key words, which are used to change the contents of database table.
UPDATE or MODIFY.
TABLES SPFLI.
SELECT * FROM SPFLI CLIENT SPECIFIED WHERE MANDT BETWEEN '001' AND '003'.
……..
ENDSELECT.
How do you write a DATA object from ABAP/4 program to ABAP/4 memory and restore the same from memory to
program.
EXPORT <f1> [FROM <g1>] <f2> [FROM <g2>] ... TO MEMORY ID <key>.
The ID <key>, which can be up to 32 characters long, identifies the data in memory.
You can group any complex internal data objects of an ABAP/4 program together in data clusters and store them temporarily in
ABAP/4 memory or for longer periods in databases. You can store data clusters in special databases of the ABAP/4 Dictionary.
These databases are known as ABAP/4 cluster databases and have a predefined structure. Storing a data cluster is specific to
ABAP/4. Although you can also access cluster databases using SQL statements, only ABAP/4 statements are able to decode the
Statements used to delete data objects in ABAP/4 memory FREE MEMORY [ID <key>].
ABAP/4 statement for opening a file on application server for reading Open dataset <dsn> for input.
Name the function modules to write data from an Internal Table to the Presentation Server.
Name the function module that can be used to give information about files on Presentation Server and about its
Operating System.
WS_QUERY.
Name the ABAP/4 key word, which is used to clear the Headerline of an Internal Table.
CLEAR
<itab> .
Name the function modules to read data from Presentation Server into an Internal Table.
Name the ABAP/4 keywords to initialize an Internal Table with and without headerline.
REFRESH <itab>.
Name the ABAP/4 key word for searching a string in an Internal Table.
Description
Enter a short, meaningful description of the variant. This may be upto 30 characters long.
Background only
Specify whether you want to use the variant in background processing only, or in online environment as well.
Protected variant.
Mark the field if you want to protect your variant against being changed by other users.
Mark this field if you want the variant name to be displayed in the catalog only, but not in the F4 value list.
For the selections you cover in a variant, you can enter the following attributes:
Type
Protected
Mark this field for each field on the selection screen you want to protect from being overwritten. Values that you mark this way
are displayed to the users, but they cannot change them, that are they are not ready to accept input.
Invisible
If you mark this column, the system will not display the corresponding field on the selection screen the user sees when starting
Variable
Mark this column if you want to set the value for this field at runtime.
Data types can be elementary or structured (T/F).
TRUE.
Data objects are the physical units a program uses at runtime. (T/F).
TRUE.
The data object does not occupy any space in memory. (T/F)
FALSE.
What are the three hierarchical levels of data types and objects?
How would you find the attributes of a data type or data object?
Step loops fall into two classes: Static and Dynamic. Static step loops have a fixed size that cannot be changed at runtime.
Dynamic step loops are variable in size. If the user re-sizes the window the system automatically increases or decreases the
number of step loop blocks displayed. In any given screen you can define any number of static step loops but only a single
dynamic one.
A current screen processing terminates when control reaches either a Leave-screen or the end of PAI.
How the transaction that are programmed by the user can be protected?
A program asks the system to perform a certain task, and then either waits or doesn't wait for the task to finish. In
synchronous processing, the program waits: control returns to the program only when the task has been completed. In
asynchronous processing, the program does not wait: the system returns control after merely logging the request for
execution.
Commit-Work statement "performs" many functions relevant to synchronized execution of tasks. Rollback-work statement
• Semantic Integrity.
• Relational Integrity.
• Operational integrity.
The tables.
Shared lock
Exclusive lock.
What are the events by which we can program "help texts" and display "possible value lists"?
What is a matchcode?
A matchcode is an aid to finding records stored in the system whenever an object key is required in an input field but the user
Does the external program run in the same SAP LUW as the caller, or in a separate one?
BACKGROUND TASK (ALE applications). These always run in their own (separate) update transactions.
We can send a report to the printer instead of diplaying it on the screen. To do this, use the keywords TO SAP-SPOOL:
SPA/GPA parameters are field values saved globally in memory. There are two ways to use SPA/GPA parmeters:
BDC
The first step in a BDC session is to identify the screens of the transaction that the program will process. Next step is to write a
program to build the BDC table that will be used to submit the data to SAP. The final step is to submit the BDC table to the
system in the batch mode or as a single transaction by the CALL TRANSACTION command.
The information on the current screen can be found by SYSTEM 􀃆 STATUS command from any menu.
The data in BDC tables is saved by using the field name 'BDC_OKCODE' and field value of '/11'.
In all BDC tables the last entry is to save the data by using the field name BDC_OKCODE and a field value of '/11'.
To populate data into a multiple line field, an index is added to the field name to indicate which line is to be populated by the
Does the CALL TRANSACTION method allow multiple transactions to be processed by SAP?
No. The CALL TRANSACTION method allows only a single transaction to be processed by SAP.
Yes.
• N - Show no screens.
In BDC, list down all the functional modules which are used in sequence?
By using BDC programming, there are 3 functional modules which are used in sequence for performing data transfer
• BDC_OPEN_GROUP
• BDC_INSERT
• BDC_CLOSE_GROUP
• Layout set
• Symbols
• SAPscript Text,
What is Badi?
Business Add-In or BADI is referred to as a new SAP Object Oriented enhancement technique which is utilized for adding our
own business functionality to the already pre-existing SAP standard functionality. BADI can also be inserted into the SAP
System meant for accommodating the user requirements and these are very precise to be included in the standard delivery.
Internal tables are meant for serving the purpose of pulling the data from a fixed structure and preserving it in the working
memory in ABAP. The data is preserved line by line in memory, and each line encompasses similar structure, and these data
• Organization Data: The data here is customized and is entered into the system once the system is configured, and
How can we format the data prior to the write statement in the report?
The user can format the report output by using the loop event.
• .at first
• .at new
• .at last
All non Y or Z programs are standard SAP programs, therefore the user cannot create an ABAP program without using Y or Z.
What is a foreign key relationship?
A foreign key relationship can be referred to a relationship that can be defined between tables and should be clearly defined at
field level. Foreign keys are utilized for ensuring consistency of data. The Data entered must be verified against existing data in
order to clear out any contradiction. It must be ensured that while defining foreign key relationship cardinality should be very
clearly specified.
Note: Cardinality lists the number of dependent records or how referenced records are achievable.
There are 7 types ABAP report in SAP are present in reports attributes screen. These are all listed below:
• Executable program.
• Interface pool.
• Function groups.
• Include.
• Class pool.
• Module pool.
• Subroutine pool.
List the various steps involved for adding value help for the parameter in ABAP CDS Analytical Query?
• First, create an ABAP CDS view for dictionary based on any dummy table
• Now Creating an ABAP CDS analytical query with the required logic
• At last result query in Analysis for Excel. Value help button exist
An ABAP search provides type-ahead functionality primarily for the elementary search helps and are known as Predictive
Search Helps.
How can the user add subtotal text in ABAP ALV Grid?
Listed below are the steps for adding the subtotal in the ABAP ALV grid:
There are various advantages of utilizing ABAP in IDE eclipse over ABAP editor:
• The user can create CDS views and AMDP's which ultimately push down the code to database level and help in
• All the CDS views created in IDE are available in SE11 and user can utilize them in your programs in SE38.
• User can make modifications in their program while debugging and activating your program while in debug mode
and user can then proceed with debug along with the new changes.
• User can create multiple projects and create your stuff inside it.
• In WEB IDE, the User has the advantage of using advanced SQL.
Distinguish between READ TABLE <ITAB> WITH KEY and READ TABLE <ITAB> WITH TABLE KEY in SAP ABAP?
For all table types, the search is linear. The runtime is in linear relation to the number of table lines.
Listed below are the system searches for the relevant table types:
INTERNAL tables -- Standard tables: It is a linear search, where the runtime is in linear relation with the number of table
entries.
• Sorted tables: it is binary search where the runtime is in logarithmic relation to the number of table entries.
• Hashed tables: By using the hash algorithm of the internal table, the entry is found. The runtime is completely
Field symbol points (known as pointers in C language) to something. That could be a table, a field or simply nothing. By
nothing, I am referring to that structure of a field symbol which can be dynamically determined. A field symbol can be utilized
in any operand position in this is visible and also matches the typing defined utilizing typing.
How many ABAP report types in SAP are available in reports attributes screen?
There are 7 ABAP report types available in SAP in the reports attributes screen.
• Class pool
• Function group (containing function modules)
• Executable program.
• Interface pool
• Module pool
• Subroutine pool
ABAP/4 Query is a very strong tool which is used for generating simple reports without any coding. The following 3 simple
For creating an ABAP/4 Query, the programmer should create a user and a functional group. The functional group can be
created by using with or without logical database table. Finally, assigning the user group to functional group. Finally, creating a
SE16 is a data browser and it is used to view the contents of the table and we cannot change or append new fields to the
existing structure of the table as we cannot view the structure level display using the SE16.
Table Maintenance Generator (TMG) is a tool which is created using t-code SM30. TMG is used to create a equipment by which
customized tables created by end users can be changed as required, such as making an entry to that table, deleting an entry
etc.
How should the user tick an option in Standard Tcode like LB10 along with 'Partially Delivered'?
In case there is no additional condition meant for checking the 'Partially Delivery' checkbox, the user can then select the
Once the transaction variant has been created, then activating the variant and checking the LB10 transaction.
How can the user SUBMIT PROGRAM with Selection Screen For a SLIN T-code?
User can utilize the FM EXTENDED_PROGRAM_CHECK instead of SUBMIT REPORT. This will provide you similar results.
• swo1 T CODEBAPIs are defined in the BOR(Business object repository) as methods of SAP business object types that carry out
specific business functions.They are implemented as RFC-enabled function modules and are created in the Function Builder of the ABAP
Workbench. BAPIs for Reading Data – GetList() , GetDetail() , GetStatus() , ExistenceCheck()
• BAPIs for Creating or Changing Data- Create() ,Change(),Delete() and Undelete() ,
• BAPIs for Mass Processing -ChangeMultiple(), CreateMultiple(), DeleteMultiple(
I am required to update equipment status as inactive & delete. So I am using function module
STATUS_CHANGE_INTERN_VB & this is working fine, however, it doesn’t have exceptions for handling the error
messages & even sy-subrc getting 0 if it fails u request you to please suggest me how to handle this scenario? Is
This FM is an ‘update task’ FM, generally Open-SQL statements, not much check, so no to be called in customer development.
The best solution would be a BAPI (this is easy to find with any search tool) and when none is available or without required
parameter some ‘dialog’ FM like STATUS_CHANGE_INTERN/EXTERN after analyzing the application behaviour and if BDC is also
no longer suitable.
This is not recommended, as it will cause a major performance issue. It will run the query every time it loops and you are
using “Select * …” which means you are fetching all fields of that table, assuming if tables have millions of entries then in
every iteration, your select query will go around millions of records in the table. Therefore, it could lead to serious performance
issues.
Instead of this, it is advised that you use 'For all entries…' the statement, it will fulfil your requirement.
A singleton is a design pattern where the class is required to create objects. The class ensures that only one object exists for
every internal session which is available to consumers. Therefore, when you create a singleton class it does not allow you to
create multiple instances of the class, instead, a single instance will be created which behaves as a global access point to
A class which only contains static components and no instance components is known as a static class. The user can directly
access the components using the “=>” operator. A global static class is loaded once with its class pool into the current internal
session. Like every ABAP program, it cannot be clearly deleted from the session. In subclasses, the static methods (declared
Two ways:
if abc is initial.
endif.
I have 100 records in a table, how can I simultaneously Delete the 5th, 10th, 15th, 20th......records, write a code
for it
if lv_var1 = 0.
"do nothing
else.
append lw_tab to lt_tab1.
endif.
clear: lv_var1, lw_tab.
endloop.
Using condense keyword in string all consecutive blank spaces are converted into a single space.
1-What is DDIC
DDIC is the central storage area, which allows users to maintain the repository objects related to the particular database and contains the central
description of all the data used in the SAP system
2-What is domain
Domain is a central object for describeing the technical characterstic of the attributes of a business objects.it describes the VALUE Range of a field
The relationship between the field or component and the domain is defined by the data element of the field or component
Its represente to DB . where data are present ,store data physically,have a pkey, technical attributes. Attributes-Methods-Events-Types and
constants
Types- it is define globally and any changes in types its referlected to all program that make same types
Lock Object – offered by abap dicitionary acess to same data by more than one program
7-Data elements - describe the individual fields in the ABAP Data Dictionary. They are the smallest indivisible units of the complex types, and
they are used to define the type of table field, structure component or row type of a table.
SE11-CREATE-
8-Data type-this is the operating system allocates memory and decides what can be stored in the reserved memory.
9-What is structure
is a data object that is made up of components of any data type stored one after the other in the memory. may have only a single record at run-
time, but a table can have many records. SE11- Click ‘Data type’ option screen Enter nameCreate- option 'Structure' screen Enter.see 'Maintain /
Change Structure'- ShortDescription- (Data Element)
SM30 is a tool used to customize the tables created by end users and can be changed as required, such as making an entry to that table,
deleting an entry etc. Before saving the data in the database. After saving the data in the database. Before deleting the data displayed.After
deleting the data displayed.Creating a new entry. Exit editing
Used to allow the user to control the database selections of the report.Allows interactive.Assignment of values to variables With
the PARAMETERS statement.Determine selection criteria for database fields.Single values, range of values, sets of values,
...With the SELECT-OPTIONS statement. PARAMETERS for single fields. SELECT-OPTIONS for complex selections.
SELECTION-SCREEN for formatting the selection screen and defining user-specific selection screens.
An event is a set of outcomes that are defined in a class to trigger the event handlers in other classes. When an event is triggered, we can call
any number of event handler methods. The link between a trigger and its handler method is actually decided dynamically at run-time.
AT SELECTION-SCREEN-Triggered after processing of the user input on the selection screen. This event verifies the user input prior to the execution of a
program. After processing the user input, the selection screen remains in the active mode.
START-OF-SELECTION-Triggered only after the processing of the selection screen is over; that is, when the user clicks the Execute icon on the selection screen.
TOP-OF-PAGE-Triggered by the first WRITE statement to display the data on a new page
END-OF-PAGE-Triggered to display the text at the end of a page in a report. Note, that this event is the last event while creating a report, and should be
combined with the LINE-COUNT clause of the REPORT statement
sub-programs that contain a set of reusable statements with importing and exporting parameter
SE38- create a new prog-put parameter vlue-pass to function module-ctrl f6-call function-enter ‘spell_amunt’- enhance the IF statement to
include a code to WRITE-f-module return value of sy-subrc add else stmnt- call the result-f-module return in_words-like srmnt refer structure
spell-save-active-execute
Step 2 : Click the Goto menu-there will be function groups word.click it..There will be create,display,change...
step 4 : Plz give the name and short description and save it in repective package
define relationships between tables in the ABAP Dictionary, create value checks for input fields and link several tables in a view or a lock object.
The pair of fields for the two tables must have the same data type and length
The primary table key of a standard table can also be empty, meaning that it does not contain any key fields.Each internal table has a primary
table key that enables access to individual rows in the table by means of a key specification.
Indexes are used to avoid the duplicate data and improve the performance while accessing the table. The different types of indexes are
Primary Indexes: Primary indexes in SAP are created automatically by the SAP system using key fields of database tables.
Secondary Indexes: Secondary Indexes are created manually and managed by the SAP ABAP consultant. We can create up to 9 secondary
indexes. In real time, secondary indexes are not advisable, it is allowed based on the requirements of project.
SAP Menu > Tools > ABAP Workbench > Development > SE11 – ABAP Dictionary
set a break point in side the smartform-BREAK <USERNAME>.-Then at the time of print/ preview the program stops there. SFTRACE can be used for debugging
SMARTFORMS
you need to have that table in the global declaration for the smartform.... The tables you declares in smartforms you can use loop & use the data
of table.For reading line item of table you need to use loop.Right click on window & select Create then Flow logic & Loop.in this loop provide you
internal table name & work area.For writing code in smartform follow this:Right click on window & select Create then Flow logic & Program lin
23-What is subroutine(SE80) -reusable sections code.use make program shorter as well as easier to read & understand bcz thy break program code into smaller
secrtions.FROM<SUBROUTINE_NAME> <STATEMENTS> END FORM.
A transport request collects development objects and categories for export to your local computer or to an SAP transport system.
BATCH CODE COMMUNICATION IT S AN AUTOMATIC PROCEDURE TO TRASFER LARGE&EXTERNAL DATA INTO SAP SYSTEM
Enhancements are transport objects in their own right that can be stored in packages of their own unlike modifications, which are part of
the object they modify. Since during an upgrade all SAP objects are replaced by the new version of these objects, after the upgrade all
modifications are gone.
Why do we need enhancement in SAP ABAP?
The enhancement concept allows you to add your own functionality to SAP's standard business applications without having to modify
the original applications.
In ABAP programming we define own data types using the statement. TYPE: allows you to construct new data types. The new data types are
linked to the database objects and can be referenced them using LIKE.
REUSE_ALV_GRID_DISPLAY is function module which is used to display the output in grid format.The input for this function module are two internal tables ie
one internal table for data and another for internal table for about the fields.
Used to allow the user to control the database selections of the report.Allows interactive.Assignment of values to variables With
the PARAMETERS statement.Determine selection criteria for database fields.Single values, range of values, sets of values,
...With the SELECT-OPTIONS statement. PARAMETERS for single fields. SELECT-OPTIONS for complex selections.
SELECTION-SCREEN for formatting the selection screen and defining user-specific selection screens.
An event is a set of outcomes that are defined in a class to trigger the event handlers in other classes. When an event is triggered, we can call
any number of event handler methods. The link between a trigger and its handler method is actually decided dynamically at run-time.
AT SELECTION-SCREEN-Triggered after processing of the user input on the selection screen. This event verifies the user input prior to the execution of a
program. After processing the user input, the selection screen remains in the active mode.
START-OF-SELECTION-Triggered only after the processing of the selection screen is over; that is, when the user clicks the Execute icon on the selection screen.
END-OF-SELECTION-Triggered after the last statement in the START-OF-SELECTON event is executed.
TOP-OF-PAGE-Triggered by the first WRITE statement to display the data on a new page
END-OF-PAGE-Triggered to display the text at the end of a page in a report. Note, that this event is the last event while creating a report, and should be
combined with the LINE-COUNT clause of the REPORT statement.
Warning
Error
Information
Success
The MESSAGE command displays messages defined by a message ID specified in the REPORT statement at the beginning of the program
E-ERROR-The message appears and the application halts at its current point. If the program is running in background mode, the job is canceled
and the message is recorded in the job log.
W-WARNING- The message appears and the user must press Enter for the application to continue. In background mode, the message is
recorded in the job log.
Information A pop-up window opens with the message text and the user must press Enter to continue. In background mode, the message is
recorded in the job log.
Abend -This message class cancels the transaction that the user is currently using
S- Success -This provides an informational message at the bottom of the screen. The information displayed is positive in nature and it is just
meant for user feedback. The message does not impede the program in any way.
X-Abort-This message aborts the program and generates an ABAP short dump.
SE38- create a new prog-put parameter vlue-pass to function module-ctrl f6-call function-enter ‘spell_amunt’- enhance the IF statement to
include a code to WRITE-f-module return value of sy-subrc add else stmnt- call the result-f-module return in_words-like srmnt refer structure
spell-save-active-execute
Step 2 − Enter some code so that a parameter can be set up where a value could be entered and passed on to the function module. The text
element text-001 here reads ‘Enter a Value’.
Step 3 − To write the code for this, use CTRL+F6. After this, a window appears where ‘CALL FUNCTION’ is the first option in a list. Enter
'spell_amount' in the text box and click the continue button.
Some code is generated automatically. But we need to enhance the IF statement to include a code to WRITE a message to the screen to say "The
function module returned a value of: sy-subrc” and add the ELSE statement so as to write the correct result out when the function module is
successful. Here, a new variable must be set up to hold the value returned from the function module. Let's call this as 'result'.
Step 5 − The variable which the function module returns is called IN_WORDS. Set up the corresponding variable in the program called ‘result’.
Define IN_WORDS by using the LIKE statement to refer to a structure called SPELL.
Step 6 − Save, activate and execute the program. Enter a value as shown in the following screenshot and press F8.
Polymorphism-Poly means more and morph means form. A single function can have more than one form inside the class is called polymorphism
Data Abstraction-Without knowing the background details, we can act over the data is called data abstraction.
inheritance-Adding some additional features to an existing class without modifying it is called inheritance. This is possible by deriving a new
class from the existing class. The existing class is called base class. And the class which derives from the base class is called child class. The child
class will have properties of both base as well as child class. 5 types of inheritance such as Single or Simple-Multilevel-Hierarchical-Multiple-
Hybrid
Static binding-Binding is nothing but the association of a name with the class. Static binding is a binding in which name can be associated with
the class during compilation time, and it is also called as early Binding.
Dynamic binding is a binding in which name can be associated with the class during execution time, and it is also called as Late Binding
Between Abstract Class And Interface-abstract class is a class which contains at least one abstract method( Method without implementation),
Abstract class contains methods with implementation and without implementation and we cannot create instance for the abstract class .Abstract
class is mainly for inheritance .Interface contains methods without implementation.
Constructor & Destructor- It’s a member procedure of the class get execute automatically when object allocates memory. It the same name of
the class which may or may not take parameters but does not return value.
It’s a member procedure of the class get execute automatically when object de-allocates memory. It the same name of the class preceded by
~(tilled) symbol which neither take parameters nor return value.
Object-Object is the real world entity.the instance of the class using which we can access public member of the class.
constructor-three types – Default Constructor – With no parameters.– Parametric Constructor – With Parameters. Create a new instance of a
class and also passing arguments simultaneously.– Copy Constructor-– Which creates a new object as a copy of an existing object
Inline function & friend function- An inline function is a technique used by the compilers and instructs to insert complete body of the function
wherever that function is used in the program source code. A friend function is a friend of a class that is allowed to access to Public, private or
protected data in that same class. If the function is defined outside the class cannot access such information.
copy constructor-This is a special constructor for creating a new object as a copy of an existing object. There will always be only one copy
constructor that can be either defined by the user or the system
structure and a class-Structure default access type is public , but class access type is private. A structure is used for grouping data whereas class
can be used for grouping data and methods. Structures are exclusively used for data, and it doesn’t require strict validation , but classes are used
to encapsulates and inherit data which requires strict validation.
Function overloading-Declaring same function more than one time inside a class with different in signature is called function overloading.
Different in signature means either no of parameters is different ortype of parameters is different or sequence of parameters is different. But
different in return value having no impact on function overloading
Function overriding-Declaring same function in both base and derive class with same signature is called function overriding.
-
Method Overriding Method overriding allows a subclass to override a specific implementation of a method that is already provided by one of
its superclasses.
Abstract class-An abstract class is a class which cannot be instantiated. Creation of an object is not possible with an abstract class, but it can
be inherited. An abstract class can contain only Abstract method. Java allows only abstract method in abstract class while for other languages
allow non-abstract method as well.
interface-An interface is a collection of an abstract method. If the class implements an inheritance, and then thereby inherits all the abstract
methods of an interface.
Explicit Enhancement –
It is the type of enhancement in which there is some pre-preparation done by SAP. 3
components in this enhancement.-ENHANCEMENT-POINT-ENHANCEMENT-SECTION-ENHANCEMENT-SPOT
Implicit Enhancement – It is the type of enhancement in which there is no pre-preparation done by SAP.You can start
this enhancement from anywhere. It can at the start of code, end of code, Start of function module, End of function module .
'Refresh' is the keyword that is used to clear the contents of a body in an internal table.
In which event of the report we can handle radio buttons?– AT-SELECTION SCREEN OUTPUT
How would you add the logo to ALV report? Logo can be added in ALV Report by using
FM ‘REUSE_ALV_COMMENTARY_WRITE’.
create Lock objects in Data DictionaryLock objects can be created through SE11. It starts with ‘E’ like EZlock. You have to
specify the Table Name and Lock Mode. Specify the Lock Parameter .
How to copy table across clients-Use Program RSCLTCOP.
field belong to by knowing only field name-First, use t-code SE84-Then navigate to R/3 Repository -> ABAP Dictionary -> Fields -> Table
Fields -Now insert the field name and execute...-A list of table where the field is used is will be shown.
Local classes and interfaces are part of ABAP program can only be used within the program in which they are Global classes and interfaces are stored centrally in the class repository and are available throughout the SAP
defined. system.
Local classes consist of ABAP source code, enclosed in the ABAP statements CLASS.. ENDCLASS Global classes are defined with GUI of Class Builder ( Tcode SE24 )
Local class name can begin with any character. User defined Global class name must start with Y or Z.