ABAPbeginner

ABAP Data Types & Variables

Understanding elementary data types, structures, and how ABAP stores and validates typed data.

Every ABAP program lives or dies by how carefully it types its data. ABAP is a strongly typed language, and the type system is one of the first things interviewers probe because it reveals whether a candidate has actually written production code or only skimmed tutorials. Elementary types like C (character), N (numeric text), I (integer), P (packed decimal), D (date), and T (time) each have specific storage and arithmetic behavior that trips up newcomers, especially around packed decimals used for currency fields.

Think of ABAP types like shipping containers of fixed sizes — you must declare the container size before packing goods into it, and forcing an oversized item into a small container truncates it.

Key Concepts

1
Beyond elementary types, ABAP supports structures (grouped fields, similar to a struct or record) and the built-in reference types used throughout the Data Dictionary. A well-prepared candidate can explain the difference between a flat structure and a deep structure (one containing internal tables or references), and why deep structures cannot be used in certain contexts like classic BDC or some RFC interfaces without special handling.
2
Type safety also intersects with the ABAP runtime's automatic conversions. Moving a numeric string into a character field, or a packed number into an integer, triggers implicit conversions that can silently truncate or round data. Interviewers like to ask about DATA versus TYPES versus CONSTANTS, and about generic types (ANY, CLIKE, NUMERIC) used in generic form routine and method signatures.
DATATYPESCONSTANTSANYCLIKE
3
Finally, modern ABAP (7.40+) introduced inline declarations (DATA(lv_var) = ...) which reduce boilerplate but change how variables scope within a method or form, a nuance worth mentioning to show currency with the modern syntax.
DATA(lv_var) = ...