SAP Tutorials Blog

 


 

Similar to structured data type, structured variable can be declared using BEGIN OFand END OF keywords.


DATA: BEGIN OF student,

      id(5)     TYPE n,

      name(10)  TYPE c,

      dob       TYPE d,

      place(10) TYPE c,

      END OF student.

We can also declare a structured variable by referring to an existing structured data type.


TYPES: BEGIN OF address,

       name(10)   TYPE c,

       street(10) TYPE c,

       place(10)  TYPE c,

       pincode(6) type n,

       phone(10)  type n,

       END OF address. 


Data: house_address  type address,

 office_address like house_address.

Each individual field of the structured variable can be accessed using hyphen (-). For example, name field of the house_address structure can be accessed using housing_address-name.


Serkan AKKAVAK

Computer Engineer BSc

SAP Department Deputy Manager

Contact : serkurumsal@yandex.com