‎2014 Jul 15 1:21 PM
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
‎2014 Jul 17 9:33 AM
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
‎2014 Jul 17 12:27 PM
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
‎2014 Jul 17 10:48 AM
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
‎2014 Jul 17 12:32 PM
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