*&---------------------------------------------------------------------*
*& Include ZBCC0002 Maintenance view update create/change user id/date/time
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form update_nam_dat_tim
*&---------------------------------------------------------------------*
* when table maintain event 01, update crnam/crdat/crtim
* updat/updat/upnam
*----------------------------------------------------------------------*
FORM update_nam_dat_tim.
DATA l_index LIKE sy-tabix. " Index to note the lines found
FIELD-SYMBOLS <fs> TYPE any.
****
LOOP AT total.
READ TABLE extract WITH KEY <vim_xtotal_key>.
IF sy-subrc EQ 0.
l_index = sy-tabix.
ELSE.
CLEAR l_index.
ENDIF.
CASE <action>.
WHEN neuer_eintrag. " New entry
ASSIGN COMPONENT 'CRNAM' OF STRUCTURE <vim_total_struc> TO <fs>.
IF sy-subrc = 0. <fs> = sy-uname. ENDIF.
ASSIGN COMPONENT 'CRDAT' OF STRUCTURE <vim_total_struc> TO <fs>.
IF sy-subrc = 0. <fs> = sy-datum. ENDIF.
ASSIGN COMPONENT 'CRTIM' OF STRUCTURE <vim_total_struc> TO <fs>.
IF sy-subrc = 0. <fs> = sy-uzeit. ENDIF.
WHEN aendern. " changed entry
ASSIGN COMPONENT 'UPNAM' OF STRUCTURE <vim_total_struc> TO <fs>.
IF sy-subrc = 0. <fs> = sy-uname. ENDIF.
ASSIGN COMPONENT 'UPDAT' OF STRUCTURE <vim_total_struc> TO <fs>.
IF sy-subrc = 0. <fs> = sy-datum. ENDIF.
ASSIGN COMPONENT 'UPTIM' OF STRUCTURE <vim_total_struc> TO <fs>.
IF sy-subrc = 0. <fs> = sy-uzeit. ENDIF.
ENDCASE.
MODIFY total.
CHECK l_index GT 0.
extract = total.
MODIFY extract INDEX l_index.
ENDLOOP.
sy-subrc = 0.
ENDFORM. "update_nam_dat_tim