04-15-2008 7:25 PM
Hi,
I have a SM30 of a Z table, and I need to do the following:
When the user types a value on the field, It must check if this typed value exists. If it doesn't exists, It must show an error message.
How can I do that?
Kind Regards,
Brian Gonsales
04-24-2008 2:31 PM
Hello Brian,
As Raj explained, one way of doing this is by making use of an EVENT, and writing your logic to check the value inside this.
Another simpler method exists, if the value should be restricted based on some other table. Have you tried defining a foreign key relationship to the field of your table, with that of the check table? With such a relationship, you wouldn't need to maintain any events. Your validation will be automatically done for you!
But if you do this, remember to re-generate your maintenance dialogue (SE54).
Cheers
Rekha
04-15-2008 7:44 PM
Hi Brian...
U can very well give such validations at the view level. there are certain event-handlers for the same.
In the table Maintenance screen, follow the menu path:
Environment>Modification>Events
Click on the new entries in the screen. Select a desired dialog event. (in ur case as u need it on entry of new fields , use the event 05). Now specify a form routine name.
On clicking on the editor , a new include name is proposed. Select the desired one and you can insert your lines of code here.
Write the code inside a FORM . ENDFORM, since these routines are dynamically called corresponding to the dialog events we have specified.
Hope this helps.
Regards,
Raj.
04-24-2008 2:31 PM
Hello Brian,
As Raj explained, one way of doing this is by making use of an EVENT, and writing your logic to check the value inside this.
Another simpler method exists, if the value should be restricted based on some other table. Have you tried defining a foreign key relationship to the field of your table, with that of the check table? With such a relationship, you wouldn't need to maintain any events. Your validation will be automatically done for you!
But if you do this, remember to re-generate your maintenance dialogue (SE54).
Cheers
Rekha
04-24-2008 4:35 PM