001 SAP ABAP Interview Questions and Answers
001 SAP ABAP Interview Questions and Answers
001 SAP ABAP Interview Questions and Answers
Question 1: What is the difference between User Exit and Function Exit?
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Error or Success messages are returned in a RFC does not have a return table.
RETURN table.
The way SMARTFORM is developed and the way in which SCRIPT is developed is entirely different. Not
listing down those here. That would be too much.
Question 4:What is the difference between Call Transaction Method and the Session method ?
Question 7: What is the difference between SAP memory and ABAP memory?
Important
Question 8: What is the difference between AT SELECTION-SCREEN and AT SELECTION-SCREEN
OUTPUT?
AT SELECTION-SCREEN is the PAI of the selection screen whereas
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
AT SELECTION-SCREEN OUTPUT is the PBO of the selection screen.
Question 10: What is the difference between VIEW and a TABLE?A table physically stores data.
A view does not store any data on its own. It can contain data from multiple tables and it just
accesses/reads data from those tables.
Question 11: What is the difference between Customizing and Workbench request?A workbench
request is client independent whereas a Customizing request is client dependent.
Changes to development objects such as Reports, Function Modules, Data Dictionary objects etc. fall
under Workbench requests.
Changes in SPRO / IMG that define system behavior fall under customizing requests.
An example would be ‘defining number ranges’ in SPRO.
In short, generally a developer would end up creating a Workbench request and a Functional Consultant
would create a Customizing request.
Question 12: What is the difference between PASS BY VALUE and PASS BY REFERENCE?These concepts
are generally used for Function modules or Subroutines etc. and their meaning can be taken literally.
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
When we PASS lv_var by VALUE , the actual value of lv_var is copied into VAR.
When we PASS lv_var by REFERENCE , the reference or the memory address of lv_var is passed to the
Function module. So VAR and lv_var will refer to the same memory address and have the same value.
Question 13: What is the difference between Master data and Transaction data?Master data is data
that doesn’t change often and is always needed in the same way by business.
Ex: One time activities like creating Company Codes, Materials, Vendors, Customers etc.
Transaction data keeps on changing and deals with day to day activities carried out in business.
Transactions done by or with Customers, Vendors, and Materials etc. generate Transaction Data. So data
related to Sales, Purchases, Deliveries, Invoices etc. represent transaction data
Important
Question 14: What will you use SELECT SINGLE or SELECT UPTO 1 ROWS ?
What will you use SELECT SINGLE or SELECT UPTO 1 ROWS ?
There is great confusion over this in the SAP arena.
If you Google, you will see lots of results that will say SELECT SINGLE is faster and efficient than SELECT
UPTO 1 ROWS.
But that is 100% incorrect.
Question 15: What is the difference between .Include Structure and .Append structure?
I have seen ridiculous answers for this at many places on the Web.
The true answer is this:
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Let’s say you want to use the Structure X in your table Y.
With .Include X, you can include this structure in multiple tables.
With .Append X, you specify that structure X has been used in table Y and that this cannot be used in
any other table now. So you restrict structure X only to Table Y.
Important
Question 16: Can you describe the events in ABAP?
LOAD-OF-PROGRAM:
INITIALIZATION: If you want to initialize some values before selection screen is called
AT SELECTION SCREEN OUTPUT: PBO for Selection Screen
AT SELECTION SCREEN: PAI for Selection Screen
START-OF-SELECTION
END-OF-SELECTION
TOP-OF-PAGE
END-OF-PAGE
Question 17:
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Question 19: A system has two clients 100 and 500 on the same application server. If you make changes
to a SAPSCRIPT on client 100, will the changes be available in client 500?
No. SAPSCRIPT is client dependent. You will have to transport changes from client 100 to client 500.
However, for SMARTFORMS, Changes will be made both for client 100 and client 500.
Question 20: There are 1000’s of IDOCs in your system and say you no longer need some of them? How
will you get rid of those IDOCs?
Question 21: What is the difference between CHAIN … ENDCHAIN and FIELD commands in Module Pool?
If you want to validate a single field in Module Pool, you use the FIELD Command.
On error, this single filed is kept open for input.
If you however want to validate multiple fields, you can use the CHAIN … ENDCHAIN command. You
specify multiple fields between CHAIN and ENDCHAIN.
On error, all fields between CHAIN …… ENDCHAIN are kept open for input.
Question 22: What are the types of Function Modules? What is an UPDATE function module?There are
three types of Function Modules: Normal , RFC , UPDATE.
The aim of the Update function module is either to COMMIT all changes to database at once or to
ROLLBACK all the changes. By definition, an update function module is used to bundle all the updates in
your system in one LUW (logical unit of work).
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
This FM is called whenever COMMIT WORK statement is encountered in the calling program and the
way you call it is CALL FUNCTION XXX IN UPDATE TASK.
Question 23: How is the table sorted when you do not specify field name and Ascending or Descending?
On what criteria will the table be sorted? Do internal table have keys?
Question 24: Explain what is a foreign key relationship?Explain this with the help of an example.
Let’s discuss about tables EKKO (PO header) and EKPO (PO line item).
Can you have an entry in table EKPO without having an entry in table EKKO?
In other words can you have PO line items without the PO header?
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Question 25 : What is the difference between a value table and a check table?Check table is
maintained when you define foreign key relationships.
For Check table, read question above.
.
Value table is defined and maintained at a domain level.
At a domain level, you can mention allowed values in the form of:
1) Single values
2) Ranges
3) Value tableFor example, have a look at domain SHKZG. Only allowed values are S and H for
Debit/Credit indicator. Whenever and wherever you use this domain, the system will force you to use
only these two values: S and H.
Another example is domain MATNR. For this domain the value table is MARA.
So whenever and wherever, you use this domain the system will force you to use values for MATNR in
table MARA.
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Question 26: How do you find BAPI?Approach1:
You can go to Transaction BAPI and then search for your desired object.
Say you want to find a BAPI for creating users in the system, in such case you can search for the ‘User’
and find the relevant BAPIs.
Approach2:
Another way is to find a Business Object. Say you want to find a BAPI for creating Material in SAP and
you know the BO for Material is BUS1001006. You can go to Transaction SWO1 and enter the BO
BUS1001006 in the BOR. Then have a look at the methods for this BO.
Important
Question 27: How do you find BADI?
Approach1:
Go to Class CL_EXITHANDLER in SE24 ---> Put a breakpoint in method GET_INSTANCE.Now go and
execute your transaction code for which you want to find BADI.
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
You will find the BADI in the changing parameter exit_name:
Approach 2:
Go to Tcode SE84 Enhancements BADIs Definitions.
Find the package for the Tcode for which you are finding the BADI.
Enter it as shown and hit execute:
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Are we done yet ? Definitely not !
Let the questions come and lets keep on updating this blog.
Example: A Legacy system that is to be replaced by SAP has say 1000 Customers , 2000 vendors and
3000 materials. All this data needs to be transferred to SAP . In such cases , We can use BDC.
Important:
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Question 2: How do you do BDC for a table control?
With other things as usual, there is a special trick that you have to use while doing BDC for table control.
You need to use the BDC OKCODE '=P+'.
Its the BCD_OKCODE for Page down that can be used for scrolling down in table control.
Important:
Question3: Is there any method apart from BDC for data upload to SAP?
Apart from BDC and LSMW, you can use BAPIs to upload data into SAP.
BAPIs should be preferred over BDCs, because they process data faster than BDC.
A BAPI is faster since it updates Database "directly". Whereas BDC calls transaction and goes through
the whole screen sequence as any user would do.
BAPI BDC
BAPI is faster than BDC. BDC is relatively slower than BAPI.
BAPI directly updates database. BDC goes through all the screens as a normal
user would do and hence it is slower.
No such processing options are available in BAPI. Background and Foreground processing options
are available for BDC.
BAPI would generally used for small data BDCs would be preferred for large volumes of
uploads. data upload since background processing option
is available.
For processing errors, the Return Parameters for Errors can be processed in SM35 for session
BAPI should be used.This parameter returns method and in the batch input program for Call
exception messages or success messages to the Transaction method.
calling program.
The sessions are created at one point of time and processed at other point of time and this may create a
problem: For example: a BDC program creates a session for updating 1500 customers in SAP. However ,
before this session is processed via SM35 , a user inserts 100 customers in the system manually. In this
case , the session will have at least 100 errors when the session is processed from SM35.
One way to avoid this is to use the program "RSBDCSUB" in the batch input program itself so that the
session is processed as soon as it is created.
RSBDCSUB schedules the session to be processed in background.
Sample Screenshot:
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
BDC_OKCODE: is used for storing commands during the recording. like '/00' is the command for 'ENTER'
Key.
BDC_CURSOR: contains the cursor position. it contians the field in which cursor will be.
Example code:
perform bdc_field using 'BDC_CURSOR'
'PROJ-PSPID'.
perform bdc_field using 'BDC_OKCODE'
'=BU'.
Question 8: What are the 3 methods that we use in sequence in a Batch input session method ?
Identify the Tcode and do the recording in SHDB to populate the BDCDATA.
Once the recording is done , one can Transfer it to the Batch input program.
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
In the batch Input program , The transactional data is read from the file to an internal table.
Then one can loop over the transactional data in the internal table and start uploading the data in SAP
either by CALL TRANSACTION method or by creating sessions through the batch input program.
Question 11: What are the different modes of processing batch input sessions?
Foreground
Background
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Question 12: What is the difference between Synchronous and Asynchronous Update ?
In Synchronous update , the database is updated before the next transaction is taken for processing in a
batch input.
In Asynchronous update , the system doesn't wait for updating the database before the next
transaction is taken for processing in a batch input.
Question 14: How do you read files from the Application server ?
Question 15: How do you read files from the presentation server ?
You can use the Function Modules :
GUI_UPLOAD --> To read data from file into an internal table
GUI_DOWNLOAD --> To write data from internal table to a file on presentation server
If you found the post helpful , consider hitting the Google plus button------>
ALE IDocs in SAP is a lot about configuration and a lot about Tcodes . So if you have worked on at least one
end to end scenario in ALE IDocs in SAP , you probably already have answers to a lot of questions.
Cheers!!
But if you haven't , make sure you do this exercise. There are plenty of step by step guides to ALE IDocs
available on the internet . Make sure you read one understand it all the way . Sending IDoc from client 800 to
say client 810 on the same server is easy . If possible ,Try an exercise in which you send an IDoc from one
system to another system.
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Lets get started . Hope you get some value in these pages :)
Application layer refers to the application data ( SD , MM , FI or data for any SAP application ) . In this layer
the data is collected to be distributed and then sent to the distribution layer.
Distribution layer determines to whom should the data generated by the application layer has to be
distributed i.e. it is in the distribution layer that the recipient is determined , the data is formatted or filtered
and then an actual is created.
Communication layer takes the responsibility of delivering the Idoc to the receiving system and
communicates to the receiving system via tRFC , File ports , FTP or TCP/IP etc.
The transaction code to view an IDoc type (Basic and extension) is WE30.
Examples: ORDERS04, DEBMAS04, MATMAS04, CREMAS04.
These are all SAP standard Basic IDoc Types.
You can even have an IDoc extension in which you can use the existing Basic IDoc type and add extra
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
segments and fields to it. Usually we extend an IDoc when the standard SAP IDoc type is not able to
cater to the business process.
Question 4: What are the types of records in SAP ALE Idocs and where is this information stored ?
There are three types of records in SAP ALE Idocs:
Control Records: Control record information for an IDoc is stored in standard table EDIDC.
Data Records: Control record information for an IDoc is stored in standard table EDIDD.
Status Records: Control record information for an IDoc is stored in standard table EDIDS.
Question 5: What is an Idoc status? What are the different types of Idoc statuses that you know ?
When an IDoc is sent from one system to another , it goes through variuos stages.The IDoc status indicates
the stage that the Idoc in currently in.
There about 75 IDoc statuses.There is no way you can remember those all .
Don't even try to ! You will probably remember only those on which you have worked .
01 IDoc generated
02 Error passing data to port
03 Data passed to port OK
The common port types are the TRFC Port and the File Port.
If both sender and receiver mention TRFC ports, data is exchanged via RFC connections.
If however , a file port is mentioned , the IDOC is written in a flat file at the specified location at the sender
system.Then a FTP transfer should be done from that location to the receiver system or a Middleware that
will send the file to the receiver system.
Question 7: What is a Message type and Idoc Type ? What is the difference between Message type and an
IDoc type?
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
A Message type and an IDoc type are closely related . In fact, you will find that a Message type is always
associated with an IDoc type.Whereas an IDoc type is a detailed version with all the segments and fields , a
Message type is used just to specify the kind of information that a system can send or receive to or from
another system.
So If system SAP1 has a Partner Profile where it specifies MATMAS as an outbound message type , it just
means that SAP1 can send material master data to say system SAP2.
If system SAP1 has a Partner Profile where it specifies MATMAS as an inbound message type , it just means
that SAP1 can receive material master data from say system SAP2.
What all fields can be sent and received will be specified in the IDoc type.
Some other message types: DEBMAS( Customers), CREMAS(Vendors) belong to the Master data.
The link between a message Type and an IDoc type is maintained in Tcode WE82.
Question 8: What is a partner profile ? What are the types of partner profiles ?
To be able to communicate with a partner via an IDoc interface, each system needs to maintain a partner
profile. A partner profile is a mechanism by which the system can specify what kind of messages (message
types) it can send or receive.
Partner profiles can be maintained in WE20.
Question 12: Can you edit IDoc content for successful IDocs ?
No. You cannot.
Question 13: If you send an IDoc say 100008008 from system ECC1 to system ECC2, will the IDoc number in
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
ECC2 be 100008008?
No. The next number from the IDoc number range in ECC2 will be picked up.
More interview questions on ALE IDocs :
Question 14: How do you read data from an IDoc in a program ?
Question 15: How do you send Idoc from a program ?
Question 16: How do you achieve filtering in a distribution model ?
Question 17: Can I create a flat file from an IDOC ? If Yes , How ?
Question 18: You want to create and send an IDOC to another the moment a PO is created in
your system . How will you achieve this ?
Question 19: How to Reprocess Idocs in SAP?
Question 20: What is a change Pointer?
Question 21: What is serialization of Idocs?
Question 22: Important tcodes in ALE Idocs.
Question 23: Important programs in ALE Idocs:
SAP ABAP Interview Questions Part 3 : Smartforms
Welcome to yet another post on ABAP interview questions. Here I have complied a list of interview
questions on Smartforms in SAP. This list is quite comprehensive. Hope you find it useful. Cheers !!
Smartform is SAP's print form technology and is an alternative to SAP-Scripts. Whenever you
activate a Smartform , a function module is generated for that Smartform. The program that calls
this function module is called the Driver Program for Smartform. The T.code for Smartforms is
SMARTFORMS.
Unlike SAP-Scripts, Smartforms are client independent.
Here we go:
*An SAP R/3 system has 2 clients 800 & 810. You create an SAP Script Z_Script and a Smartform
Z_Smartform in client 800. Will both Z_Script and Z_Smartform be available in client 810 as well?
Client 200 will have just the Smartform Z_Smartform and not the SAP Script Z_Script.
SAP-Script is client dependent whereas SMARTFORM is client independent. Many people don't
understand what this is all about. The above answer should suffice. However, if you still do not
understand this, find an SAP system where you have 2 clients. Create a dummy Smartform / script
in one client and check whether they exist in the other client.
*You have created a Smartform in DEV environment. Then you migrated the Smartform to PROD
environment. Will the name of the function module be same in DEV and PROD?
Once you transport the Smartform from DEV to PROD environment, a new function module name
for the Smartform in generated in the PROD environment. For a particular Smartform , generated
function module names are different in different systems.One can get the name of the function
module for Smartform by passing the Smartform name to FM SSF_FUNCTION_MODULE_NAME.
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Hence in the driver program for Smartform, it is common practice to use FM
SSF_FUNCTION_MODULE_NAME and then calling the Smartform Function Module.
CONVERT_OTF
CONVERT_OTF_2_PDF
In the Driver program, import the parameter 'job_output_info' from the Smartform FM and utilize
that info in 'OTF' parameter of the two aforementioned function modules.
Here is one more and probably the easiest way to see PDF output for a Smartform.
Type PDF! in the command prompt and hit enter :).
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs
Set the Print mode to duplex to print on both sides of the Smartform.
Note: You have Page-protection property only for Text Elements in the Main Window.
Can you move a Smartform from one SAP system to another without using transports ?
Yes, this can be achieved using the Upload/Download feature for Smartforms.
One can download the Smartform from one system and save it as an XML file.
Once that is done, the XML file can be used to upload the Smartform in another system.
How do you find the name of the Function Module for a Smartform?
When is this function module created?
The function module for Smartform is created when the Smartform is activated.
You can find the name of the Function Module for a Smartform by going to
Environment --> Function Module Name.
http://www.sapyard.com/ HANA-ABAP, UI5, Fiori, OData, Personas, WF, Ariba, Adobe, OOPs