Catch validation errors in ABAP
Description: When we enter data other then what is defined for a UI element, we get an error and are not allowed to proceed ahead till we correct it.
e.g. When we define a context attribute as type Date and suppose enter alphabets we get an error message u201CXYS is not a date format u201C.
In my requirement I have a time field. When time is less than 3 hours 30 mis I display a popup with input field. This popup window has OK and Cancel Button.
Now when I enter a wrong time format say 03:2:00 instead of 03:20:00 .Popup window comes and displays a error message time format invalid.
Problem: The problem is user is not allowed to go back to main screen because of error.
OK and cancel button are not working. I think the reason is these standard error messages had cancel navigation as TRUE.
This is the problem at all places when popup comes and user has enters a wrong data in the screen.
Please guide how to avoid same.
Edited by: Madhvika Joshi on May 23, 2011 1:15 AM
kranthi kumar replied
I am not sure if i got the requirement properly, however if you want to catch validation errors generated data type checks for example date and time.
if you can do that by using interface if_wd_validation, this interface has methods like set_attribute_valid which suppresses those messages and then you can raise your own messages!!