STATICS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.
STATICS
Variants
1. STATICS f.
2. STATICS f(len).
3. STATICS: BEGIN OF rec,
...
END OF rec.
4. STATICS: BEGIN OF itab OCCURS n,
...
END OF itab.
Effect
The
STATICS statement is a variation of the DATA statement. It allows you
to define variables in a procedure (i.e. a FORM or FUNCTION ) with
local visibility, but static validity.
Static validity means
that, unlike normal local variables, the life of static variables does
not depend on the defining procedure, but on the program at runtime.
Static variables are thus not redefined on the stack each time the
defining procedure is called, but exist independently of this in the
program and keep their value, regardless of calls to the defining
procedure.
Like all other data objects , static variables always
have a particular data type. Data types and data objects are important
components of the ABAP/4 type concept .
Example
DATA RESULT TYPE I.
PERFORM RANDOM CHANGING RESULT.
FORM RANDOM CHANGING P_RESULT TYPE I.
STATICS L_STATE TYPE I.
L_STATE = ( L_STATE * 113 + 34 ) MOD 256.
P_RESULT = L_STATE.
ENDFORM.
Related 10 ABAP Syntax Tutorials
Most readed SAP Tutorials
- WRITE - Output to a list ( SAP ABAP Keyword)
WRITE ( Output to a list ) is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - List of SAP HR TABLES and Infotypes tables
Detailed full list of tables and infotypes used in SAP HR module. - List of SAP MM Transaction codes
This documentation covers the details of SAP MM Transaction codes - SELECT-OPTIONS ( SAP ABAP Keyword)
SELECT-OPTIONS is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - FI Accounts Receivable and Accounts Payable | SAP FI PDF manual
The following topics are an introduction to the Accounts Receivable and Accounts Payable application components. - SELECT clause ( SAP ABAP Keyword)
SELECT clause is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details. - SAP MM Process Flow
The typical procurement cycle for a service or material consists of the following phases:
Latest Added SAP documents
- 9KE9 Transaction code
Details about SAP transaction code 9KE9 - 9KE8 Transaction code
Details about SAP transaction code 9KE8 - 9KE7 Transaction code
Details about SAP transaction code 9KE7 - 9KE6 Transaction code
Details about SAP transaction code 9KE6 - 9KE5 Transaction code
Details about SAP transaction code 9KE5 - 9KE4 Transaction code
Details about SAP transaction code 9KE4 - 9KE3 Transaction code
Details about SAP transaction code 9KE3 - 9KE2 Transaction code
Details about SAP transaction code 9KE2 - 9KE1 Transaction code
Details about SAP transaction code 9KE1 - 9KE0 Transaction code
Details about SAP transaction code 9KE0