I created a Domain called "ZTRANSMISSION_LIST" that has two values "MAN" and "AUT". Next I created a Data Element called "ZTRANSMISSION_TYPE" of type "ZTRANSMISSION_LIST", my Domain.
So, I created a class called "ZVEHICLE" and create an attribute called "TRANSMISSION" of type "ZTRANSMISSION_TYPE" (my Data Element) thinking that if I did something like this in code:
DATA v TYPE REF TO zvehicle. START-OF-SELECTION. CREATE OBJECT v. v->TRANSMISSION = 'XYZ'.
it would cause an exception because "XYZ" is not a valid entry in the ZTRANSMISSION_LIST domain but the program compiles fine and the code executes without a problem. What gives?
How should I implement this? I wanted to take advantage of the Domain but looks like I'm not going to be able to. Does this mean I'm going to have to hard-wire these codes into my program for validation?