*---------------------------------------------------------------------*
*    view related FORM routines
*   generation date: 07.07.2019 at 12:20:13
*   view maintenance generator version: #001407#
*---------------------------------------------------------------------*
*...processing: ZCILIB_BOT_V....................................*
FORM GET_DATA_ZCILIB_BOT_V.
  PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
  REFRESH TOTAL.
  CLEAR   TOTAL.
  SELECT * FROM ZCILIB_BOT WHERE
(VIM_WHERETAB) .
    CLEAR ZCILIB_BOT_V .
ZCILIB_BOT_V-BOT =
ZCILIB_BOT-BOT .
ZCILIB_BOT_V-ENABLE_CTS_STATUS =
ZCILIB_BOT-ENABLE_CTS_STATUS .
ZCILIB_BOT_V-CTS_STATUS_TEMPLATE_IMPL =
ZCILIB_BOT-CTS_STATUS_TEMPLATE_IMPL .
ZCILIB_BOT_V-ENABLE_CTS_UPDATES =
ZCILIB_BOT-ENABLE_CTS_UPDATES .
ZCILIB_BOT_V-CTS_UPDATE_TEMPLATE_IMPL =
ZCILIB_BOT-CTS_UPDATE_TEMPLATE_IMPL .
ZCILIB_BOT_V-SYSTEM_GROUP =
ZCILIB_BOT-SYSTEM_GROUP .
ZCILIB_BOT_V-ENABLE_CTS_STATUS_WIKI =
ZCILIB_BOT-ENABLE_CTS_STATUS_WIKI .
ZCILIB_BOT_V-CTS_STATUS_WIKI_TEMPLATE_IMPL =
ZCILIB_BOT-CTS_STATUS_WIKI_TEMPLATE_IMPL .
ZCILIB_BOT_V-ENABLE_CTS_PR_LABELS =
ZCILIB_BOT-ENABLE_CTS_PR_LABELS .
<VIM_TOTAL_STRUC> = ZCILIB_BOT_V.
    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_ZCILIB_BOT_V .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
  CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZCILIB_BOT_V.
  IF <ACTION> = UPDATE_GELOESCHT.
    <ACTION> = GELOESCHT.
  ENDIF.
  CASE <ACTION>.
   WHEN NEUER_GELOESCHT.
IF STATUS_ZCILIB_BOT_V-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 ZCILIB_BOT WHERE
  BOT = ZCILIB_BOT_V-BOT .
    IF SY-SUBRC = 0.
    DELETE ZCILIB_BOT .
    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 ZCILIB_BOT WHERE
  BOT = ZCILIB_BOT_V-BOT .
    IF SY-SUBRC <> 0.   "insert preprocessing: init WA
      CLEAR ZCILIB_BOT.
    ENDIF.
ZCILIB_BOT-BOT =
ZCILIB_BOT_V-BOT .
ZCILIB_BOT-ENABLE_CTS_STATUS =
ZCILIB_BOT_V-ENABLE_CTS_STATUS .
ZCILIB_BOT-CTS_STATUS_TEMPLATE_IMPL =
ZCILIB_BOT_V-CTS_STATUS_TEMPLATE_IMPL .
ZCILIB_BOT-ENABLE_CTS_UPDATES =
ZCILIB_BOT_V-ENABLE_CTS_UPDATES .
ZCILIB_BOT-CTS_UPDATE_TEMPLATE_IMPL =
ZCILIB_BOT_V-CTS_UPDATE_TEMPLATE_IMPL .
ZCILIB_BOT-SYSTEM_GROUP =
ZCILIB_BOT_V-SYSTEM_GROUP .
ZCILIB_BOT-ENABLE_CTS_STATUS_WIKI =
ZCILIB_BOT_V-ENABLE_CTS_STATUS_WIKI .
ZCILIB_BOT-CTS_STATUS_WIKI_TEMPLATE_IMPL =
ZCILIB_BOT_V-CTS_STATUS_WIKI_TEMPLATE_IMPL .
ZCILIB_BOT-ENABLE_CTS_PR_LABELS =
ZCILIB_BOT_V-ENABLE_CTS_PR_LABELS .
    IF SY-SUBRC = 0.
    UPDATE ZCILIB_BOT ##WARN_OK.
    ELSE.
    INSERT ZCILIB_BOT .
    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_ZCILIB_BOT_V-UPD_FLAG,
