ABAP Data Type Reference
ABAPNewComplete reference for all ABAP built-in data types: C, N, D, T, I, F, P, STRING, XSTRING and more. Includes length, range, default values, and usage examples.
| Type | Category | Default Len | Max Len | Default Value | Example |
|---|---|---|---|---|---|
| C | Character | 1 | 65535 | SPACE | DATA lv_name TYPE c LENGTH 40. |
| N | Numeric Text | 1 | 65535 | 000...0 | DATA lv_matnr TYPE n LENGTH 18. |
| D | Date | 8 | 8 | 00000000 | DATA lv_date TYPE d. |
| T | Time | 6 | 6 | 000000 | DATA lv_time TYPE t. |
| I | Integer | 4 bytes | 4 bytes | 0 | DATA lv_count TYPE i. |
| INT8 | Integer | 8 bytes | 8 bytes | 0 | DATA lv_big TYPE int8. |
| F | Float | 8 bytes | 8 bytes | 0.0 | DATA lv_rate TYPE f. |
| P | Packed Decimal | 8 | 16 | 0 | DATA lv_amount TYPE p LENGTH 10 DECIMALS 2. |
| DECFLOAT16 | Decimal Float | 8 bytes | 8 bytes | 0 | DATA lv_val TYPE decfloat16. |
| DECFLOAT34 | Decimal Float | 16 bytes | 16 bytes | 0 | DATA lv_val TYPE decfloat34. |
| X | Hex/Raw | 1 | 65535 | 0x00... | DATA lv_raw TYPE x LENGTH 16. |
| STRING | String | Dynamic | Memory limited | '' | DATA lv_text TYPE string. |
| XSTRING | String | Dynamic | Memory limited | (empty) | DATA lv_blob TYPE xstring. |
| UTCLONG | Timestamp | 8 bytes | 8 bytes | Initial | DATA lv_ts TYPE utclong. |
Click a row for more details. Types marked with dynamic length allocate memory on the heap.
Advertisement
Frequently Asked Questions
What is the difference between ABAP type C and STRING?
Type C is a fixed-length character field (1β65535 chars), padded with spaces, stored inline in the structure. STRING is a dynamic-length text that lives on the heap. Use C for database fields and string literals with known max length; use STRING for dynamically built text.
Which ABAP type should I use for decimal numbers?
Use type P (packed decimal) with DECIMALS for financial calculations β it is exact. Use type F (floating point) only for scientific/engineering values where rounding is acceptable. Avoid F for money.
What is the ABAP_BOOL type?
ABAP_BOOL is a type alias defined in the ABAP_TYPECODES include, equivalent to type C length 1. Its valid values are abap_true ('X') and abap_false (space). Use it for boolean flags in modern ABAP code.
Advertisement