LOCAL (ABAP Keyword)

LOCAL is a keyword used in SAP ABAP programming.
This tutorial covers its introduction & syntax details.


Basic form

Can only be used after the FORM statement.
Saves the current value of the field f when you enter the routine and restores it when you leave the routine.
can also use LOCAL for field symbols and formal parameters. With field
symbols, it not only saves and restores the field reference created
using ASSIGN , but also the contents of the field referenced when you
enter the routine.
With formal parameters, please note that although
changing the value of the formal parameter does not affect the actual
parameter after you leave the routine (if you specified the formal
parameter after LOCAL ), the values of the formal and actual parameter
within the routine are always identical.
This contrasts with the
VALUE specification (see FORM ) where changing the passed field within
the routine does not affect the value of the formal parameter.

More References