Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Generic value check

Former Member
0 Likes
326

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
282

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

1 REPLY 1
Read only

Former Member
0 Likes
283

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