Application Development 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: 

Events on SM30

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

3 REPLIES 3

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member