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: 

Value tables

0 Kudos
327

Why do we go for value table even though we have fixed value and fixed range

3 REPLIES 3

ankit_aggarwal5
Advisor
Advisor
0 Kudos
173

Sometimes it is not enough to use fixed value/range for a simple reason that this remains static and does not caters to the need of having dynamic values.

Understand from Library Management example where you may want to have a domain that has all the books in library. Now, the Books are added to the library and older ones may be removed. Thus, this requires to have a value table which refers to all the books in library. Additionally, you may never know the range in advance, because number range for books here is something that customer defines and generates.

prabhu_04
Explorer
0 Kudos
173

When you have smaller number of values you should always prefer fixed value or value range .

If your values are increase with time , we need to maintained as fresh values. So large number of values we go for value Table.

michael_piesche
Active Contributor
0 Kudos
173

You might want to make your question more precise.

Are you asking "Why there is the option in domains to assign a Value Table as well as Single Values ('fixed value') and Intervals ('fixed range')"?

Both have their advantages and disadvantages. You can assign non, one of each or both.

Please consult the ABAP documentation / Performance Assistant (F1) first and come back with further questions if necessary:

Single Value and Interval

  • The value range of a domain can be limited by defining fixed values. In this case, only the values entered in the fixed values are possible for all the table fields referring to this domain. The fixed values can be single values or intervals.
  • Fixed values and intervals generally have to be transported, the values are the same in the different systems. The transport of the fixed values is linked to the transport of the domain.
  • For maintenance reasons, if you have hundreds, thousands of single values, a value table might be more suitable

Value table

  • In some cases you already know when you define a domain that all the fields referring to this domain should be checked against a certain table. This information can be stored in the domain by entering a value table.
  • The system proposes the value table as check table when you try to define a foreign key for this field. You can override this proposal.
  • Entering a value table does not implement a check. The check against the value table only takes place when a foreign key is defined.
  • Value table records can be transported, but they dont have to be transported, they can be different in the different systems. The transport of the value table records is separate from the domain. Depending on the setup of the value table, the records can be maintained by users in all systems.
  • Value tables also offer to store more data about the record

Main Difference

  • As described above, Single Values are always automatically checked at Input in a mask. Value table records are only automatically checked at Input in a mask, when the value table is used as a check table in the case as a defined foreign key for the field.

Dependencies

  • If a check table and fixed values are defined for a table field, only values that exist in both the check table and in the fixed values can be entered in the field.