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: 

Using Domain or pre-defined Which is the best?

Former Member
0 Kudos

Hi Experts,

While defining fields in a table creation we should use pre defined data types or domains?

Which is best to use? Will there be any performance change in using these.

Regards,

Aishwarya.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Aishwarya,

I dont think it has to do anything with performance.

If predefined types do not suffice your requirement then you can use domains.

for example domain with char20

Thanks

Bala Duvvuri

Edited by: Bala Duvvuri on Jul 28, 2010 3:54 AM

5 REPLIES 5

Former Member
0 Kudos

Aishwarya,

I dont think it has to do anything with performance.

If predefined types do not suffice your requirement then you can use domains.

for example domain with char20

Thanks

Bala Duvvuri

Edited by: Bala Duvvuri on Jul 28, 2010 3:54 AM

Former Member
0 Kudos

Hi Aishwarya,

You can use predefined data types or domain,

but if you want to assign the same data types to more than one then you should go with Domains and Data Elements,

but if you want to copy that table from one system to another, at that time, you must copy or re-define Domains and Date Elements,

I don't think it has to do anything with performance.

Hope it'll help.

Thanks and regards,

Sachin Bhatt

Former Member
0 Kudos

Hi,

Both of them has a specific role in system. And I agree with Bala that it does not cause any performance issue. Please refer below:

A Domain describes the value range of a field and is assigned to a data element. All fields that use the data element will have the value range of the domain. The value range is defined by specifying the type and length of the domain. Fixed value intervals can also be defined for the domain and are automatically used as check values on screen entries.

A Data element describes the business meaning of a domain. Information about the meaning of a field such as its label is assigned to the data element and is accessible from all screen fields that use the data element.

regards,

Former Member
0 Kudos

Hi,

dataelement tells semantic attributes of a field

domain tells technical attributes of a field

domain

A table is composed of fields. To create a field you need a data element.A data element's definition requires a domain.

The domain contains the technical characteristics of a field, such as the field length and data type.

When you create a new field, you must decide whether to create a new domain or reuse an existing one. To make this decision, determine whether the data type or length of your field should be dependent on an existing SAP field. If your field should be independent, create a new domain. If your field should be dependent, reuse an existing SAP domain. Similarly, you should reuse data elements if your field labels and documentation should change when SAP changes theirs.

************************************************************************************************************************************

Data element provides business context. i.e., it provides field labels for the field in the backend,

Data type :
A data element is an elementary type. It describes the type attributes (data type, field length and possibly the number of decimal places) and screen information (explanatory text or field help) about unstructured data objects (table fields and structure fields or variables).

Table fields and structure fields with the same contents should refer to the same data element. This ensures that the attributes of these fields are always consistent.

A data element can be referenced in ABAP programs with TYPE. This permits you to define variables that take on the type attributes of the data element in an ABAP program.
Domain : 
A 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.
Additional info about data element 
1.Data type, number of places and possibly the decimal places were entered directly. In this case the field is not filled.
2.A data element is assigned to the field. The field then gets its data type, length and possibly decimal places from this data element. The semantic attributes of the element (field help, representation of the field in input templates with keyword text, column headers for list output of the table contents and editing of the output with parameter IDs) are also copied.

May it helps you.

Regards.

DS.

anup_deshmukh4
Active Contributor
0 Kudos

Aishwarya Menon ,

Using the existing one is the best option but do remember the following points,

1. Check if the pre existing domain has Fix value range ( If your requrement is same while building table use it ..! )

2. Check if it has a check or Value table assigned it it.....( If you want it to be kept in Use it...)

3. Check if the the domain has a conversion routine suffice your requirement ( if it according to your requirement use it...)

if you are OK with the above mentioned points ...Reuse it.. Else create your own...!

Hope it helps...!

Regards,

Anup Deshmukh