‎2006 Jun 21 4:19 PM
Hi all,
I want to implement a generic value check. I have a table of name/value pairs (all chars) and I know, of which DDIC type the field is. So during runtime I do the following:
assign value to <value> casting type (rollname).
The thing is, that the assign doesn't throw any error, though the value is illegal for the DDIC type. I tested it with a date like '200612ab'.
So, the question is, is there any way to perform a value check, or do I have to implement that one of my own?
(I searched for cl_abap* classes, but couldn't find any proper).
Thx!
Nick
‎2006 Jun 22 10:45 PM
Hello Nicolas,
ABAP isn't type safe to domain value references if the data type referres to CHAR. Only a dynpro with user interaction will throw an error message on an illegal input.
There are function modules to retrieve the allowed values, e.g. DOMAIN_VALUES_GET. You have to implemented such restriction by yourself.
Best wishes,
Florin
‎2006 Jun 22 10:45 PM
Hello Nicolas,
ABAP isn't type safe to domain value references if the data type referres to CHAR. Only a dynpro with user interaction will throw an error message on an illegal input.
There are function modules to retrieve the allowed values, e.g. DOMAIN_VALUES_GET. You have to implemented such restriction by yourself.
Best wishes,
Florin