Event 01 

Execution : Before saving the data in the database

Use

This event occurs before new, changed or deleted entries are written to the database. Other activities can be performed, for example:

· hidden entry processing

· fill hidden fields

· flag data to be written to hidden tables after the database change.

To have the changes saved by the central maintenance dialog routines, SY-SUBRC must be set to 0 at the end of the routine.

Realization

This event has no standard routine. The following global data is available for the realization of the user routine:

· internal table TOTAL

· field symbols

- field symbols <ACTION> and <ACTION_TEXT>

- <STATUS>-UPD_FLAG

If internal table data are to be changed before saving, t he changes should be made in both the internal table TOTAL and in the internal table EXTRACT.

FORM abc.
DATA: F_INDEX LIKE SY-TABIX. "Index to note the lines found
LOOP AT TOTAL.
IF <ACTION> =
desired constant.
READ TABLE EXTRACT WITH KEY TOTAL.
IF SY-SUBRC EQ 0.
F_INDEX = SY-TABIX.
ELSE.
CLEAR F_INDX.
ENDIF.
(make desired changes to the line TOTAL)
MODIFY TOTAL.
CHECK F_INDX GT 0.
EXTRACT = TOTAL.
MODIFY EXTRACT INDEX F_INDX.
ENDIF.
ENDLOOP.
SY-SUBRC = 0.
ENDFORM.