Abap Data dictionary Field description -
i'm trying query sap's data dictionary through erpconnect's abap api. code below retrieves table names , various field properties fine fails show field description. knows why?
thanks
report zselectcommand. tables: dd02l, dd03l, dd02t, dd04t. data: begin of tb_meta, tabname type dd02l-tabname, fieldname type dd03l-fieldname, datatype type dd03l-datatype, leng type dd03l-leng, decimals type dd03l-decimals, position type dd03l-position, desc type dd04t-ddtext, end of tb_meta. data utb_meta standard table of tb_meta. data: ln_meta line of utb_meta, m1 type i, m2 type i. select tb~tabname fld~fieldname fld~datatype fld~leng fld~decimals fld~position x~ddtext corresponding fields of table utb_meta dd02l tb inner join dd03l fld on tb~tabname = fld~tabname inner join dd04t x on fld~rollname = x~rollname , x~ddlanguage = 'en' contflag in ('a', 'c', 's') , applclass <> '' , tb~tabname not '/%' , tb~tabname not '%_bak' , tb~tabname = 'bsak'. *get run time field m1. loop @ utb_meta ln_meta. write:/ ln_meta-tabname && '>>' && ln_meta-fieldname && '>>' && ln_meta-datatype && '>>' && ln_meta-leng && '>>' && ln_meta-decimals && '>>' && ln_meta-position && '>>' && ln_meta-desc. endloop.
there different places text information of table field or structure field can stored. data element texts selecting dd04t
1 place texts. can define table components built-in data types instead of dictionary data types, texts stored in dd03t
(for example)
for these reasons (technical details of dd*
tables), recommend use function module ddif_fieldinfo_get
instead of rolling own dd*
select. pass parameters tabname
, langu
, , resulting internal table dfies_tab
contain information need, including texts.
Comments
Post a Comment