通过表名查字段详细 (DDIF_FIELDINFO_GET)

*通过表名查字段详细 (DDIF_FIELDINFO_GET) .

tables: dfies, x030l.

data: begin of inttab occurs 100.
        include structure dfies.
data: end of inttab.

parameters: tablenm type ddobjname default 'MSEG',
fieldnm type dfies-fieldname .

call function 'DDIF_FIELDINFO_GET'
  exporting
    tabname        = tablenm
    fieldname      = fieldnm
    langu          = sy-langu
  tables
    dfies_tab      = inttab
  exceptions
    not_found      = 1
    internal_error = 2
    others         3.

if sy-subrc <> 0.
  write:/ 'Field name not found'.
endif.

loop at inttab.
  write:/ inttab-tabname, inttab-fieldname, inttab-fieldtext.
endloop.

你可能感兴趣的:(SAP—Abap)