How to set a constraint on a field value in an ABAP table so that it can contain any of 'n' possible values? For example, if I am entering a weekday, it can have either of only 7 possible values. Is there a consistency check setting for this during table creation?
Asked
Active
Viewed 392 times
0
-
1Better use predefined domains, if possible. For such trivial tasks as weekdays there are standard domains in DDIC. – Suncatcher Oct 25 '17 at 11:00
1 Answers
2
You can use domains for this purpose. Table field => Data Element => Domain. In the domain you can define possible values for that field. If your example with the weekdays is really what you need, than check out domain WEEKDAY in SE11.

József Szikszai
- 4,791
- 3
- 14
- 24
-
Be aware that domain fixed values do not translate to database constraints - you could still add "day 9" to the table through faulty or malicious programming. – vwegert Oct 26 '17 at 20:16