Question 1: What Is The Difference Between User Exit and Function Exit? User Exit Customer Exit
Question 1: What Is The Difference Between User Exit and Function Exit? User Exit Customer Exit
Question 1: What is the difference between User Exit and Function Exit?
User Exit
Customer Exit
User exit is implemented in the form of a
A customer exit can be implemented as:
Subroutine i.e. PERFORM xxx.
Function exit
Example: INCLUDE MVF5AFZZ
Screen Exit
PERFORM userexit_save_document_prepare. Menu Exit
Field Exit
Example: CALL Customer function xxx
INCLUDE xxx.
You modify this include.
In case of a PERFORM, you have access to
You have access only to the importing,
almost all the data. So you have better control, exporting, changing and tables parameter of
but more risk of making the system unstable. the Function Module. So you have limited
access to data.
User exit is considered a modification and not A customer exit is considered an
an enhancement.
enhancement.
You need Access Key for User Exit.
You do not need access key.
Changes are lost in case of an upgrade.
Changes are upgrade compatible.
User exit is the earliest form of change option Customer exits came later and they overcome
offered by SAP.
the shortcomings of User Exit.
No such thing is required here.
To activate a function exit, you need to create
a project in SMOD and activate the project.
Call Transaction
Call transaction method is when the data
volume is low
Call Transaction method is relatively faster
than Session method.
SAP Database is updated during the
execution of the batch input program.
Errors should be handled in the batch input
program.
BDC
BDC is relatively slower than BAPI.
BDC goes through all the screens as a normal
user would do and hence it is slower.
Subroutine
Subroutine can be called from other programs
also.
Can have any number of parameters.
This is not true for Subroutine.
Subroutine is defined inside:
FORM ..
..
ENDFORM.
Subroutine is used for modularization.
Question 7: What is the difference between SAP memory and ABAP memory?
SAP Memory
When you are using the SET/GET Parameter
ID command, you are using the SAP Memory.
SAP Memory is User Specific.
What does this mean?The data stored in
SAP memory can be accesses via any session
from a terminal.
ABAP Memory
When you are using the EXPORT IMPORT
Statements, you are using the ABAP Memory.
ABAP Memory is User and Transaction
Specific.What does this mean? The data
stored in ABAP memory can be accessed only
in one session. If you are creating another
session, you cannot use 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
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.
Say we are passing a variable lv_var:
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.
SELECT UPTO 1 ROWS is faster than SELECT SINGLE.
If for a WHERE condition, only one record is present in DB, then both are more or less
same.
However, If for a WHERE condition multiple records are present in DB, SELECT UPTO 1
ROWS will perform better than SELECT SINGLE.
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:
Lets 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
AT USER-COMMAND: When user click on say buttons in application toolbar. SY-UCOMM
AT LINE SELECTION: Double click by user on basic list. SY-LISEL
AT PF##: When User Presses any of the Function Keys
TOP-OF-PAGE DURING LINE SELECTION
Question 17:
What events do you know in Module Pool Programming?
PBO: you know this . If not you should know this . That's basic.
PAI: You know this. If not you should know this . That's basic.
POV: Process on Value request i.e. when you press F4.
POH: Process on help request i.e. when you press F1.
Question 18: Can you show multiple ALVs on a Single Screen?
Yes, there are multiple ways of doing this:
If you are using OOALV, you can create multiple custom containers
(cl_gui_custom_container) & put an ALV control (cl_gui_alv_grid) in each of those.
You can even use a Splitter container control and place multiple ALVs in each of
the split container.
If you are using Normal ALV, You can use the following FMS:
1. REUSE_ALV_BLOCK_LIST_INIT
2. REUSE_ALV_BLOCK_LIST_APPEND
3. REUSE_ALV_BLOCK_LIST_DISPLAY
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 1000s of IDOCs in your system and say you no longer need some
of them? How will you get rid of those IDOCs?
One way is to archive the IDOCs using transaction SARA.
But what the interviewer was expecting was How do you change IDoc Status?
There are different ways of doing this:
A) Use FM IDOC_STATUS_WRITE_TO_DATABASE
B) USE FMs:
EDI_DOCUMENT_OPEN_FOR_PROCESS and
EDI_DOCUMENT_CLOSE_PROCESS
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).
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.
Have a look at FM EDI_DOCUMENT_CLOSE_PROCESS_UPD and do a where used.
This FM is used as Update FM in case you make changes to IDoc contents/status via your
program.
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?
Yes, internal table have keys.
The default key is made up of the non-numeric fields of the table line in the order in which
they occur.
Question 24: Explain what is a foreign key relationship?Explain this with the help of an
example.
Lets 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?
How does this happen? The answer is foreign key relationship.
So foreign keys come into picture when you define relationship between two tables.
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.
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: