ABAP Variables are instances of data types. Variables are created during program execution and destroyed after program execution.
The various data types in ABAP are listed in table form below :
There are two predefined ABAP data types with variable length that are generically known as strings:
A string is a sequence of characters with variable length.The length of a string is the number of characters multiplied by the length required for the internal representation of a single character.
A byte string is a hexadecimal type with variable length. It can contain any number of bytes. The length of a byte string is the same as the number of bytes.
EXAMPLE OF EACH DATA TYPE :
DATA :
name(12) TYPE c , "character
empno(5) TYPE n , "numeric character
salary TYPE p DECIMALS 2 , " packet decimal
tdate TYPE d , " date"
time TYPE t , " time"
text TYPE string . "string"
The various data types in ABAP are listed in table form below :
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
|
There are two predefined ABAP data types with variable length that are generically known as strings:
- STRING for character strings
- XSTRING for byte strings
EXAMPLE OF EACH DATA TYPE :
DATA :
name(12) TYPE c , "character
empno(5) TYPE n , "numeric character
salary TYPE p DECIMALS 2 , " packet decimal
tdate TYPE d , " date"
time TYPE t , " time"
text TYPE string . "string"
No comments:
Post a Comment