在 ABAP 中不使用 FM,使用 Class 及其在 SE11 中的方法来检查表是否存在


不使用函数模块执行此操作时,可以使用以下类:“cl_rebf_ddic_tabl”。请注意,类方法与函数模块几乎类似。它们被定义为用于执行特定功能的代码块。

示例

尝试使用以下代码: 

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

   . 

如果表在事务 SE11 中存在,将返回“X”。

CALL METHOD CL_REBF_DDIC_TABL=>methodname EXPORTING/IMPORTING
GET_TEXTTAB - Supplies the Corresponding Text Table
GET_COMPLETE - Supplies All Technical Information
GET_DETAIL_X - Supplies Extended Header Data
GET_FIELD_LIST - Supplies the Field List
GET_FIELD_LIST_X - Supplies the Field List with Additional Data
GET_RUSER - Supplies Author/Date/Time of Last Change
COMPARE_WITH_DATA - Detail Comparison
PUT_COMPLETE - Creates a New Table/Structure
SPLIT_FIELDNAMES - Generates Field List According to List
EXISTS - Table/Structure Available?
EXISTS_FIELD - Field Available in Table/Structure?
EXISTS_INDEX_FOR_FIELDS - Field Available in Table Index?

下表为您更深入了解此方法来获取信息提供了思路



更新于:2019 年 12 月 10 日

488 次浏览

开启您的 职业生涯

通过完成课程获得认证

立即开始
广告
© . All rights reserved.