Entering content frameDefining Subroutines Locate the document in its SAP Library structure

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>]... ].



<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 Interface

Terminating Subroutines

Terminating a Subroutine



Leaving content frame