βš™οΈSAPTools
πŸ“Š

ABAP Data Type Reference

ABAPNew

Complete 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.

TypeCategoryDefault LenMax LenDefault ValueExample
CCharacter165535SPACEDATA lv_name TYPE c LENGTH 40.
NNumeric Text165535000...0DATA lv_matnr TYPE n LENGTH 18.
DDate8800000000DATA lv_date TYPE d.
TTime66000000DATA lv_time TYPE t.
IInteger4 bytes4 bytes0DATA lv_count TYPE i.
INT8Integer8 bytes8 bytes0DATA lv_big TYPE int8.
FFloat8 bytes8 bytes0.0DATA lv_rate TYPE f.
PPacked Decimal8160DATA lv_amount TYPE p LENGTH 10 DECIMALS 2.
DECFLOAT16Decimal Float8 bytes8 bytes0DATA lv_val TYPE decfloat16.
DECFLOAT34Decimal Float16 bytes16 bytes0DATA lv_val TYPE decfloat34.
XHex/Raw1655350x00...DATA lv_raw TYPE x LENGTH 16.
STRINGStringDynamicMemory limited''DATA lv_text TYPE string.
XSTRINGStringDynamicMemory limited(empty)DATA lv_blob TYPE xstring.
UTCLONGTimestamp8 bytes8 bytesInitialDATA 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.