Subroutines in SAP ABAP

What are sub-routines in SAP ABAP ? Using sub-routines in SAP ABAP, differences between sub-routines and Function Modules

+ -

These are also sub programs, which contains set of re-usable statements for doing some specific task.
These are mainly used for re-usability within the same program, however, we can re-use these Subroutines in other programs too.
Subroutines contain importing and exporting parameters.

Function Modules V/S Subroutines

The main difference between Function Modules and Subroutines are sub-routines does not contain any exceptions and Subroutines are mainly used for local modularization where as function modules contains exceptions and used for global modularization.

sub-routines have definition and implementation parts.

Syntax:DEFINITION PART:
PERFORM  USING     "DOUBLE CLICK ON SUBROUTINE NAME TO CREATE 
                           CHANGING  
                           TABLES   .

**  (VARIABLES),   (CHANGING VARIABLES) AND   (IMPORTING TABLES) ARE ACTUAL PARAMETERS

Syntax IMPLEMENTATION PART
FORM  USING  
                       CHANGING  
                       TABLES  .
ENDFORM.
** ,   AND   ARE FORMAL PARAMETERS

Learner Questions


No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question

    Was this lesson helpful to you? Yes No 58 People out of 74 think this lesson helpful


    Lesson Navigation

    ←Previous Chapter
    Next Chapter →