STATUS_ZCILIB_BOT_V-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZCILIB_BOT_V.
  SELECT SINGLE * FROM ZCILIB_BOT WHERE
BOT = ZCILIB_BOT_V-BOT .
ZCILIB_BOT_V-BOT =
ZCILIB_BOT-BOT .
ZCILIB_BOT_V-ENABLE_CTS_STATUS =
ZCILIB_BOT-ENABLE_CTS_STATUS .
ZCILIB_BOT_V-CTS_STATUS_TEMPLATE_IMPL =
ZCILIB_BOT-CTS_STATUS_TEMPLATE_IMPL .
ZCILIB_BOT_V-ENABLE_CTS_UPDATES =
ZCILIB_BOT-ENABLE_CTS_UPDATES .
ZCILIB_BOT_V-CTS_UPDATE_TEMPLATE_IMPL =
ZCILIB_BOT-CTS_UPDATE_TEMPLATE_IMPL .
ZCILIB_BOT_V-SYSTEM_GROUP =
ZCILIB_BOT-SYSTEM_GROUP .
ZCILIB_BOT_V-ENABLE_CTS_STATUS_WIKI =
ZCILIB_BOT-ENABLE_CTS_STATUS_WIKI .
ZCILIB_BOT_V-CTS_STATUS_WIKI_TEMPLATE_IMPL =
ZCILIB_BOT-CTS_STATUS_WIKI_TEMPLATE_IMPL .
ZCILIB_BOT_V-ENABLE_CTS_PR_LABELS =
ZCILIB_BOT-ENABLE_CTS_PR_LABELS .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZCILIB_BOT_V 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 ZCILIB_BOT_V-BOT TO
ZCILIB_BOT-BOT .
  CORR_KEYTAB             =  E071K.
  CORR_KEYTAB-OBJNAME     = 'ZCILIB_BOT'.
  IF NOT <vim_corr_keyx> IS ASSIGNED.
    ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
  ENDIF.
  ASSIGN ZCILIB_BOT TO <TAB_KEY_X> CASTING.
  PERFORM VIM_GET_TRSPKEYLEN
    USING 'ZCILIB_BOT'
    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.
*---------------------------------------------------------------------*
*...processing: ZCILIB_HOST_V...................................*
FORM GET_DATA_ZCILIB_HOST_V.
  PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
  REFRESH TOTAL.
  CLEAR   TOTAL.
  SELECT * FROM ZCILIB_HOST WHERE
(VIM_WHERETAB) .
    CLEAR ZCILIB_HOST_V .
ZCILIB_HOST_V-HOST =
ZCILIB_HOST-HOST .
ZCILIB_HOST_V-DESTINATION =
ZCILIB_HOST-DESTINATION .
ZCILIB_HOST_V-HOST_IMPL =
ZCILIB_HOST-HOST_IMPL .
ZCILIB_HOST_V-AUTH_MECHANISM =
ZCILIB_HOST-AUTH_MECHANISM .
ZCILIB_HOST_V-API_TOKEN =
ZCILIB_HOST-API_TOKEN .
ZCILIB_HOST_V-BOT =
ZCILIB_HOST-BOT .
ZCILIB_HOST_V-BRANCHING_STRATEGY =
ZCILIB_HOST-BRANCHING_STRATEGY .
ZCILIB_HOST_V-CTS_STATUS_WIKI_PATH =
ZCILIB_HOST-CTS_STATUS_WIKI_PATH .
<VIM_TOTAL_STRUC> = ZCILIB_HOST_V.
    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_ZCILIB_HOST_V .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
  CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZCILIB_HOST_V.
  IF <ACTION> = UPDATE_GELOESCHT.
    <ACTION> = GELOESCHT.
  ENDIF.
  CASE <ACTION>.
   WHEN NEUER_GELOESCHT.
