2013 Oct 25 11:26 AM
Hi,
I have created a Custom Table.
Now I am validating an Field value while making entry in a Custom Table through SM30 using the events in TMG.
I have written an validation in the Events
1. Before saving the data in Data base
2. Creating a new entry
Problem is when i enter the value and Press on ENTER key
the data gets validate and show the Error Message but when i press on save button these events are getting triggered but instead of
throwing the error Message the data gets saved.
Please help me how to resolve this.
Regards,
Shashikanth
2013 Oct 25 11:37 AM
On save are you reading data from EXTRACT and TOTAL table to validate?
Check this code for stopping it
DATA: ls_record TYPE <Custom Table>.
LOOP AT total .
READ TABLE extract WITH KEY <vim_xtotal_key>.
IF sy-subrc = 0.
ls_record = total.
IF ls_record-abc IS INITIAL OR
ls_record-def IS INITIAL OR
ls_record-erf IS INITIAL.
MESSAGE i115.
vim_abort_saving = 'X'.
ENDIF.
ENDIF.
ENDLOOP
.
Hi,
I have created a Custom Table.
Now I am validating an Field value while making entry in a Custom Table through SM30 using the events in TMG.
I have written an validation in the Events
1. Before saving the data in Data base
2. Creating a new entry
Problem is when i enter the value and Press on ENTER key
the data gets validate and show the Error Message but when i press on save button these events are getting triggered but instead of
throwing the error Message the data gets saved.
Please help me how to resolve this.
Regards,
Shashikanth
2013 Oct 25 11:37 AM
On save are you reading data from EXTRACT and TOTAL table to validate?
Check this code for stopping it
DATA: ls_record TYPE <Custom Table>.
LOOP AT total .
READ TABLE extract WITH KEY <vim_xtotal_key>.
IF sy-subrc = 0.
ls_record = total.
IF ls_record-abc IS INITIAL OR
ls_record-def IS INITIAL OR
ls_record-erf IS INITIAL.
MESSAGE i115.
vim_abort_saving = 'X'.
ENDIF.
ENDIF.
ENDLOOP
.
2013 Oct 25 12:29 PM
Check in debug mode while saving whether control goes in the validation code you have written.
Also provide more details on what code you have written for validation on saving the entry .
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |