SAP ABAP - Modularization
It is a good practice to keep your programs as self-contained and easy to read as possible. Just try to split large and complicated tasks into smaller and simpler ones by placing each task in its individual module, on which the developer can concentrate on without other distractions.
In SAP ABAP environment, modularization involves the organization of programs into modular units, also known as logical blocks. It reduces redundancy and increases program readability even as you are creating it and subsequently during the maintenance cycle. Modularization also enables reusability of the same code again. ABAP has made it necessary for developers to modularize, i.e. organizing the programs relatively more, than in the OOPS-based languages that have relatively more built-in modular features. Once a small, modularized section of code is complete, debugged and so on, it does not subsequently have to be returned to, and developers can then move on and focus on other issues.
ABAP programs are made up of processing blocks known as modularizing processing blocks. They are −
The processing blocks called from outside the program and from the ABAP run-time environment (i.e., event blocks and dialog modules).
Processing blocks called from ABAP programs.
Apart from the modularization with processing blocks, source code modules are used to modularize your source code through macros and include programs.
Modularization at source code level −
- Local Macros
- Global Include programs
Modularization through processing blocks called from ABAP programs −
- Function modules
Modularizing a source code means placing a sequence of ABAP statements in a module. The modularized source code can be called in a program as per the requirement of the user. Source code modules enhance the readability and understandability of ABAP programs. Creating individual source code modules also prevents one from having to repeatedly write the same statements again and again that in turn makes the code easier to understand for anyone going through it for the first time.