IF STATUS_ZCILIB_HOST_V-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 ZCILIB_HOST WHERE
  HOST = ZCILIB_HOST_V-HOST .
    IF SY-SUBRC = 0.
    DELETE ZCILIB_HOST .
    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 ZCILIB_HOST WHERE
  HOST = ZCILIB_HOST_V-HOST .
    IF SY-SUBRC <> 0.   "insert preprocessing: init WA
      CLEAR ZCILIB_HOST.
    ENDIF.
ZCILIB_HOST-HOST =
ZCILIB_HOST_V-HOST .
ZCILIB_HOST-DESTINATION =
ZCILIB_HOST_V-DESTINATION .
ZCILIB_HOST-HOST_IMPL =
ZCILIB_HOST_V-HOST_IMPL .
ZCILIB_HOST-AUTH_MECHANISM =
ZCILIB_HOST_V-AUTH_MECHANISM .
ZCILIB_HOST-API_TOKEN =
ZCILIB_HOST_V-API_TOKEN .
ZCILIB_HOST-BOT =
ZCILIB_HOST_V-BOT .
ZCILIB_HOST-BRANCHING_STRATEGY =
ZCILIB_HOST_V-BRANCHING_STRATEGY .
ZCILIB_HOST-CTS_STATUS_WIKI_PATH =
ZCILIB_HOST_V-CTS_STATUS_WIKI_PATH .
    IF SY-SUBRC = 0.
    UPDATE ZCILIB_HOST ##WARN_OK.
    ELSE.
    INSERT ZCILIB_HOST .
    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_ZCILIB_HOST_V-UPD_FLAG,
STATUS_ZCILIB_HOST_V-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZCILIB_HOST_V.
  SELECT SINGLE * FROM ZCILIB_HOST WHERE
HOST = ZCILIB_HOST_V-HOST .
ZCILIB_HOST_V-HOST =
ZCILIB_HOST-HOST .
ZCILIB_HOST_V-DESTINATION =
ZCILIB_HOST-DESTINATION .
ZCILIB_HOST_V-HOST_IMPL =
ZCILIB_HOST-HOST_IMPL .
ZCILIB_HOST_V-AUTH_MECHANISM =
ZCILIB_HOST-AUTH_MECHANISM .
ZCILIB_HOST_V-API_TOKEN =
ZCILIB_HOST-API_TOKEN .
ZCILIB_HOST_V-BOT =
ZCILIB_HOST-BOT .
ZCILIB_HOST_V-BRANCHING_STRATEGY =
ZCILIB_HOST-BRANCHING_STRATEGY .
ZCILIB_HOST_V-CTS_STATUS_WIKI_PATH =
ZCILIB_HOST-CTS_STATUS_WIKI_PATH .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZCILIB_HOST_V 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 ZCILIB_HOST_V-HOST TO
ZCILIB_HOST-HOST .
  CORR_KEYTAB             =  E071K.
  CORR_KEYTAB-OBJNAME     = 'ZCILIB_HOST'.
  IF NOT <vim_corr_keyx> IS ASSIGNED.
    ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
  ENDIF.
  ASSIGN ZCILIB_HOST TO <TAB_KEY_X> CASTING.
  PERFORM VIM_GET_TRSPKEYLEN
    USING 'ZCILIB_HOST'
    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.
*---------------------------------------------------------------------*
*...processing: ZCILIB_REPO_V...................................*
FORM GET_DATA_ZCILIB_REPO_V.
  PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
  REFRESH TOTAL.
  CLEAR   TOTAL.
  SELECT * FROM ZCILIB_REPO WHERE
(VIM_WHERETAB) .
    CLEAR ZCILIB_REPO_V .
ZCILIB_REPO_V-HOST =
ZCILIB_REPO-HOST .
ZCILIB_REPO_V-REPO =
ZCILIB_REPO-REPO .
ZCILIB_REPO_V-BOT =
ZCILIB_REPO-BOT .
ZCILIB_REPO_V-BRANCHING_STRATEGY =
ZCILIB_REPO-BRANCHING_STRATEGY .
ZCILIB_REPO_V-CTS_STATUS_WIKI_PATH =
ZCILIB_REPO-CTS_STATUS_WIKI_PATH .
<VIM_TOTAL_STRUC> = ZCILIB_REPO_V.
    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_ZCILIB_REPO_V .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
  CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZCILIB_REPO_V.
  IF <ACTION> = UPDATE_GELOESCHT.
    <ACTION> = GELOESCHT.
  ENDIF.
  CASE <ACTION>.
   WHEN NEUER_GELOESCHT.
IF STATUS_ZCILIB_REPO_V-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 ZCILIB_REPO WHERE
  HOST = ZCILIB_REPO_V-HOST AND
  REPO = ZCILIB_REPO_V-REPO .
    IF SY-SUBRC = 0.
    DELETE ZCILIB_REPO .
    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 ZCILIB_REPO WHERE
  HOST = ZCILIB_REPO_V-HOST AND
  REPO = ZCILIB_REPO_V-REPO .
    IF SY-SUBRC <> 0.   "insert preprocessing: init WA
      CLEAR ZCILIB_REPO.
    ENDIF.
ZCILIB_REPO-HOST =
ZCILIB_REPO_V-HOST .
ZCILIB_REPO-REPO =
ZCILIB_REPO_V-REPO .
ZCILIB_REPO-BOT =
ZCILIB_REPO_V-BOT .
ZCILIB_REPO-BRANCHING_STRATEGY =
ZCILIB_REPO_V-BRANCHING_STRATEGY .
ZCILIB_REPO-CTS_STATUS_WIKI_PATH =
ZCILIB_REPO_V-CTS_STATUS_WIKI_PATH .
    IF SY-SUBRC = 0.
    UPDATE ZCILIB_REPO ##WARN_OK.
    ELSE.
    INSERT ZCILIB_REPO .
    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_ZCILIB_REPO_V-UPD_FLAG,
STATUS_ZCILIB_REPO_V-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZCILIB_REPO_V.
  SELECT SINGLE * FROM ZCILIB_REPO WHERE
HOST = ZCILIB_REPO_V-HOST AND
REPO = ZCILIB_REPO_V-REPO .
ZCILIB_REPO_V-HOST =
ZCILIB_REPO-HOST .
ZCILIB_REPO_V-REPO =
ZCILIB_REPO-REPO .
ZCILIB_REPO_V-BOT =
ZCILIB_REPO-BOT .
ZCILIB_REPO_V-BRANCHING_STRATEGY =
ZCILIB_REPO-BRANCHING_STRATEGY .
ZCILIB_REPO_V-CTS_STATUS_WIKI_PATH =
ZCILIB_REPO-CTS_STATUS_WIKI_PATH .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZCILIB_REPO_V 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 ZCILIB_REPO_V-HOST TO
ZCILIB_REPO-HOST .
MOVE ZCILIB_REPO_V-REPO TO
ZCILIB_REPO-REPO .
  CORR_KEYTAB             =  E071K.
  CORR_KEYTAB-OBJNAME     = 'ZCILIB_REPO'.
  IF NOT <vim_corr_keyx> IS ASSIGNED.
    ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
  ENDIF.
  ASSIGN ZCILIB_REPO TO <TAB_KEY_X> CASTING.
  PERFORM VIM_GET_TRSPKEYLEN
    USING 'ZCILIB_REPO'
    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.
*---------------------------------------------------------------------*
*...processing: ZCILIB_SETT_V...................................*
FORM GET_DATA_ZCILIB_SETT_V.
  PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
  REFRESH TOTAL.
  CLEAR   TOTAL.
  SELECT * FROM ZCILIB_SETTINGS WHERE
    VERSION EQ '000' AND
(VIM_WHERETAB) .
    CLEAR ZCILIB_SETT_V .
