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

Data validation in maintenance view

Former Member
0 Likes
1,697

I have a maintenance view which is just simply a projection of a database table.

I'm trying to add a validation before user save the data, what I have done is add a standard event by using 'Table Maintenance Generator', there is an event 'Before saving the data in the database' which I think is proper place to do the validation.

Now the problem is if the user input is invalid, after validation and message displayed on the screen, the entry user is editing will be locked, and cannot be back to editable even you click 'Change<->Display' button, user have to back to SM30 screen and re-enter again.

The idea behavior is the screen stays and the entry is editable, user can correct his input immediately.

So someone can provide any advice regard this problem?

Thanks in advance.

Ben

4 REPLIES 4
Read only

Former Member
0 Likes
957

Hi

You can set the flag VIM_ABORT_SAVING in order to abort the saving process and back to maintenance screen without to go out from SM30

I've found a my old code:


* Check entries with same sorting key

   loop at t_sort_key_count.

     check t_sort_key_count-tot > 1.

     message i398(00) with <...............>

     vim_abort_saving = 'X'.

     exit.

   endloop.

I use e message tyoe I instead of E, in order not to lock the process and back to imain screen

Max

Read only

0 Likes
957

Hi Max,

Thanks, actually I have set vim_abort_saving = 'X'. It can prevent saving data into DB.

However, on UI user cannot continue to edit that entry which is checked as invalid, because the framework continue execute and gray out that entry. So it is a usability problem. I was wondering if there is any flag variable like vim_abort_saving to control the UI behavior, but failed to get any idea after some investigation.

Best regards,

Ben

Read only

Former Member
0 Likes
957

Hi Ben,

As Max says, you can use VIM_ABORT_SAVING condition  and please try to event 05 for new entry enent for validation .

05 Event will be help during entry creation check .

Regards,

Prasenjit

Read only

0 Likes
957

Hi Prasenjit,

Thanks, actually I have tried event 05, seems it still doesn't work due to some other problems(Sometimes it is not called?). I'll try to investigate event 05 further.

Best regards,

Ben