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

Automatic Update In Table

Former Member
0 Likes
1,788

Hi Gurus,

Consider the following scenario:

1. We have a table with table maintainance (SM30).

2. Whenever a user creates or modifies an entry through its maintanance view, the table should automatically be updated by the username and system time for that row.

3. Also, the user name and time should NOT be modifiable in the maintanance view (automatic update).

The table structure something like:

KeyField1 KeyField2 DataField1 DataField2 DataField3 DataField4 (Changed By) DataField5 (Changed At)

Also ...

4. What should we do if we want to allow ONLY ceration of new entries and do NOT allow any modification of existing entries.

5. The above stated functionalities can be achieved through an ABAP program. But, how can we do it using table maintanance generator (if at all it is possible !) ?

3 REPLIES 3
Read only

Former Member
0 Likes
1,005

Hi ,

This can be easily achieved using table maintainence events .

For automatic data and time and user name popultion , do foll steps

1. open table in SE11 in change mode .

2. Utilities-> tbl maintainence

3. Environment->events

4. You will info message , press enter .

5. F5

6. the event to be triggered at creating entry is 05. name the form routine as AT_NEWENTRY.

7. Double click on AT_NEWENTRY

8. In the include , write

form at_newentry . " ZAVLZ4 is my table

clear : zavlz4-uname , zavlz4-datum .

zavlz4-uname = sy-uname .

zavlz4-datum = sy-datlo .

endform . "at_newentry

9. to make some fields as input , open the Functiopn group in SE80 and open that screen -> go to elemtn list on right side and select the checkbox OUTPUT against the fields you want to make non input/ non editable

This will solve your issues .

thanks

Read only

Former Member
0 Likes
1,005

In se11--> give u r table name press the display button

from utilities tab--> go to table maintaince generator --> in tat u will find SOURCE CODE push button

You can change your code over there

Edited by: sugunav on Sep 8, 2009 3:42 PM

Read only

Former Member
0 Likes
1,005

Problem solved