Application Development and Automation 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: 
Read only

applying rules via table maintenance

Former Member
0 Likes
2,019

Hi all,

I have a requirement in that there is a z table which is maintained by the users. i have created a table maintenance and everything was working fine. but now got some enhancement in that if the user is entering any wrong value then it should populate some message... is it possible to apply rules on table maintenance??? any other suggestion is welcome..#

Regards.

Kusum.

Hi all,

I have a requirement in that there is a z table which is maintained by the users. i have created a table maintenance and everything was working fine. but now got some enhancement in that if the user is entering any wrong value then it should populate some message... is it possible to apply rules on table maintenance??? any other suggestion is welcome..#

Regards.

Kusum.

19 REPLIES 19
Read only

Former Member
0 Likes
1,911

HI,

Yes it is possible.

Make use of the events available.

On the table maintainance generator screen go to Environment->Modification-->Events.

You can add your code in the events available.

Regards,

Ankur Parab

Read only

0 Likes
1,911

Hi Ankur,

Are you talking about the SM30 Screen??

I am getting the event or envinment option in menu:(

could you please explain it in more detail...

Thanks and best Regards.

Kusum.

Read only

Former Member
0 Likes
1,911

Hi,

You can assign check table for the field and while doing the same in the messages to be raised you can simply provide the message that you want to raise.

Also you can use events in maintainence program as Ankur has specified above you can assign a routine for new entries which is event 5 and in the subrotine you can put you check.

Regards,

Himanshu

Read only

Former Member
0 Likes
1,911

there is a option in SE11 Environment->Modification Browser but still not getting the event option:(

Read only

0 Likes
1,911

Hi,

go to the table maintainence that is go to se11 display the table go to table maintaincene generator there go Environment->Modification >events.

You have to be in the table maintainence screen there you would find the events.

Regards,

Himanshu

Read only

0 Likes
1,911

thanks Himanshu..

got it

Read only

Former Member
0 Likes
1,911

I did created the routine , but really wondered how it works..

is it checking every line we enter in sm30 and then when we save??

because when I have put debugger in my routine it ia not at allgoing to the routine:(

So could anybody please help me in that

Read only

0 Likes
1,911

Hi,

It depends upon the event which you have chosen.

Currently which event have you chosen?

Regards,

Ankur Parab

Read only

0 Likes
1,911

Hi,

Well check if every thing is activated properly because if it is the control should go in the subroutine that you have created i hipe you are using event 5 for create new entries for validation so for every new entry when you save the control should definetly go there.

Regards,

Himanshu

Read only

Former Member
0 Likes
1,911

I have saved with event 5.

but its not going to the routine.

is there any specific way to activate it??

Read only

0 Likes
1,911

Hi,

When you create the entry give a subroutine name under form routine for that entry then you would see an icon appear under EDitor click on that to create the subroutine put your logic in the subroutine save and activate and then check.

Regards,

Himanshu

Read only

0 Likes
1,911

Hi Himanshu,

did the same way.

put the debugger on my code and when I am entering a new entry in SM30 iot is not going to debugging:(

Read only

0 Likes
1,911

Check the include where you ahve created is active, check the function group where you ahve your maintainence generator is active/generated. There is nothing else you ahve to do.

Regards,

Himanshu

Read only

0 Likes
1,911

Hi Guys,

This one is working for the new entries iin SM30.

I want the same functionality for change as well , i tried with the events 01,02,08 and 12 but not working for the change..

if anybody having any idea pls share with me...

Regards.

Kusum.

Edited by: kusum dubey on Aug 18, 2009 4:39 PM

Read only

Former Member
0 Likes
1,911

Hi Guys,

This one is working for the new entries iin SM30.

I want the same functionality for change as well , i tried with the events 01,02,08 and 12 but not working for the change..

if anybody having any idea pls share with me...

Regards.

Kusum.

Read only

0 Likes
1,911

Hi Kusum,

For change it would suggest to come to your maintainence and at PAI in your between your chain-endchain on fieldbefore endchain create a module.

do thebelow check and put your validations:

IF STATUS-ACTION = 'U'.

so if the field status-action is u you are changing the entry for the current row.

Regards,

Himanshu

Read only

0 Likes
1,911

Sorry Himanshu , Still not getting where exactly to code this..

could you please explain in more detail..

Read only

0 Likes
1,911

Hi,

Go to the table maintainence generator and then navigate to the screen which has been created. There you would have some code like below


PROCESS AFTER INPUT.
 MODULE LISTE_EXIT_COMMAND AT EXIT-COMMAND.
 MODULE LISTE_BEFORE_LOOP.
 LOOP AT EXTRACT.
   MODULE LISTE_INIT_WORKAREA.
   CHAIN.
     <<<<<Here you would have your fields from the table
    MODULE SET_UPDATE_FLAG ON CHAIN-REQUEST.
    MODULE UPDATE_CHANGE.   <<<<<Add a module like this
   ENDCHAIN.

Then double click on themodule name and create it then put a code like below in the module


MODULE UPDATE_CHANGE INPUT.
IF STATUS-ACTION = 'U'.   <<< This is the check for change
field1 = SY-DATUM.
 field2= SY-UNAME.
ENDIF.

ENDMODULE.                 " UPDATE_CHANGE  INPUT

Read only

0 Likes
1,911

Thanks Himanshu,

really appreciate your reply:)

As i don't know much about module pool programing but it is so straight forward.

I will try this and let you know .

Regards.

Kusum.