cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Catch validation errors in ABAP

Former Member
0 Likes
2,762

Hi,

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.

Regards,

Madhvika

Edited by: Madhvika Joshi on May 23, 2011 1:15 AM

View Entire Topic
former_member199125
Active Contributor
0 Likes

hi madhavika,

In your example , if you set the date field as mandatory field( requried property ) then you cannot go back.

If you set the above parameter, then uncheck that parameter.

And let me know your scenario, so that we can approach in better way

Regards

Srinivas

Former Member
0 Likes

Hi Srinivas,

I am performing Validation like if total travel time is less than 3 hours 30 mins and user has selected business class, I have to display a popup with input field where user enters reason for deviation in policy. This popup has ok and cancel button. Ok button only works when user has entered reason. If user doesnu2019t want to enter reason he can click cancel.

Total travel time field is a time field with format HH:MM: SS. If user enter wrong format like 03:2:00 and then click on business class radio button, in wdbefore action method where I have written validation code is executed . As desired popup comes but with an error that time format is invalid.

And user is stuck to that window as OK and Cancel button are not working.

My question: How can I stop displaying the popup when user has entered invalid time?

Or to catch this validation which is performed by SAP internally.