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

differencess

Former Member
0 Likes
965

what is the difference between "data element" and "data types"?????

9 REPLIES 9
Read only

Former Member
0 Likes
926

As an example.

The data ELEMENT ERDAT is of data TYPE D which is defined with Domain DATUM.

Read only

Former Member
0 Likes
926

i want to know the actual/appropriate difference b/w "data element" and "data types"

Read only

Former Member
0 Likes
926

Data element is much more than just type declaration..

Information about the meaning of a table field or structure component and information about editing the corresponding screen field can be assigned to a data element. This information is automatically available to all screen fields that refer to the data element.

This information includes the display of the field in input templates using key word text, column headers for list output of the table contents (see Field Labels ), and output editing using parameter IDs.

This is also true for online field documentation. The text appearing in the field help (F1 help) in a field of an input template (see Documentation and Docu Status) comes from the corresponding data element.

Check this link..

http://help.sap.com/saphelp_47x200/helpdata/en/90/8d72feb1af11d194f600a0c929b3c3/frameset.htm

G@urav.

Read only

vinod_vemuru2
Active Contributor
0 Likes
926

Hi Ankur,

DATA TYPE is the one used to assign the characteristic to some database table field/variable/constant on which type of data it can store.

eg: DATA TYPE DATS -it can store only date.

DATA TYPE NUMC can store numeric and characters

DATA TYPE DEC Can store data with decimal point representation.

DATA ELEMENT: This is one of the reusable element. We can declare one data element and associate this with some data type discussed above. So that what ever fields referred to this data element attain all the attributes of that data type. In addition to this we can have many additions like Parameter ID, Search help, Change document creation, Default component name etc Where all these things are not possible in case of Data type.

Another important thing is we can create field labels which will be displayed in the table output(column Headings)/ALV out put(If we refer the LAV field to this data element)

More over u can't create ur own data types. But u can create ur own data elements. We can make use of the DATA types created by SAP to Create DATA ELEMENTS.

Just open any data element eg:VBELN_VA in se11 and place ur cursor in different options over there and press F1. It will take u to the complete details.

Hope this clarified ur doubt.

Thanks,

Vinod.

Edited by: Vinod Kumar Vemuru on Apr 11, 2008 9:07 PM

Read only

Former Member
0 Likes
926

hey man ..............

i want the appropriate difference????????????????

Read only

0 Likes
926

What do you mean by appropriate difference?

is there anything specific you are looking for? if yes, please mention that in your original post.

That will help everyone in giving the correct answer.

cheers

~goldie

Read only

0 Likes
926

Appropriate difference

Technically both serve the same purpose as far as type declaration is concerned. But Data Element is created in ABAP dictionary for various other purposes as well. Some differences can be:

DataElement can be used for field documentation(F1), Data type can't.

Dataelement defines the description/text for the field when displaying on the screen and Parameter ID, Data type don't.

G@urav.

Read only

0 Likes
926

A data type is template with certain predefined characteristics like memory capacity, positive and negative limits etc., and is used to hold data at runtime; if a variable is declared having type as any of the data type, it's template is applied to the data at runtime and memory is allocated to the variable at runtime accordingly.

Data types are basic elements of any High level language.

A data element is an encapsulation of this concept. It envelops domain and serves semantic purposes..

Now, domain is used for flexibility involved and technical reasons. A domain is attached to number of data elements and if later one realizes..that not a correct data type was attached to this one can change the data type here and this will save efforts to change it everywhere( in all the data elements it is being used ). Domain concept provides you other facilities like value check which a native data type is does not.

A data element is used for semantic reasons: SAP applications were designed as module oriented applications; every module has to communicate with every other and therefore modules share certain attributes which they might call differently in their local terminology. Eg: (

Very vague but sufficient to explain the concept)..sender in one module might be called receiver in another..although they are one and the same thing...=> they have same properties, they are actually the same attributes if seen system-wide but they have different names in two different modules=> they must have same data type ... or same domain(which will provide extra flexibility).. '

SENDER(DE)<=CHAR50(DO)<=type c length 50(DT)

V

RECEIVER(DE)

DE:Data Element

DO: Domain

DT: Data type

Therefore defining different data elements with same domain provides data compatibility while data is being exchanged among various modules and at the same time provides flexibility to recognize same attributes with different names in different fucntional areas.

Answer to ur question is : Data type cannot be directly compared with Data elements; also, refrain from using data types in preference to data elements in ur code because data elements are SAP's solution to Data type concept, in a way, one can say that data type concept was conditioned by SAP to suit its own purposes

Read only

Former Member
0 Likes
926

Hi Ankur,

data element also contains data type only.

but when we are creating a table , we use data elements at field level ...then only we can maintain relationship between two tables.

In data elements , we can have additional charecteristics like : Field label and Parameter Id.

Regards

Sandeep Reddy