*---------------------------------------------------------------------*
*    view related FORM routines
*   generation date: 15.09.2019 at 20:59:10
*   view maintenance generator version: #001407#
*---------------------------------------------------------------------*
*...processing: ZVABAPGIT_IGNORE................................*
FORM GET_DATA_ZVABAPGIT_IGNORE.
  PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
  REFRESH TOTAL.
  CLEAR   TOTAL.
  SELECT * FROM ZABAPGIT_IGNORE WHERE
(VIM_WHERETAB) .
    CLEAR ZVABAPGIT_IGNORE .
ZVABAPGIT_IGNORE-OBJECT =
ZABAPGIT_IGNORE-OBJECT .
ZVABAPGIT_IGNORE-OBJ_NAME =
ZABAPGIT_IGNORE-OBJ_NAME .
ZVABAPGIT_IGNORE-AUTHOR =
ZABAPGIT_IGNORE-AUTHOR .
ZVABAPGIT_IGNORE-CREATED_ON =
ZABAPGIT_IGNORE-CREATED_ON .
<VIM_TOTAL_STRUC> = ZVABAPGIT_IGNORE.
    APPEND TOTAL.
  ENDSELECT.
  SORT TOTAL BY <VIM_XTOTAL_KEY>.
  <STATUS>-ALR_SORTED = 'R'.
*.check dynamic selectoptions (not in DDIC)...........................*
  IF X_HEADER-SELECTION NE SPACE.
    PERFORM CHECK_DYNAMIC_SELECT_OPTIONS.
  ELSEIF X_HEADER-DELMDTFLAG NE SPACE.
    PERFORM BUILD_MAINKEY_TAB.
  ENDIF.
  REFRESH EXTRACT.
ENDFORM.
*---------------------------------------------------------------------*
FORM DB_UPD_ZVABAPGIT_IGNORE .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
  CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZVABAPGIT_IGNORE.
  IF <ACTION> = UPDATE_GELOESCHT.
    <ACTION> = GELOESCHT.
  ENDIF.
  CASE <ACTION>.
   WHEN NEUER_GELOESCHT.
IF STATUS_ZVABAPGIT_IGNORE-ST_DELETE EQ GELOESCHT.
     READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY>.
     IF SY-SUBRC EQ 0.
       DELETE EXTRACT INDEX SY-TABIX.
     ENDIF.
    ENDIF.
    DELETE TOTAL.
    IF X_HEADER-DELMDTFLAG NE SPACE.
      PERFORM DELETE_FROM_MAINKEY_TAB.
    ENDIF.
   WHEN GELOESCHT.
  SELECT SINGLE FOR UPDATE * FROM ZABAPGIT_IGNORE WHERE
  OBJECT = ZVABAPGIT_IGNORE-OBJECT AND
  OBJ_NAME = ZVABAPGIT_IGNORE-OBJ_NAME .
    IF SY-SUBRC = 0.
    DELETE ZABAPGIT_IGNORE .
    ENDIF.
    IF STATUS-DELETE EQ GELOESCHT.
      READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY> BINARY SEARCH.
      DELETE EXTRACT INDEX SY-TABIX.
    ENDIF.
    DELETE TOTAL.
    IF X_HEADER-DELMDTFLAG NE SPACE.
      PERFORM DELETE_FROM_MAINKEY_TAB.
    ENDIF.
   WHEN OTHERS.
  SELECT SINGLE FOR UPDATE * FROM ZABAPGIT_IGNORE WHERE
  OBJECT = ZVABAPGIT_IGNORE-OBJECT AND
  OBJ_NAME = ZVABAPGIT_IGNORE-OBJ_NAME .
    IF SY-SUBRC <> 0.   "insert preprocessing: init WA
      CLEAR ZABAPGIT_IGNORE.
    ENDIF.
ZABAPGIT_IGNORE-OBJECT =
ZVABAPGIT_IGNORE-OBJECT .
ZABAPGIT_IGNORE-OBJ_NAME =
ZVABAPGIT_IGNORE-OBJ_NAME .
ZABAPGIT_IGNORE-AUTHOR =
ZVABAPGIT_IGNORE-AUTHOR .
ZABAPGIT_IGNORE-CREATED_ON =
ZVABAPGIT_IGNORE-CREATED_ON .
    IF SY-SUBRC = 0.
    UPDATE ZABAPGIT_IGNORE .
    ELSE.
    INSERT ZABAPGIT_IGNORE .
    ENDIF.
    READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY>.
    IF SY-SUBRC EQ 0.
      <XACT> = ORIGINAL.
      MODIFY EXTRACT INDEX SY-TABIX.
    ENDIF.
    <ACTION> = ORIGINAL.
    MODIFY TOTAL.
  ENDCASE.
ENDLOOP.
CLEAR: STATUS_ZVABAPGIT_IGNORE-UPD_FLAG,
STATUS_ZVABAPGIT_IGNORE-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZVABAPGIT_IGNORE.
  SELECT SINGLE * FROM ZABAPGIT_IGNORE WHERE
OBJECT = ZVABAPGIT_IGNORE-OBJECT AND
OBJ_NAME = ZVABAPGIT_IGNORE-OBJ_NAME .
ZVABAPGIT_IGNORE-OBJECT =
ZABAPGIT_IGNORE-OBJECT .
ZVABAPGIT_IGNORE-OBJ_NAME =
ZABAPGIT_IGNORE-OBJ_NAME .
ZVABAPGIT_IGNORE-AUTHOR =
ZABAPGIT_IGNORE-AUTHOR .
ZVABAPGIT_IGNORE-CREATED_ON =
ZABAPGIT_IGNORE-CREATED_ON .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZVABAPGIT_IGNORE USING VALUE(CM_ACTION) RC.
  DATA: RETCODE LIKE SY-SUBRC, COUNT TYPE I, TRSP_KEYLEN TYPE SYFLENG.
  FIELD-SYMBOLS: <TAB_KEY_X> TYPE X.
  CLEAR RC.
MOVE ZVABAPGIT_IGNORE-OBJECT TO
ZABAPGIT_IGNORE-OBJECT .
MOVE ZVABAPGIT_IGNORE-OBJ_NAME TO
ZABAPGIT_IGNORE-OBJ_NAME .
  CORR_KEYTAB             =  E071K.
  CORR_KEYTAB-OBJNAME     = 'ZABAPGIT_IGNORE'.
  IF NOT <vim_corr_keyx> IS ASSIGNED.
    ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
  ENDIF.
  ASSIGN ZABAPGIT_IGNORE TO <TAB_KEY_X> CASTING.
  PERFORM VIM_GET_TRSPKEYLEN
    USING 'ZABAPGIT_IGNORE'
    CHANGING TRSP_KEYLEN.
  <VIM_CORR_KEYX>(TRSP_KEYLEN) = <TAB_KEY_X>(TRSP_KEYLEN).
  PERFORM UPDATE_CORR_KEYTAB USING CM_ACTION RETCODE.
  ADD: RETCODE TO RC, 1 TO COUNT.
  IF RC LT COUNT AND CM_ACTION NE PRUEFEN.
    CLEAR RC.
  ENDIF.

ENDFORM.
*---------------------------------------------------------------------*