ZCILIB_SETT_V-VERSION =
ZCILIB_SETTINGS-VERSION .
ZCILIB_SETT_V-ENABLE_LOGGING =
ZCILIB_SETTINGS-ENABLE_LOGGING .
ZCILIB_SETT_V-BAL_OBJECT =
ZCILIB_SETTINGS-BAL_OBJECT .
ZCILIB_SETT_V-BAL_SUBOBJECT =
ZCILIB_SETTINGS-BAL_SUBOBJECT .
ZCILIB_SETT_V-BAL_KEEP_DAYS =
ZCILIB_SETTINGS-BAL_KEEP_DAYS .
ZCILIB_SETT_V-EXIT_EVENT_DESTINATION =
ZCILIB_SETTINGS-EXIT_EVENT_DESTINATION .
<VIM_TOTAL_STRUC> = ZCILIB_SETT_V.
    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_ZCILIB_SETT_V .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
  CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZCILIB_SETT_V.
  IF <ACTION> = UPDATE_GELOESCHT.
    <ACTION> = GELOESCHT.
  ENDIF.
  CASE <ACTION>.
   WHEN NEUER_GELOESCHT.
IF STATUS_ZCILIB_SETT_V-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 ZCILIB_SETTINGS WHERE
  VERSION = ZCILIB_SETT_V-VERSION .
    IF SY-SUBRC = 0.
    DELETE ZCILIB_SETTINGS .
    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 ZCILIB_SETTINGS WHERE
  VERSION = ZCILIB_SETT_V-VERSION .
    IF SY-SUBRC <> 0.   "insert preprocessing: init WA
      CLEAR ZCILIB_SETTINGS.
    ENDIF.
ZCILIB_SETTINGS-VERSION =
ZCILIB_SETT_V-VERSION .
ZCILIB_SETTINGS-ENABLE_LOGGING =
ZCILIB_SETT_V-ENABLE_LOGGING .
ZCILIB_SETTINGS-BAL_OBJECT =
ZCILIB_SETT_V-BAL_OBJECT .
ZCILIB_SETTINGS-BAL_SUBOBJECT =
ZCILIB_SETT_V-BAL_SUBOBJECT .
ZCILIB_SETTINGS-BAL_KEEP_DAYS =
ZCILIB_SETT_V-BAL_KEEP_DAYS .
ZCILIB_SETTINGS-EXIT_EVENT_DESTINATION =
ZCILIB_SETT_V-EXIT_EVENT_DESTINATION .
    IF SY-SUBRC = 0.
    UPDATE ZCILIB_SETTINGS ##WARN_OK.
    ELSE.
    INSERT ZCILIB_SETTINGS .
    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_ZCILIB_SETT_V-UPD_FLAG,
STATUS_ZCILIB_SETT_V-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZCILIB_SETT_V.
  SELECT SINGLE * FROM ZCILIB_SETTINGS WHERE
VERSION = ZCILIB_SETT_V-VERSION .
ZCILIB_SETT_V-VERSION =
ZCILIB_SETTINGS-VERSION .
ZCILIB_SETT_V-ENABLE_LOGGING =
ZCILIB_SETTINGS-ENABLE_LOGGING .
ZCILIB_SETT_V-BAL_OBJECT =
ZCILIB_SETTINGS-BAL_OBJECT .
ZCILIB_SETT_V-BAL_SUBOBJECT =
ZCILIB_SETTINGS-BAL_SUBOBJECT .
ZCILIB_SETT_V-BAL_KEEP_DAYS =
ZCILIB_SETTINGS-BAL_KEEP_DAYS .
ZCILIB_SETT_V-EXIT_EVENT_DESTINATION =
ZCILIB_SETTINGS-EXIT_EVENT_DESTINATION .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZCILIB_SETT_V 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 ZCILIB_SETT_V-VERSION TO
ZCILIB_SETTINGS-VERSION .
  CORR_KEYTAB             =  E071K.
  CORR_KEYTAB-OBJNAME     = 'ZCILIB_SETTINGS'.
  IF NOT <vim_corr_keyx> IS ASSIGNED.
    ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
  ENDIF.
  ASSIGN ZCILIB_SETTINGS TO <TAB_KEY_X> CASTING.
  PERFORM VIM_GET_TRSPKEYLEN
    USING 'ZCILIB_SETTINGS'
    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.
