Application Development 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: 

Data Elements & Domains.

Former Member
0 Kudos

Hi Experts,

This is Guru ,new bie to ABAP. Can any body say,

What is Data Elements & Domains in DDIC ?

I had gone through lotta documents and still i am not clear with that. So it will be greatful to you if you explain it with some simple example.

Thanks in Advance,

Guru

1 ACCEPTED SOLUTION

former_member189059
Active Contributor
0 Kudos

The ABAP Dictionary provides two levels to define a data type: The data element determines the semantic properties of a type, while you can assign a domain to the data element, and it is this domain that defines the syntactic of technical properties. What is this two-level-structure good for? Apparently it is a good idea to reuse the technical properties of a data type. For instance, a character field of length three, can be used for all kinds of IDs, not only for carriers. They all share the syntactic properties, but need, for example, different labels.

11 REPLIES 11

Former Member
0 Kudos

Hi,

data element contains business context of a field.

domain contains technical description of a field.

Regards.

Srikanta Gope

0 Kudos

Simply,

Domain whic Gives the Technical Attributes like Data type and the Size

Ex: (Char 32)

Data Element which Give the Field Description or Field Lable in the Front End.

mara1-matnr

In Detail

Data Element:

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

A data element describes either an elementary type or a reference type.

An elementary type is defined by the built-in data type, length and possibly the number of decimal places. These type attributes can either be defined directly in the data element or copied from a domain.

A reference type defines the types of reference variables in ABAP programs.

You can use a data element to define the type of a table field, structure component or the row type of a table type. A data element can also be referenced in ABAP programs with TYPE. As a result, variables that take on the attributes of a data element can be defined in an ABAP program.

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.

Domain:

http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ede5446011d189700000e8322d00/frameset.htm

A domain defines a value range. A domain is assigned to a data element. All table fields or structure components that use this data element then have the value range defined by the domain. The relationship between the field or component and the domain is thus defined by the data element of the field or component.

Fields or components that refer to the same domain (with the assigned data elements) are also changed when the domain is changed. This ensures that the value ranges of these fields or components are consistent. Fields or components that are technically the same can thus be combined with a reference to the same domain.

Steps to Creating domains, Data Elements, Tables

To give you the steps for creating table:.

There are two approach in creating a table.

1. Bottom-up approach

2. Top-down approach.

Both are valid and you can choose which approach is suitable for you. I always use the bottom-up approach. Here are the steps to create the tables with this approach.

1. SE11 will take you to the DDIC and enter the name of the new table to be created. Let us say Zname. Click create.

2. Enter the short discription of the table and enter the field of the table. If it is primary key and you have to check the box.

3. Enter the data element and double click it, you will be asked to save and will take you to data element discription page. Enter the short discription of the data element and enter the information of domain like the length of field and type of field.

4. If you wanted to use the existing domain then its fine, or else, you have to create one. Enter the domain name in the data element page and double click it. Page will ask to save and jump to domain creation page.

5. In the domain page, you have to save the information which you have already given in the data elements page and check it. Before going to data element page, you have to activate the domain.

6. Go to data element page and save, check and activate.

7. Go to main table page and save, check, and activate.

8. Also, you have to save the technical settings of the table.

The table is now ready for operation. You can use it in your program or you can use it to enter information.

Check table: It is the table which will have all the information about the Foreign keys which are the primary keys in the check table.

It can be created by creating the foreign key from the main table. Click foreign key in the main table and it will take you to a page which will ask for table name and field to which foreign key relation has to be associated. Enter the information and you can create the check table automatically.

SM30 is used for maintenance of the table, that is to realease the errors occured during the creation of the table.

regards,

srinivas

<b>*reward for useful answers*</b>

Former Member
0 Kudos

Hi,

Domains:

Domain is the central object for describing the technical characteristics of an attribute of an business objects. It describes the value range of the field.

Data Element:

It is used to describe the semantic definition of the table fields like description the field. Data element describes how a field can be displayed to end-user.

For Data Elements:

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

For Domain:

http://help.sap.com/saphelp_47x200/helpdata/en/cf/21ede5446011d189700000e8322d00/frameset.htm

<b>Reward if helpful.</b>

Former Member
0 Kudos

<b>Steps to Creating domains, Data Elements, Tables</b>

To give you the steps for creating table:.

There are two approach in creating a table.

1. Bottom-up approach

2. Top-down approach.

Both are valid and you can choose which approach is suitable for you. I always use the bottom-up approach. Here are the steps to create the tables with this approach.

