SAP ABAP Data types
ABAP Data types are defined as the users view on the data, i.e. it is the data format at user interface. The data format is based on the type of database is using.
SAP ABAP uses various data types in the work areas for data, the different data types are as follows.
Types of data types
- Elementary data types
- Complex data types
- Reference data types
Elementary data types : – Elementary data types are further categorize into two types
- Fixed Length
- Variable Length
|C||Text field||“Hello World”|
|F||Float point number||4e5|
Pre-defined elementary ABAP data types
SAP delivers predefined data types with length and templates, where the field length is defined in bytes.
|Data Type||Int. field length||Valid field length||Initial value||Description|
|C||1||1 – 65535||‘….’||It is a text field for alphanumeric characters|
|N||1||1 – 65535||‘0 … 0’||Numerical text field for only numeric characters|
|D||8||8||‘00000000’||Date field allows in format YYYYMMDD|
|T||6||6||‘000000’||Time field allows in format HHMMSS|
|I||4||4||0||For Integers (Whole numbers)|
|F||8||8||0||For floating point number|
|P||8||1 – 16||0||Packed decimal numbers|
- Data type N is not a numeric type, type N objects con only contains numeric characters (0…….9), but they are not represented as internally as numbers.
- The value range of data type I number is -2**31 to 2**31-1 and consists only whole numbers. Data type I (Integer) is used for the values of counters, number of items, indexes, etc.
- Data type P allows digits after the decimal point. The number of decimal place is generic and is determined in the program. Type P can be used for distance,weights, etc.
- The Non-numeric data types such as C (Text field), D(Data), N(Numeric), T (Time) are character types. Fields in this type are allowed to enter characters and it takes enough memory for coding.
Complex types : – Complex types includes structures types and table types.
Reference Types : – Reference types includes data references and object references.