Details about Modularization techniques in SAP ABAP.
Modularization techniques in SAP ABAP.
Ans
:- They are used to organize the ABAP code in the proper way , make the program
more
Understandable
and make use of the code re-usable to avoid the duplicate data.
To divide the
business processing logic into reusable block of statements.
ü Following are the different
types of Modularization techniques
o
INCLUDES: These programs are part of another
main/include programs. Include
programs can’t be executed independently whereas the same include program can
be included in any no of executable programs. The ABAP statement INCLUDE is
used to call or define the INCLUDE programs.
o
Subroutines:
These are statements
local modularization techniques. The sub-routines can be debugged at run time.
Calling should be 1st & Definition should be next. The ABAP
statement PERFORM is used to call the sub-routines & FORM…ENDFORM is used
to define the sub-routines.
There
are 2 types of sub-routines.
I.
Internal
Subroutine:
These are defined & called in the same program.
II.
External
Subroutine:
These are defined in one program & called in another program.
Actual
Parameters:
The parameters which can be called while calling the subroutines (with PERFORM
statement).
Formal
Parameters:
The parameters which can be passed while defining the subroutine (with FORM
statement).
Ø The no of actual parameters
should be similar to the no of formal parameters.
Ø The sub-routines definitions
should not be nested (form with in the form) but the sub-routine can be called
within the sub-routine.
Ø The statements between 2
sub-routines definitions cannot be accessed
===================================================
o Macros: These are used for the
complex write statements & for long calculations. Macros can take up to 9
place holders (&1…. &9). In macros Definition should be 1st
& Calling should be next. The ABAP statement, DEFINE…END-DEFINTION is used
to define a macro. The macro definitions cannot be debugged at run time. The
standard table TRMAC pooled table is used to maintain macros.
o Function Modules: These are global modularization objects. The
function modules can be called any where in the same system & in another
system also. The function modules are defined in function builder.
========================================================================
The
T-code SE37 is used to work with the function modules & SE80 is used to
work with the function group. The function modules should be assigned to a
function group & Function group is the collection of function modules.
Ø The standard table ‘TFDIR’
is used to find FMs since it contains the entire Function module in the system.
Ø Normal Function Module: These are defined &
called in the same system to reuse the central source code.
Ø Remote Function Module: These are defined in one
system & can be called another system.
Ø Update Function Module: This is used for SAP LUW
(Logic Unit of Work). These function modules are triggered in case of implicit
or explicit COMMIT work is encountered. Commit Work is used to make changes in
data base permanently.
o Message class: This
tool is used to maintain the Messages in the message pool.
They
are used to give messages for instructing the users.
The
standard T-Code SE91 is used to work with the message pool.
Different types of messages are Error,
Success, Warning, Information, Abort, Exit.
Syntax:
MESSAGE ‘<MSG Text>’ type ‘E/I/W/S’.
====================================================
o Text symbols & Constants: The ABAP Statement TEXT followed by the
symbol number (XXX) can used to define or call the text symbol. Constants are
used to avoid the hard coded text and improve the reuse them in the program.
The
T-code SE63 is used to translate the different types of text elements.