Thanks to visit codestin.com
Credit goes to www.scribd.com

100% found this document useful (1 vote)
154 views2 pages

SAP ABAP Modularization

The document discusses modularization in ABAP programs by breaking code into logical units called modules. It describes including programs, subroutines, function modules, and macros as techniques for modularization and provides syntax examples. Modularization makes code easier to read, maintain, reuse, and avoids redundancy.

Uploaded by

Muhammad Uzair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
154 views2 pages

SAP ABAP Modularization

The document discusses modularization in ABAP programs by breaking code into logical units called modules. It describes including programs, subroutines, function modules, and macros as techniques for modularization and provides syntax examples. Modularization makes code easier to read, maintain, reuse, and avoids redundancy.

Uploaded by

Muhammad Uzair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

ABAP MODULARIZATION

In sap abap, modularization means, breaking the abap program into small modular units, also known as
logical units and placing our abap code into that block, Instead of writing the complete code into the main
program and we can call the required module as per the sequence we required.

Report ZABAP_MODULARIZATION.

Include ZABAP_MODULARIZATION_HEADER.
Include ZABAP_MODULARIZATION_TOP. “data declaration
Include ZABAP_MODULARIZATION_SC. “selection screen

Start-of-selection.
Perform get_data.
Perform display_data.

End-of-selection.

FORM GET_DATA.

ENDFORM.

FORM DISPLAY_DATA.

ENDFORM.

 Need of modularization
 Easy to read the code
 Easy to maintain the code
 Make reuse of code either locally or globally
 Avoid redundancy.

 Modularization Techniques
 Include Programs
 Subroutines
 Function Modules
 Macros

Include Programs: Include program we can create with SE38 and SE80, it can be used in different main
program, it allow us to use the same source code in different programs.

Syntax: include <include program name>.

Subroutines: Subroutines are the procedures, that we define in a abap program and generally call internally
i.e with same program but also possible to call externally through other abap program.

Syntax :
FORM <subroutine name> <parameters option>
Code block.
ENDFORM.
ABAP MODULARIZATION
Function Modules: Function modules are created in Function Builder with transaction code SE37, there are
1000s of FM provided by sap, that we can use directly in our program or we can create our own Function
module with SE37 and the FM we have to call in our program.

Syntax to call a FM

CALL FUNCTION 'ISP_CONVERT_FIRSTCHARS_TOUPPER'


EXPORTING
INPUT_STRING = gv_input_string
SEPARATORS = ' -.,;:'
IMPORTING
OUTPUT_STRING = gv_output_string.

Macros: If we want to reuse same set of statements multiple times in a program, we can include them in
macro. A macro can be called only in the same program in which it is define. Macro definition should be
before in the program , then the actual macro used.
We can also use parameters inside the macro.

You might also like