Skip to Content
Former Member
Jul 01, 2011 at 10:29 AM

Is an assigned value to an variable in the domain of the data element



how can I check if the value, which I want to assign to an variable is in the domain of the data element of that variable.


I defined a data element myDataElement. The Elementary Type of myDataElement is the Domain myDomain.

myDomain has the Format: Char with Length 1 and the fixed values 'A' and 'B'.

The following code works, but IMHO should not:

DATA testVar TYPE myDomain.
testVar = 'Foo'.

The value of testVar is now: 'F' .

As 'F' is not in the fixed values, this is a behaviour which I don't want. How can I prevent this from not happening (without using a bunch of IFs)?

In such a case, it were nice if an exception were raised.