ABAP Data types Local data type and Global data type


Apart from declaring Data Objects using ABAP predefined elementary data types, we can also declare data objects using Local and Global data type.

TYPES Keyword

Using standard data types, we can define local data types in ABAP programs using TYPES statement. Scope of local types declared in ABAP programs is only limited to that program. These user-defined local types will then be used to declare data objects. It is useful to declare more complete or complex types and then define related data objects.

REPORT ...*declaration of local typesTYPES ty_name TYPE C LENGTH 30.DATA gv_firsatname TYPE ty_name.DATA gv_lastname TYPE ty_name.

Data type defined in the ABAP Dictionary is available globally in the SAP system.

GLOBAL TYPES

In future lessons, we will learn ABAP Dictionary. Data type defined in the ABAP dictionary ( data elements, structure, table types ) is global and available throughout the SAP system. We can use these global types to declare data objects throughout the SAP system.