inetphantom
inetphantom

Reputation: 2594

How to restrict values in a ztable in abap

I have a field in my ztable which should hold the attendence of a user in hours. This value should be between 0.00 and 42.00

Now I found in the domain under the Value Range tab three points:

  1. Single values: I do not want to enter all the 4200 possible entries.
  2. Intervals: I did not suceed using those to restrict values. It showed some dialog while entring but I was never the less able to enter 45.00
  3. Value Table: same as 1, I do not want to enter all the 4200 possible entries.

So how can I do this?

Upvotes: 2

Views: 2490

Answers (2)

Gert Beukema
Gert Beukema

Reputation: 2565

As you have found out you cannot do this on the data dictionary level. So, you'd have to do it at the application level.

If a message to the user on an out of bound value is not necessary, you could automate this for every field that uses the specific domain by creating a conversion exit that changes out of bounds entries to 0.00 or 42.00. However, this might be rather confusing for the users that the value would change to 42.00 when they enter 43.00 without any warning.

Upvotes: 1

inetphantom
inetphantom

Reputation: 2594

The F1 Help answered my question why it does not work:

Lower limit of 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.

You can only define fixed values for domains of data types CHAR, NUMC, DEC, INT1, INT2 and INT4.

Dependencies

There is only an input check of the mask for data types CHAR and NUMC. Note that the system only checks single values for NUMC.

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

Upvotes: 1

Related Questions