Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data types and Data object

Former Member
0 Likes
544

Can Any one give me Clear definition of Data type and Data objects.

Concept i know clearly.. but unable to explain it..

Regards,

Prasanna

3 REPLIES 3
Read only

Former Member
0 Likes
504

Hi Prasanna

<b>DATA TYPE</b> is.....the type of a <b>DATA OBJECT</b>....

for exapmle, if there is a data element named say,

ZELEMENT...of TYPE INTEGER 4.

So here....

<b>DATA TYPE is INTEGER for DATA OBJECT named 'ZELEMENT'</b>.

various DATA TYPES are... CHAR, INT, DATS, NUMC etc...

and DATA OBJECTS are.... Data Element, Table, view, domain, filed etc.

<b>Reward Points for helpful answers,</b>

Regards,

Tejas

Read only

Priti_PM
Product and Topic Expert
Product and Topic Expert
0 Likes
504

To Add to Tejas's distinction:

Data objects are really the data that occupy some memory at run time when the program is run. Your program can read some values and put some contents into the data objects.

Local variables, constants, literals, parameters are some of examples of data objects in ABAP.

To differentiate one data object from other, every data object (apart from name)will have some parameters like length, data type ,..

Data type will describe how the contents of data object is interpreted. So if for example if you are accepting a field "NAME" as input from user , you will say it is of type string or character and if you are accepting "SALARY" ; you will say it is of type integer . That is how your program can also differentiate between data object "NAME" and "SALARY" and accordingly react.

Read only

Former Member
0 Likes
504

Data consists of strings of bytes in the memory area of the program. A string of related bytes is called a field. Each field has an identity (a name) and a data type. All programming languages have a concept that describes how the contents of a field are interpreted according to the data type.

In the ABAP type concept, fields are called data objects. Each data object is an instance of an abstract data type. Data types in ABAP are not just attributes of fields, but can be defined in their own right. There are separate name spaces for data objects and data types. This means that a name can at the same time be the name of a data object as well as the name of a data type.

<b>Data Types:</b>

As well as occurring as attributes of a data object, data types can also be defined independently. The definition of a user-defined data type is based on a set of predefined elementary data types. You can define data types either locally in the declaration part of a program (using the TYPES statement) or globally in the ABAP Dictionary. You can use your own data types to declare data objects or to check the types of parameters in generic operations.

Data types can be divided into elementary, reference, and complex types

<b>Data objects:</b>

Data objects are the physical units with which ABAP statements work at runtime. Each ABAP data object has a set of technical attributes, which are fully defined at all times when an ABAP program is running. The technical attributes of a data object are its length, number of decimal places, and data type. ABAP statements work with the contents of data objects and interpret them according to their data type. You declare data objects either statically in the declaration part of an ABAP program (the most important statement for this is DATA), or dynamically at runtime (for example, when you call procedures). As well as fields in the memory area of the program, the program also treats literals like data objects.

ABAP contains the following kinds of data objects

Literals

Named Data Objects

Predefined Data Objects

Dynamic Data Objects