The TYPES Statement
You use the TYPES statement to create user-defined elementary data types and structured data types.
You can use data types defined by the TYPES statement in the same way you use predefined data types for declaring data objects. The syntax is as follows:
Syntax
TYPES <t>[<length>] <type> [<decimals>].
This statement defines a data type <t>.
To define a structured data type, you write:
TYPES: BEGIN OF <fstring>,
<component declaration>,
..............
END OF <fstring>.
The parameters of these statements are identical to those for the DATA statement, described in
The Basic Form of the DATA Statement and The DATA Statement for Structures.Note that you cannot use the <value> parameter in the TYPES statement because there is no memory associated with a data type. Therefore, you cannot assign a value to a data type.

TYPES: SURNAME(20) TYPE C,
BEGIN OF ADDRESS,
NAME TYPE SURNAME,
....
END OF ADDRESS.
DATA: ADDRESS_1 TYPE ADDRESS,
ADDRESS_2 TYPE ADDRESS,
......
This example shows how you can use the parameter TYPE to refer directly to a user-defined data type. Three main things happen here. First, a user-defined data type, SURNAME, of type C and length 20 is created. Second, a structured data type, ADDRESS, is defined. A component of ADDRESS, ADDRESS-NAME, is given the data type SURNAME. Thirdly, the data objects ADDRESS_1, ADDRESS_2... are created as structures. The type is specified as ADDRESS.

DATA COUNTS TYPE I.
TYPES: COMPANY LIKE SPFLI-CARRID,
NO_FLIGHTS LIKE COUNTS.
This example shows the use of the LIKE parameter in a TYPES statement. It shows how you can create data types by referring to the types of already existing data objects. Most importantly, you can create types that refer to ABAP Dictionary objects (tables, structures, views, and their individual fields), as shown for the user-defined data type COMPANY. COMPANY refers to the ABAP Dictionary object CARRID, which is a column of the database table SPFLI.

* User-defined types referring to predefined types:
TYPES: SURNAME(20) TYPE C,
STREET(30) TYPE C,
ZIP_CODE(10) TYPE N,
CITY(30) TYPE C,
PHONE(20) TYPE N,
DATE LIKE SY-DATUM.
* User-defined structured type referring to above types:
TYPES: BEGIN OF ADDRESS,
NAME TYPE SURNAME,
CODE TYPE ZIP_CODE,
TOWN TYPE CITY,
STR TYPE STREET,
END OF ADDRESS.
* User-defined nested structure type referring to above types:
TYPES: BEGIN OF PHONE_LIST,
ADR TYPE ADDRESS,
TEL TYPE PHONE,
END OF PHONE_LIST.
DATA PL TYPE PHONE-LIST.
........
WRITE PL-ADR-NAME.
This example shows how to create complex data types from simple type definitions. After a set of simple data types are created with ABAP predefined types, a structured type ADDRESS is defined using the data types defined earlier. Finally, a nested structure type, PHONE_LIST, is created, whose first component has the structured type ADDRESS. The last lines of the example show how a data object, PL, is created with type PHONE_LIST and how its components can be addressed.
For further information about how to include internal tables in data type structures, refer to
Creating and Processing Internal Tables.