Syntax to declare a variable in ABAP -
1
|
DATA Variable_Name Type Variable_Type |
Example:
1
|
DATA employee_number Type I. |
The following is a list of Data Types supported by ABAP
Data Type | Initial field length | Valid field length | Initial value | Meaning |
Numeric types | ||||
I | 4 | 4 | 0 | Integer (whole number) |
F | 8 | 8 | 0 | Floating point number |
P | 8 | 1 - 16 | 0 | Packed number |
Character types | ||||
C | 1 | 1 - 65535 | ' ... ' | Text field(alphanumeric characters) |
D | 8 | 8 | '00000000' | Date field(Format: YYYYMMDD) |
N | 1 | 1 - 65535 | '0 ... 0' | Numeric text field(numeric characters) |
T | 6 | 6 | '000000' | Time field(format: HHMMSS) |
Hexadecimal type | ||||
X | 1 | 1 - 65535 | X'0 ... 0' | Hexadecimal field |