2010 Feb 17 1:38 PM
Hello,
I tried to capture this event and put the validation as give message type e if one of the field is blank, while it is giving the error it goes ahead and saves the record. How I can prevent it from saving and be on the same screen till the time user makes the change. It is not even executing the line if I am asking it to set the screen to 1.
2010 Feb 18 6:50 AM
Hi,
You would have ceated table maintenance generator to do this activity right. So there you would have given one function group.
Go to that function group and change screen attribute of the field to 'Required'. Now system will it self show an error message by allowing user to enter values.
No need to do any validation in the EVENT BEFORE SAVE.
Revert if you have any more questions on these.
Regards,
Kusuma K.
Hello,
I tried to capture this event and put the validation as give message type e if one of the field is blank, while it is giving the error it goes ahead and saves the record. How I can prevent it from saving and be on the same screen till the time user makes the change. It is not even executing the line if I am asking it to set the screen to 1.
2010 Feb 17 2:10 PM
Hi,
Error message will not work. Try with Information message or 'S' and set the parameterVIM_ABORT_SAVE = 'X' , then save will not take place.
Thanks,
Abhijit
2010 Feb 17 2:19 PM
Abhijit thanks for the reply however it is not happeneing. Further more I have put foreign key check on that field but it still saves in the db.
2010 Feb 18 5:40 AM
Hi,
Try this way. After the validation
Perform validate changing W_flag,
if not w_eflag is initial.
message i398(00) with 'Space not allowed in description field'(001) .
move X to vim_abort_saving .
endif.
It works for me.
Thanks,
Abhijit
2010 Feb 18 6:57 AM
Hi,
Did u try deleting and recreating the maintenance after creating the foreignkey? If it doesn't work, try in the event 05 with below code. Ideally it should work.
DATA: l_msg(35) TYPE c.
CONSTANTS:l_e TYPE c VALUE 'E'.
DEFINE macro_validate.
if not &1 is initial.
" Your Validations
if sy-subrc ne 0.
clear : l_msg.
concatenate text-001 &1 into l_msg.
message l_msg type l_e .
endif.
endif.
END-OF-DEFINITION.
FORM create_new.
macro_validate ztab-spcode.
ENDFORM. "create_new
Thanks,
Vinod.
2010 Feb 18 7:10 AM
Hello Vinod,
I think Event 01 can handle Event 05 as well. If you check the <ACTION> = NEUER_EINTRAG, the event will trigger when a new entry is being saved.
Also if you change some data in the table & try to save it will event 05 trigger ? So in this case the check cannot be made.
@Sanjane: Can you please share the code you written to achieve this ?
BR,
Suhas
2010 Feb 17 3:04 PM
2010 Feb 18 4:44 AM
The event 21 also does not work , I am surprised that how it can go to saving first and then enter custom code even if I use event 01 etc.
2010 Feb 18 6:50 AM
Hi,
You would have ceated table maintenance generator to do this activity right. So there you would have given one function group.
Go to that function group and change screen attribute of the field to 'Required'. Now system will it self show an error message by allowing user to enter values.
No need to do any validation in the EVENT BEFORE SAVE.
Revert if you have any more questions on these.
Regards,
Kusuma K.
2010 Feb 18 9:05 AM
Hi Kusuma,
Its done, thanks for the information.
Others,
Thanks for your inputs.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |