04-20-2006 3:14 PM
If runtime type services are used to retrieve the help_id of a dobj type (dbtab-field), the data element type is returned instead of the type dbtab-field. The describe statement provides a work-around since it works correctly, but data objects created from the data descriptor lose the information completely. Also, GET_DDIC_OBJECT seems to return the wrong information in the TABNAME and FIELDNAME fields.
Can anyone tell me if I am just missing something?
e.g.
*Use describe statement to find the help_id.
data foo like T100-ARBGB.
data descHelpID type string.
describe field foo HELP-ID descHelpID.
**********************************************************
*Now we use RTTS to find the help_id.
data elemDescr type ref to CL_ABAP_ELEMDESCR.
data rttsHelpID type string.
data myX031L type standard table of X031L.
elemDescr ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( foo ).
rttsHelpID = elemDescr->help_id.
if elemDescr->IS_DDIC_TYPE( ) = abap_True.
myX031L = elemDescr->GET_DDIC_OBJECT( ).
endif.
**********************************************************
write: / `help_id via describe: `, descHelpID.
write: / `help_id via RTTS: `, rttsHelpID.
break-point.
05-17-2006 4:42 PM
the DESCRIBE statement does not give exactly the help-id, it gives the definition of field in form TABNAME-FIELDNAME
for class CL_ABAP_ELEMDESCR, I agree to say that HELP-ID attribute is not very useful !
in fact help-ids can be found in table DD04L for elements and in DD35L for fields of a table - those are the only reliable sources for this piece of information !
05-17-2006 4:42 PM
the DESCRIBE statement does not give exactly the help-id, it gives the definition of field in form TABNAME-FIELDNAME
for class CL_ABAP_ELEMDESCR, I agree to say that HELP-ID attribute is not very useful !
in fact help-ids can be found in table DD04L for elements and in DD35L for fields of a table - those are the only reliable sources for this piece of information !