*---------------------------------------------------------------------*
*...processing: ZCILIB_SYSGRP_V.................................*
FORM GET_DATA_ZCILIB_SYSGRP_V.
  PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
  REFRESH TOTAL.
  CLEAR   TOTAL.
  SELECT * FROM ZCILIB_SYSGRP WHERE
(VIM_WHERETAB) .
    CLEAR ZCILIB_SYSGRP_V .
ZCILIB_SYSGRP_V-SYSTEM_GROUP =
ZCILIB_SYSGRP-SYSTEM_GROUP .
<VIM_TOTAL_STRUC> = ZCILIB_SYSGRP_V.
    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_ZCILIB_SYSGRP_V .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
  CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZCILIB_SYSGRP_V.
  IF <ACTION> = UPDATE_GELOESCHT.
    <ACTION> = GELOESCHT.
  ENDIF.
  CASE <ACTION>.
   WHEN NEUER_GELOESCHT.
IF STATUS_ZCILIB_SYSGRP_V-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 ZCILIB_SYSGRP WHERE
  SYSTEM_GROUP = ZCILIB_SYSGRP_V-SYSTEM_GROUP .
    IF SY-SUBRC = 0.
    DELETE ZCILIB_SYSGRP .
    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 ZCILIB_SYSGRP WHERE
  SYSTEM_GROUP = ZCILIB_SYSGRP_V-SYSTEM_GROUP .
    IF SY-SUBRC <> 0.   "insert preprocessing: init WA
      CLEAR ZCILIB_SYSGRP.
    ENDIF.
ZCILIB_SYSGRP-SYSTEM_GROUP =
ZCILIB_SYSGRP_V-SYSTEM_GROUP .
    IF SY-SUBRC = 0.
    UPDATE ZCILIB_SYSGRP ##WARN_OK.
    ELSE.
    INSERT ZCILIB_SYSGRP .
    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_ZCILIB_SYSGRP_V-UPD_FLAG,
STATUS_ZCILIB_SYSGRP_V-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZCILIB_SYSGRP_V.
  SELECT SINGLE * FROM ZCILIB_SYSGRP WHERE
SYSTEM_GROUP = ZCILIB_SYSGRP_V-SYSTEM_GROUP .
ZCILIB_SYSGRP_V-SYSTEM_GROUP =
ZCILIB_SYSGRP-SYSTEM_GROUP .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZCILIB_SYSGRP_V 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 ZCILIB_SYSGRP_V-SYSTEM_GROUP TO
ZCILIB_SYSGRP-SYSTEM_GROUP .
  CORR_KEYTAB             =  E071K.
  CORR_KEYTAB-OBJNAME     = 'ZCILIB_SYSGRP'.
  IF NOT <vim_corr_keyx> IS ASSIGNED.
    ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
  ENDIF.
  ASSIGN ZCILIB_SYSGRP TO <TAB_KEY_X> CASTING.
  PERFORM VIM_GET_TRSPKEYLEN
    USING 'ZCILIB_SYSGRP'
    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.
*---------------------------------------------------------------------*
*...processing: ZCILIB_SYSTEM_V.................................*
FORM GET_DATA_ZCILIB_SYSTEM_V.
  PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
  REFRESH TOTAL.
  CLEAR   TOTAL.
  SELECT * FROM ZCILIB_SYSTEM WHERE
(VIM_WHERETAB) .
    CLEAR ZCILIB_SYSTEM_V .
