在不使用 ABAP 中 FM 的情況下,使用類及 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?
下表為您提供了更多有關使用此方法獲取資訊的思路
廣告