SAP ABAP Data Types
SAP ABAP Data Types
Data types which are used to store information of various data types like character, integer, floating point, etc.So as a ABAP consultant,to write any code ,we have to understand data types and how to declare data types and how much space will take every data type variable in the SAP system.
| Type | Field |
|---|---|
| Byte field | X |
| Text field | C |
| Integer | I |
| Floating Point | F |
| Packed number | P |
| Text string | STRING |
Based on the data type of a variable, the operating system allocates memory and decides what can be stored in the reserved memory.
Elementary Data Types in SAP
ABAP offers the programmer a rich assortment of fixed length as well as variable length data types.
Some of the fields and numbers can be modified using one or more names as the following: byte numeric character-like
| Type | Type Length | Type range |
|---|---|---|
| X | 1 byte | Any byte values (00 to FF) |
| C | 1 character | 1 to 65535 |
| N | 1 character | 1 to 65535 |
| D | 8 characters | 8 characters |
| T | 6 characters | 6 characters |
| I | 4 bytes | -2147483648 to 2147483647 |
| F | 8 bytes | 2.2250738585072014E-308 to 1.7976931348623157E+308 positive or negative |
| P | 8 bytes | [-10^(2len -1) +1] to [+10^(2len -1) 1] (where len = fixed length) |
| STRING | Variable | Any alphanumeric characters |
| XSTRING | Variable | Any byte values (00 to FF) |
Complex and Reference Types in ABAP
The complex types are classified into Structure types and Table types.In the structure types, elementary types and structures are grouped together.The ABAP OOP run-time type services enables declaration of data items at run-time.
| Parameter | Description |
|---|---|
| Line or row type | "Row of an internal table can be of elementary, complex or reference type. |
| " | |
| Key | Specifies a field or a group of fields as a key of an internal table that identifies the table rows. A key contains the fields of elementary types. |
| Access method | |
| " | Describes how ABAP programs access individual table entries |
Comments
Post a Comment