The official API to check whether a dictionary data type exists is the function module DDIF_NAMETAB_GET
. It features a rather comprehensive documentation. Be aware that it will work for various kinds of tables and data structures and make sure you check the DDOBJTYPE
.
If for whatever reason (maybe this is a homework assignment..?) you have to restrict yourself to method calls, you can use the RTTI classes (descendants of CL_ABAP_TYPEDESCR
) - but be aware that this is a bit more work because you have to ensure that what you got is actually a table. The RTTI classes will return descriptors of any data type, even the internal ABAP runtime types, while DDIF_NAMETAB_GET
is restricted to dictionary types.