CONSTANTS (ABAP Keyword) introduction & details
CONSTANTS
Variants
1.
CONSTANTS c. ... VALUE [ val | IS INITIAL ].
2. CONSTANTS c(len) ... VALUE [
val | IS INITIAL ].
3. CONSTANTS: BEGIN OF crec,
...
END OF
crec.
Effect
The CONSTANTS statement defines global and local
constants. Constants allow you to read statically declared data objects . They
always have a particular data type. Data types and data objects are essential
components of the ABAP/4 type concept . In contrast to variables defined with
the DATA statement, you cannot change the value of a constant once it has been
defined. Apart from the additions ... TYPE typ OCCURS n , ... LIKE f1OCCURS n
and WITH HEADER LINE , all the additions used with the DATA statement are
allowed. However, in contrast to the DATA statement, the addition ... VALUE val
or VALUE IS INITIAL obligatory with variants 1 and 2. See additions with DATA
.
Example
CONSTANTS CHAR1 VALUE 'X'.
CONSTANTS INT TYPE I
VALUE 99.
CONSTANTS: BEGIN OF CONST_REC,
C(2) TYPE I VALUE
'XX',
N(2) TYPE N VALUE '12',
X TYPE X VALUE 'FF',
I TYPE I VALUE
99,
P TYPE P VALUE 99,
F TYPE F VALUE '9.99E9',
D TYPE D VALUE
'19950101',
T TYPE T VALUE '235959',
END OF CONST_REC.
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. - SAP MM Process Flow
The typical procurement cycle for a service or material consists of the following phases: - SELECT clause ( SAP ABAP Keyword)
SELECT clause is a keyword used in SAP ABAP programming.This tutorial covers its introduction & syntax details.
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