Post_Field userexit at each field.
Applying this userexit you makes sure that the user of your application only enters the items of the selection menu at the field as new field contents. It is a prerequisite, however, that you defined a selection menu at the field. It makes no difference, whether you have a selection menu with fixed items or whether the items are read from the columns of a data base table. It is also not important whether the user enters the value manually or via the selection menu.
If you defined selection menus with sub-menus at the field, the userexit will also compare the entry with all selections contained in the sub-menus. If a field does not correspond with any of the items in the selection menu, DataView will issue a message. The user can only leave the field empty or he has to make a valid entry.
Attention! The special characters ">" and "|" in the selection text are interpreted as end-of-string characters. When a selection text is taken into the field, the userexit cch_chk_men will only check the text up to the end-of-string character. With "\>" or "\|" the special characters can be masked. The userexit will then also check selection texts containing special characters.
The userexit does not check empty fields. You can only prevent empty fields from being entered by setting the access flag (A) in the mask-field list to m = mandatory. In combination with the userexit cch_chk_men the user now has to make a correct entry to be able to leave the field.
If the userexit is entered in the form cch_chk_men | (pipe), the checking is done exactly up to the limits of the table field width. This syntax is required for the correct checking of multi-column selection texts. Else the checking would stop after the end of string (without closing spaces) of the first column of the selection text and DataView would accept an entry with appended characters.
In case of
Enhanced Change Management use xchg_cch_chk_men instead of cch_chk_men. Xchg_cch_chk_men
ignores entries like *** which are used as default entry for unchanged relation
fields in the edited new widget of the so-called monster mask!