data types and data objects
TRANSCRIPT
-
7/26/2019 Data Types and Data Objects
1/2
Data Types and Data Objects
Together with classes and objects, data types and data objects are the essentials of ABAP
programming.
Data Type
A data type describes a data object, just as a class describes an object. In this sense, a data
type is comparable with a class without methods. ABAP interprets the content of a dataobject in accordance with its data type. Data types eist either bound as a property of data
objects or independently. Independent data types can be defined either in the ABAP
Dictionary or using the T!P"# statement in an ABAP program.
Data Object
A data object is an instance of a data type, just as an object is an instance of a class. Iteists in the internal session of an ABAP program or as a shared object in the shared
memory and occupies memory there for the contained data. A data object is generated
either implicitly when a program or procedure is loaded $named data object%, or by using
the &'"AT" DATA statement $anonymous data object%. (amed data objects are either)ariables $DATA, &*A##+DATA statements, and so on% or constants $&O(#TA(T#
statement%.
A data type describes the technical properties of a data object $for eample, the elementary typesit is comprised of, its length% and semantic properties $what type of entity is represented by the
data object%. Types that are defined in the ABAP dictionary ha)e additional properties, foreample for inputoutput on a classic screen or in -eb Dynpro.
As far as the ABAP runtime en)ironment is concerned, only the technical properties of a dataobject are of interest for program eecution. owe)er, the semantic information, which is lin/ed
to the appropriate use of types, is essential for the legibility of the source code. 0or this reason,
some of the rules co)ered in this section could also fall under the heading #tructure and #tyle,
since this co)ers not only robustness, but also good style, which, although it does not affectprogram eecution, is ne)ertheless significant for readability and maintainability.
Bound and #tandalone Data Types
Declaration of Data Types and &onstants
Declaration of 1ariables
Including #tructures
-
7/26/2019 Data Types and Data Objects
2/2
2sing Types
'eference to Data Types or Data Objects
Table -or/ Areas
*iterals
#trings
#tart 1alues
Data Objects for Truth 1alues