Index Kontrol

Tabloda indeks kontrolü, var ise Oracle indeksi kontrolü.

  perform f_index_check   using      `VBRP` "Tablo Adı
                                     `VGB`  "İndeks Adı
                     changing        lv_index_var .

form f_index_check   using      prm_table_name type ddobjname
                                prm_index_name type INDEXID
                     changing   chn_exist type c.

  datalv_state  type  ddobjstate value `M`.
  data lt_dd12v type standard table of dd12v.
  data ls_dd12v  type dd12v.

  clear chn_exist.
  call function `DDIF_TABL_GET`
    exporting
      name              prm_table_name
     state               lv_state
*    LANGU               = ` `
*  IMPORTING
*    GOTSTATE            =
*    DD02V_WA            =
*    DD09L_WA            =
   tables
*    DD03P_TAB           =
*    DD05M_TAB           =
*    DD08V_TAB           =
     dd12v_tab           lt_dd12v
*    DD17V_TAB           =
*    DD35V_TAB           =
*    DD36M_TAB           =
*  EXCEPTIONS
*    ILLEGAL_INPUT       = 1
*    OTHERS              = 2
            .
  if sy-subrc <> 0.
* Implement suitable error handling here
  endif.



  read table lt_dd12v into ls_dd12v  with  key INDEXNAME prm_index_name.
  if sy-subrc eq 0. "Index mevcut
      if ls_dd12v-dbindex is not INITIAL.
        chn_exist `X`."Oracle İndeksi de mevcut!
      endif.
  endif.
endform.                    "f_index_check