- A subroutine is a block of code introduced by FORM and concluded by ENDFORM.
- Defining Subroutines.
FORM <subroutine> [<parameters>].
<statements>
ENDFORM.
<statements>
ENDFORM.
- Calling Subroutines.
- Internal subroutines have the source code in the calling ABAP/4 program:
PERFORM <subroutine> [<parameters>].
- Subroutines without passing parameters.
- Understanding pass by value and pass by reference.
- Implementing Subroutine.
FORM <SUBROUTINE NAME > USING <FV1> <FV2>
CHANGING <CHANGING1> <CHANGING2>
TABLES <TABLE1> <TABLE2>.
ENDFORM.
- In the above syntax <av1> and <av2> are actual parameters and <fv1> <fv2> are formal parameters.
- Note :
- Perform and form must contain the same number of parameters.
- The syntax on the perform and form statements can differ.
- The syntax on the form statement alone determines the method by which a parameters is passed.
- The value() addition cannot be used on the perform statements.
- Using must come before changing.
- The addition using can only occurs once in a statement.. The same rule applies to changing.
No comments:
Post a Comment