Search code examples
abapsap-data-dictionary

Class/Method to check if table exists in SE11 or not?


I want to check if a table exists in SE11 or not through ABAP.

Their are some FM's available like "C_TABLE_EXISTENCE".... But i can't use FM's. I want to use or have to use Class and its methods in my software.

Please suggest me, how can i check existence of a table without using any FM. Preferably Class and Method.


Solution

  • You can use the class cl_rebf_ddic_tabl

    It's exists will return you X if the object (Table, Structure or View) exists i SE11

    EG:

    CALL METHOD cl_rebf_ddic_tabl=>exists
      EXPORTING
        id_name     = [table name]
        id_tabclass = 'TRANSP'  " For table
    *    if_noview   = ABAP_FALSE
      receiving
        rf_exists   = yes
        .