Modularization in ABAP

Modularization is breaking down the application code into smaller units, so that it is easy to maintain. Suppose if we want to implement the same logic like adding two numbers in several places of the same program, then write the logic inside a modularization unit and call the modularization unit where ever we want to add two numbers.

Even if we want to declare the same variables in multiple programs or use the same logic in different programs then code the common part in the modularization unit and use it in different programs.

Advantages of Modularization are as follows.

  • Easier to read, maintain and debug.
  • Eliminates redundancy of code and increases reusability of code .

Different types of Modularization units called from ABAP programs.

  • Macros – If you want to reuse the same set of statements more than once in a program, you can include them in a macro. You can only use a macro within the program in which it is defined.
  • Include Programs – Include programs allow you to use the same source code in different programs. They are mainly used for modularizing source code and have no parameter interface.
  • Subroutines – Subroutines are normally called internally i.e. called  from the same program in which it is declared. But subroutines can also be called from external programs.
  • Function Modules – Function Modules are stored in the central library and can be called from any program. Even the function modules(RFC enabled) can be called from non-SAP systems.
  • Methods – Methods used ABAP object oriented programming

Different types of Modularization units called from ABAP runtime.

  • Event Blocks – Event blocks begin with a event code and ends with next processing block.
  • Dialog Modules – Dialog Modules are used in PBO and PAI events of Module Pool programs.

7 thoughts on “Modularization in ABAP

  • December 30, 2011 at 12:45 pm
    Permalink

    Very good.
    You could show examples of each one for us!

    Continue posting. His teaching skills are excellent!

    Best blog on the Internet ABAP, no doubt.

    Happy 2012!

    Reply
  • January 6, 2012 at 9:09 pm
    Permalink

    Excellent, very good explained, the best place in the web I’ve ever seen, there’s a lot of sites, but this is the best. Thank you for share this.

    Reply
  • February 7, 2012 at 11:41 am
    Permalink

    extremely good no doubt
    please upload something related to screens

    Reply
  • June 29, 2013 at 8:46 am
    Permalink

    really good and please post some examples not only discription

    thank you

    Reply
  • July 22, 2013 at 9:20 am
    Permalink

    Could you please provide the information about Function Modules and Methods as well plzzzzz….

    Reply
  • December 2, 2014 at 12:29 pm
    Permalink

    Could you please provide the information about Function Modules and Methods

    Reply
  • October 17, 2015 at 5:17 am
    Permalink

    Excellent!!! The best site ever to learn ABAP.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *