Application Development 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: 

Problem when define Value range for data element

Former Member
0 Kudos

Dear

When I define a new data element in ABAP Dictionary, for example, ZDATA_ELEMENT_TEST.

I use domain ZDOMAIN_TEST.

(Data type is DEC, the length is 10, and decimals is 2 with sign.)

Now, I want to restrict that, user can ONLY input the value from 10 to 100.

From ABAP course and the Internet, I switch to "Value Range" tab, and define 10 for Lower Limit, 100 for Upper Limit in Intervals section.

And write the simple program.

PARAMETERS test TYPE ZDATA_ELEMENT_TEST.

WRITE: test.

And run it.

Line: -


But, there is a problem.

When I input 200 for test, the program still run and display 200 to screen without any error report or notification. The ABAP runtime system doesn't check the input value.

I want to config for the domain that can satisfies, if the user input the wrong value (e.g: 200 in the previous case), the program will auto raise the error report, or exception, or sth like that.

Any help is welcome.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Hanni,

Welcome to forum.

Try to attach key word VALUE CHECK to your PARAMETER statement.

I.e:


PARAMETERS test TYPE ZDATA_ELEMENT_TEST VALUE CHECK.

Note: The addition VALUE CHECK cannot be used together with the additions AS CHECKBOX, RADIOBUTTON, or NO-DISPLAY.

Regards,

4 REPLIES 4

Former Member
0 Kudos

Hi Hanni,

Welcome to forum.

Try to attach key word VALUE CHECK to your PARAMETER statement.

I.e:


PARAMETERS test TYPE ZDATA_ELEMENT_TEST VALUE CHECK.

Note: The addition VALUE CHECK cannot be used together with the additions AS CHECKBOX, RADIOBUTTON, or NO-DISPLAY.

Regards,

0 Kudos

Dear Minh

Thank for your reply.

But when I add VALUE CHECK as you suggest, the runtime error occurs .

0 Kudos

Hi Hanni,

I saw the dump error. Sorry that VALUE CHECK is only appy to CHAR or NUM data type. So, if you use DEC type you can check it in event AT SELECT-SCREEN, if data is greater than your interval then warning user.

Regards,

0 Kudos

Hi Thien,

Thanks for your information.

You're right.

I also find the information by Google.