例如需要用代码获取以下structure的extension field list:
可以使用下列代码片段获得extension field list:
DATA lv_name TYPE strukname VALUE 'CRMT_PRIL_QUERY_ADVSEARCH_PROD'.
DATA l_dd03p_tab TYPE TABLE OF dd03p .
DATA l_dd03p_tab2 TYPE TABLE OF dd03p .
DATA ls_dd03p TYPE dd03p .
DATA ls_dd03p2 TYPE dd03p .
CALL FUNCTION 'DDIF_TABL_GET'
EXPORTING
name = lv_name
state = 'A'
TABLES
dd03p_tab = l_dd03p_tab
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
CHECK sy-subrc = 0.
LOOP AT l_dd03p_tab INTO ls_dd03p WHERE fieldname CP '.INCL*AP'.
CALL FUNCTION 'DDIF_TABL_GET'
EXPORTING
name = ls_dd03p-precfield
state = 'A'
TABLES
dd03p_tab = l_dd03p_tab2
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
CHECK sy-subrc = 0.
LOOP AT l_dd03p_tab2 INTO ls_dd03p2 WHERE rollname IS NOT INITIAL .
WRITE:/ ls_dd03p2-fieldname COLOR COL_NEGATIVE.
ENDLOOP.
ENDLOOP.