5 - Modularization Techniques
5 - Modularization Techniques
1
Modularization Techniques
▪ Modularization is a technique used to divide the application program into smaller units.
▪ This helps to maintain the code in an easy manner and reduce the code redundancy.
Include Programs/Includes
Function Modules
Subroutines
Class-Methods
2
Include Programs/Includes
▪ We can create include programs with the help of SE38( ABAP Editor).
▪ The most important use of include programs is for lengthy data declarations used in
different programs.
3
Include Programs/Includes
<include program name>. Example - include program name is ZDATA. The syntax to
4
Function Modules
▪ It is a modularization technique.
5
Function Group
6
Tabs of Function Modules
Attributes - It provides the generic information about the function module like - date,
8
Calling of Function Modules
▪ We can call the function module in a program through the pattern button.
▪ Click on the pattern button and pass the function module name by choosing
9
Subroutines
1
0
Types of Subroutines
2. External Subroutines - Subroutines which are created in one program and used in
1
1
Syntax for Calling of Subroutine - Without Parameters
1
2
Syntax for Calling of Subroutine - With Parameters
▪ We cannot change the sequence of tables using changing , but if any of them
1
3
Syntax for Calling of Subroutine - With Parameters(Contd.)
CHANGING = keywords,
1
4
Subroutine - Actual Parameters and Formal Parameters
▪ Perform and form statement must contain the same number of parameters. It means
▪ The addition tables , using and changing can only occur once in a statement.
1
6
Subroutine - Pass by Value and Pass by Reference
▪ In pass by value , the value is copied from actual parameter to formal parameter, If we
change the value of formal parameter the value of actual parameter will not change
parameter, any changes done to the formal parameter value will change the value of
▪ In pass by value, the formal parameters have the memory of their own whereas in pass
by reference, the formal parameters does not have the memory of their own.
1
7
Comparison of Include Programs With Function Module & Subroutine
▪ Include programs does not have an interface( there is no provision to pass input and
1
8
Function Modules and Subroutines Comparison
▪ There is a separate transaction code SE37 (workbench tool) to create a function module
▪ We can check the output of function module using F8(we can independently run a
independently.
▪ We can raise a exception in function module using exception tab whereas in subroutines
2
0