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: 

Query on Table maintenance

abhishekjain
Participant
0 Kudos

I wish to create a custom validation on a particular field in SM30 for a particular table. If the validation fails an error message must appear with the field in error available for correction.

Can you please let me know if there exists any such table maintainence event to place such code.

I have tried coding the "Before Save" event but when "message E " instruction

is used it does not display it on the screen of data containing the table control.

Appreciate your help.

4 REPLIES 4

Former Member
0 Kudos

Hello,

Why don't you create a value table for the domain of that field, and create a foreign key relationship? This way SAP will do an automatic value check when the user enters the data + a search help will be available?

If this does not suit you, can you please elaborate on the kind of check that needs to be done?

Please reward points if helpfull.

Kind Regards,

Bart Pelsmaekers

Former Member
0 Kudos

Hi Abhishek,

You can do this with the modification event in the table maintenance.Can write a code here, and can popup the required error message from SM30.

Navigate as below:

SE11(Table name)->Utilities->Table maintenance generator.

On the table maintenance screen

Environment->Modification->Events.

Thanks,

Raju

Former Member
0 Kudos

Did you set the sy-subrc to a non-zero value before issuing the message? In the 'Before Save' or the 01 event, you have to set the sy-subrc value to a non-zero value to make the system stop in the maintenance screen and allow the user to correct it. You don't have to issue an error message, just issue a type S or type I message but <b>setting sy-subrc to a non-zero value</b> is the key. We use this event all the time just like the way you mentioned and it works for us.

Former Member
0 Kudos

Hi,

With the help of the table maintenance generator, you are able to maintain the ENTRIES of the table in SM30 transaction.

It can be set in transaction SE11 - Tools - Table maintenance generator.

Table maintanance Generator is used to manually input values using transaction sm30

follow below steps

1) go to se11 check table maintanance check box under attributes tab

2) utilities-table maintanance Generator-> create function group and assign it under

function group input box. Also assign authorization group default &NC& .

3) select standard recording routine radio in table table mainitainence generator to move table

contents to quality and production by assigning it to request.

4) select maintaience type as single step.

5) maintainence screen as system generated numbers this dialog box appears when you click on create button

6) save and activate table

One step, two step in Table Maintenance Generator

Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.

Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.

SM30 is used for table maintenance(addition or deletion of records),

For all the tables in SE11 for which Table maintenance is selected , they can be maintained in SM30

Sm30 is used to maintain the table ,i.e to delete ,insert or modify the field values and all..

It creates the maintenance screen for u for the aprticular table as the maintenance is not allowed for the table..

In the SE11 delivery and maintenance tab, keep the maintenance allowed..

Then come to the SM30 and then enter the table name and press maintain..,

Give the authorization group if necessary and give the function group and then select maintenance type as one step and give the screen numbers as system specified..

Then create,,,

Then u will able to see the maintenance view for the table in which u can able to insert and delete the table values...

We use SM30 transaction for entering values into any DB table.

First we create a table in SE11 and create the table maintenance generator for that Table using (utilities-> table maintenance generator) and create it.

Then it will create a View.

After that from SM30, enter the table name and Maintain, create new entries, change the existing entries for that table.

Hope this resolves your query.

Reward all the helpful answers.

Rgds,

P.Naganjana Reddy