1. SE11 will take you to the DDIC and enter the name of the new table to be created. Let us say Zname. Click create.

2. Enter the short description of the table and enter the field of the table. If it is primary key and you have to check the box.

3. Enter the data element and double click it, you will be asked to save and will take you to data element description page. Enter the short description of the data element and enter the information of domain like the length of field and type of field.

4. If you wanted to use the existing domain then its fine, or else, you have to create one. Enter the domain name in the data element page and double click it. Page will ask to save and jump to domain creation page.

5. In the domain page, you have to save the information which you have already given in the data elements page and check it. Before going to data element page, you have to activate the domain.

6. Go to data element page and save, check and activate.

7. Go to main table page and save, check, and activate.

8. Also, you have to save the technical settings of the table.

The table is now ready for operation. You can use it in your program or you can use it to enter information.

Check table: It is the table which will have all the information about the Foreign keys which are the primary keys in the check table.

It can be created by creating the foreign key from the main table. Click foreign key in the main table and it will take you to a page which will ask for table name and field to which foreign key relation has to be associated. Enter the information and you can create the check table automatically.

SM30 is used for maintenance of the table, that is to release the errors occurred during the creation of the table.

<b>Data Elements</b>

A data element describes either an elementary type or a reference type.

An elementary type is defined by the built-in data type, length and possibly the number of decimal places. These type attributes can either be defined directly in the data element or copied from a Structure domain.

<b>Domain </b>

Domain definitions enable ranges of values to be defined and designated for table columns.

Each value range definition has a name that is unique within the overall database system.

Regards,

Pavan

Former Member
0 Kudos

Hi,

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/73/f938361329ec5ae10000009b38f889/frameset.htm">Data Elements</a>

<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/f5/183f40dc371059e10000000a155106/frameset.htm">Domain</a>

Regards

Bala

Former Member
0 Kudos

Hi,

Domain whic Gives the Technical Attributes like Data type and the Size

Ex: (Char 20)

Data Element which Give the Field Description or Field Lable in the Front End.

LFA1-LIFNR

Domain Data type CHAR Length 10

Data Element

Length Field label

10 Vendor

15 Vendor

20 Vendor

10 Vendor

Reward if it helps..

Regards,

Omakr.

Former Member
0 Kudos

Hi,

When you create a custom table, you can either use standard data element or create custom one by double clicking the custom data element.

The system will then take you to data element area to create ... once done make sure you activated.

http://help.sap.com/saphelp_nw04/helpdata/en/90/8d7307b1af11d194f600a0c929b3c3/content.htm

http://sap-img.com/abap/steps-to-creating-domains-data-elements-tables.htm

<b>DOMAIN:</b>

domain describes the technical attributes of a field, such as the data type or the number of positions in a field. The domain defines primarily a value range describing the valid data values for the fields referring to this domain.

Different technical fields of the same type can be combined in a domain. Fields referring to the same domain are changed at the same time when a domain is changed. This ensures the consistency of these fields

some information on Domain.

http://help.sap.com/saphelp_bw30b/helpdata/en/63/f938361329ec5ae10000009b38f889/plain.htm

http://help.sap.com/saphelp_nw04/helpdata/en/fb/54833c4f3e092de10000000a114027/frameset.htm

regards

Former Member
0 Kudos

hi,

Domain is data dic object which has the technical attributes of a field like 1.datatype(int, char...)

2.length(no. tat the field can hold)

3.decimals(if it contains decimal pt ,if yes after how many digits)

4.output format of the field

5.conversion routine-the way it is displayed on screen as against how it is stored in database

Data element is again a data dic object which has the text characteristics

like labels.

data elements also give F4 help....i e if u hover over a field on the screen, and press F4, it gives description of the field so that the user knows wat to enter inside the field.

former_member189059
Active Contributor
0 Kudos

The ABAP Dictionary provides two levels to define a data type: The data element determines the semantic properties of a type, while you can assign a domain to the data element, and it is this domain that defines the syntactic of technical properties. What is this two-level-structure good for? Apparently it is a good idea to reuse the technical properties of a data type. For instance, a character field of length three, can be used for all kinds of IDs, not only for carriers. They all share the syntactic properties, but need, for example, different labels.

Former Member
0 Kudos

data elements n domains are there for the sake of re usability.

many data elements can use a single domain; many fields can use a singe data element.

examples:in the table VBAK

for field ERDAT, DE is ERDAT and DOM is DATUM.

Award points if useful