Modularization Techniques Interview Question
Modularization Techniques Interview Question
Subroutines
include programs
Macros
Functions
5. Data can be passed between calling programs and the subroutines using paramet
ers.
True.
6. What are the different types of parameters?
Formal Parameters:
Parameters, which are defined during the definition of subroutine with
the FORM statement.
Actual Parameters:
Parameters which are specified during the call of a subroutine with the
PERFORM statement.
7. What are the different methods of passing data?
Calling by reference:
During a subroutine call, only the address of the actual parameter is trans
ferred to the formal parameters.
The formal parameter has no memory of its own, and we work with the field of the
ce.
Declaring data as common parts is not possible for function modules.
Function modules are stored in a central library.
13. What is a function group?
Ans.
A function group is a collection of logically related modules that share global
data with each other. All the modules in the group are included in the same main
program.
When an ABAP/4 program contains a CALL FUNCTION statement, the system loads the
entire function group in with the program code at runtime. Every function module
belongs to a function group.
Importing parameters
Exporting parameters
Changing parameters
Tables parameters
Exceptions
21. what are the 2 includes creaated automatically whenever we create a function
module?
Ans:
1) Lfm_nameTOP
2) Lfm_nameUXX
22.What are the different Processing Types of Function Modules?
Ans:
The different types of function modules are:
a) Normal function modules
b) Remote enabled function modules
c) Update function modules
23.What are the various ways of raising exceptions in fuction modules?
Ans:
There are two ABAP statements for raising exceptions. They can only be used in f
unction modules:
1)RAISE .
2)MESSAGE..... RAISING .
The effect of these statements depends on whether the calling program handles th
e exception or not. If the name <except> of the exception or OTHERS occurs in th
e EXCEPTIONS addition of the CALL FUNCTION statement, the exception is handled b
y the calling program.
If the calling program does not handle the exception .The RAISE statement termin
ates the program and switches to debugging mode. The MESSAGE ..... RAISING state
ment display the specified message.
How the processing continues depends on the message type. If the calling program
handles the exception, both statements return control to the program.
No values are transferred. The MESSAGE ..... RAISING statement does not display
a message.Instead, it fills the system fields SY-MSGID, SY-MSGTY, SY-MSGNO, and
SY-MSGV1 to SY-MSGV4.
24.What are the difference between Function Modules and Form Routines?
Ans:
There are significant differences between function modules and form routines:
1)Function modules must belong to a pool called a function group.
They possess a fixed interface for data exchange. This makes it easier for
you to pass input and output parameters to and from the function module. For ex
ample, you can assign default values to the input parameters.
2)The interface also supports exception handling.
This allows you to catch errors and pass them back to the calling program
for handling.
3 )They use their own memory area.
The calling program and the function module cannot exchange data using
a shared memory area - they must use the function module interface. This avoids
unpleasant side effects such as accidentally overwriting data.
4)The Function Builder allows you to develop, test, and document new functi
on modules. You can also use it to display information about existing function m
odules.
25. Explain the following tabs appearing in SE37:
a) import
b) export
c) changing
d) tables
e) exceptions
f)source code
Ans:
a)import:
Contains a list of the formal parameters that are used to pass data to a
function module. For further information, refer to Displaying Information about
Interface Parameters .
b)export:
Contains a list of the formal parameters that are used to receive data from a fu
nction module. For further information, refer to Displaying Information about In
terface Parameters
c)changing:
Contains a list of the formal parameters that are used both to pass data to
and receive data from a function module. For further information, refer to Displ
aying Information about Interface Parameters .
d) tables:
Specifies the tables that are to be passed to a function module. Table
parameters are always passed by reference. For further information, refer to Dis
playing Information about Interface Parameters
e)exceptions:
Shows how the function module reacts to exceptions. For further
information, refer to Displaying Information about Interface Parameters
f)source code:
Program code of the function module.
a single bound functionality while a BAPI object can contain many functionalit
ies.
28) Explain the ways in which UPDATE FUNCTION MODULE is used in a BDC?
Ans:
Function modules that run in the update task can run synchronously or asynchrono
usly. You determine this by the form of the commit statement you use:
COMMIT WORK
This is the standard form, which specifies asynchronous processing. Your program
does not wait for the requested functions to finish processing.
COMMIT WORK AND WAIT
This form specifies synchronous processing. The commit statement waits for the r
equested functions to finish processing. Control returns to your program after a
ll high priority (V1) function modules have run successfully.
The AND WAIT form is convenient for switching old programs to synchronous proces
sing without having to re-write the code. Functionally, using AND WAIT for updat
e-task updates is just the same as dialog-task updates with PERFORM ON COMMIT.
29 What is Modularization and its benefits?
Ans.
If the program contains the same or similar blocks of statements or it is requi
red to process the same function several times, we can avoid redundancy by usin
g modularization techniques. By modularizing the ABAP/4 programs we make them ea
sy to read and improve their structure. Modularized programs are also easier to
maintain and to update.