How to get field description (field label) of data element by ABAP

REPORT  ztest_get_dataelement_desc.
DATA: wa_dd04t TYPE dd04t.

PARAMETERS: p_name TYPE rollname DEFAULT 'MATNR' OBLIGATORY.

SELECT SINGLE * FROM  dd04t
  INTO wa_dd04t
  WHERE rollname = p_name AND
        ddlanguage = sy-langu AND
        as4local   = 'A'.

IF sy-subrc = 0.
  WRITE: /1 wa_dd04t-rollname, 31 wa_dd04t-ddtext.
ENDIF.

Leave a Reply