Show TOC

Process documentationEvent 01: Before Saving the Data in the Database Locate this document in the navigation structure

 

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

  • Additional processing of entries in the background

  • Filling background fields

  • Mark data for writing to background tables after the database changes.

Note Note

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

End of the note.

Process

There are no standard routines for this event. The following global data is available for the realization of user routines:

If internal table data is to be changed before saving, make the changes in the internal tables TOTAL and internal table EXTRACT.

Example Example

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 <vim_xtotal_key>.

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.

End of the example.