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: 

Extended Table Maintenance Events

Former Member
0 Kudos

Hi,

Requirement:

1. Table Name: ZORDER_RESTRICT.

2. Contains many custom fields + Changed By and Changed

On fields.

3. When any user changes an existing record, I need to populate the Changed By and Changed On fields.

Issue:

1. I have coded the events on SE54 as follows:

FORM Z_MODIFY_USER_INFO_GENERATION.

DATA: F_INDEX LIKE SY-TABIX.

DATA: WA_ZORDER_RESTRICT TYPE ZORDER_RESTRICT.

BREAK-POINT.

LOOP AT TOTAL.

IF <ACTION> = AENDERN.

READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY>.

IF SY-SUBRC EQ 0.

F_INDEX = SY-TABIX.

ELSE.

CLEAR F_INDEX.

ENDIF.

WA_ZORDER_RESTRICT = TOTAL.

WA_ZORDER_RESTRICT-CHANGED_BY = SY-UNAME.

WA_ZORDER_RESTRICT-CHANGE_DATE = SY-DATUM.

TOTAL = WA_ZORDER_RESTRICT.

MODIFY TOTAL.

CHECK F_INDEX GT 0.

EXTRACT = TOTAL.

MODIFY EXTRACT INDEX F_INDEX.

ENDIF.

ENDLOOP.

SY-SUBRC = 0.

ENDFORM. "Z_MODIFY_USER_INFO_GENERATION

2. The event is "01 = Before saving the data in the database".

3. When saving the record, I see the changed By and Changed On being populated, but they arent saved onto the databasee.

Any help in regards to this will be of great help for me.

Regards,

GPK.

1 REPLY 1

Former Member
0 Kudos

Hi Praveen,

Go through this weblog on table maintenance.

/people/sudheer.cheedella/blog/2006/02/20/extracting-data-in-table-maintenance

Hope this works for you .let me know if you need more details

Regards,

Vicky