A subroutine is a block of code introduced by FORM and concluded by ENDFORM.
FORM <subr> [USING ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ]
[CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ].
...
ENDFORM.
<subr> is the name of the subroutine. The optional additions USING and CHANGING define the parameter interface. Like any other processing block, subroutines cannot be nested. You should therefore place your subroutine definitions at the end of the program, especially for executable programs (type 1). In this way, you eliminate the risk of accidentally ending an event block in the wrong place by inserting a FORM...ENDFORM block.
Data Handling in Subroutines
Global Data from the Main Program Local Data in the Subroutine The Parameter InterfaceTerminating Subroutines
Terminating a Subroutine