ZCILIB_SYSTEM_V-SYSTEM_GROUP =
ZCILIB_SYSTEM-SYSTEM_GROUP .
ZCILIB_SYSTEM_V-SYSTEM_ID =
ZCILIB_SYSTEM-SYSTEM_ID .
ZCILIB_SYSTEM_V-SYS_ORDER =
ZCILIB_SYSTEM-SYS_ORDER .
ZCILIB_SYSTEM_V-DESCRIPTION =
ZCILIB_SYSTEM-DESCRIPTION .
<VIM_TOTAL_STRUC> = ZCILIB_SYSTEM_V.
    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_ZCILIB_SYSTEM_V .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
  CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZCILIB_SYSTEM_V.
  IF <ACTION> = UPDATE_GELOESCHT.
    <ACTION> = GELOESCHT.
  ENDIF.
  CASE <ACTION>.
   WHEN NEUER_GELOESCHT.
IF STATUS_ZCILIB_SYSTEM_V-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 ZCILIB_SYSTEM WHERE
  SYSTEM_GROUP = ZCILIB_SYSTEM_V-SYSTEM_GROUP AND
  SYSTEM_ID = ZCILIB_SYSTEM_V-SYSTEM_ID .
    IF SY-SUBRC = 0.
    DELETE ZCILIB_SYSTEM .
    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 ZCILIB_SYSTEM WHERE
  SYSTEM_GROUP = ZCILIB_SYSTEM_V-SYSTEM_GROUP AND
  SYSTEM_ID = ZCILIB_SYSTEM_V-SYSTEM_ID .
    IF SY-SUBRC <> 0.   "insert preprocessing: init WA
      CLEAR ZCILIB_SYSTEM.
    ENDIF.
ZCILIB_SYSTEM-SYSTEM_GROUP =
ZCILIB_SYSTEM_V-SYSTEM_GROUP .
ZCILIB_SYSTEM-SYSTEM_ID =
ZCILIB_SYSTEM_V-SYSTEM_ID .
ZCILIB_SYSTEM-SYS_ORDER =
ZCILIB_SYSTEM_V-SYS_ORDER .
ZCILIB_SYSTEM-DESCRIPTION =
ZCILIB_SYSTEM_V-DESCRIPTION .
    IF SY-SUBRC = 0.
    UPDATE ZCILIB_SYSTEM ##WARN_OK.
    ELSE.
    INSERT ZCILIB_SYSTEM .
    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_ZCILIB_SYSTEM_V-UPD_FLAG,
STATUS_ZCILIB_SYSTEM_V-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZCILIB_SYSTEM_V.
  SELECT SINGLE * FROM ZCILIB_SYSTEM WHERE
SYSTEM_GROUP = ZCILIB_SYSTEM_V-SYSTEM_GROUP AND
SYSTEM_ID = ZCILIB_SYSTEM_V-SYSTEM_ID .
ZCILIB_SYSTEM_V-SYSTEM_GROUP =
ZCILIB_SYSTEM-SYSTEM_GROUP .
ZCILIB_SYSTEM_V-SYSTEM_ID =
ZCILIB_SYSTEM-SYSTEM_ID .
ZCILIB_SYSTEM_V-SYS_ORDER =
ZCILIB_SYSTEM-SYS_ORDER .
ZCILIB_SYSTEM_V-DESCRIPTION =
ZCILIB_SYSTEM-DESCRIPTION .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZCILIB_SYSTEM_V 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 ZCILIB_SYSTEM_V-SYSTEM_GROUP TO
ZCILIB_SYSTEM-SYSTEM_GROUP .
MOVE ZCILIB_SYSTEM_V-SYSTEM_ID TO
ZCILIB_SYSTEM-SYSTEM_ID .
  CORR_KEYTAB             =  E071K.
  CORR_KEYTAB-OBJNAME     = 'ZCILIB_SYSTEM'.
  IF NOT <vim_corr_keyx> IS ASSIGNED.
    ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
  ENDIF.
  ASSIGN ZCILIB_SYSTEM TO <TAB_KEY_X> CASTING.
  PERFORM VIM_GET_TRSPKEYLEN
    USING 'ZCILIB_SYSTEM'
    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.
*---------------------------------------------------------------------*
