Skip to Content
-1

I know the field But How could i get the data elemnt

Need small clarification.
I am generating one report, In this what are the changes people has done in a particular date,i need to show.


I would like to show the field description(data element short description) in the report, For this i am using the table table as DD04T ,So, what ever the field names i am having i am going to check it in the table DD04T,
But Some fields names does not have the same domain names like

Menge is having BSTMG is the domain, if i check the MENGE IN DD04T, I am not getting any data, I need to check BSTMG.

But where could i get Menge is having the Data element as BSTMG.

Any suggestions Please Update me.

cdpos1.png (90.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 07, 2016 at 01:01 PM

    Are you re-writing/cloning report RSSCD200?

    Else for description of fields, check for data-element (DD03L-ROLLNAME) and not domain /or/ from table name get list of fields descriptions with a FM like DDIF_FIELDINFO_GET.

    Regards,
    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 07, 2016 at 01:05 PM

    Hello,

    In your screenshot, you have two information: the table name and the field name in the table. To find the corresponding data element, you could use the following code :

    data: lo_tabledescr type ref to cl_abap_tabledescr,
          lo_structdescr type ref to cl_abap_structdescr.
    
    lo_tabledescr ?= cl_abap_typedescr=>describe_by_name(<table name>).
    lo_structdescr ?= lo_tabledescr->get_table_line_type( ).
    data(lt_components) = lo_structdescr->get_components( ).
    data(lo_dtel) = lt_components[ name = <field_name> ]-type.
    data(lv_dtel_name) = lo_dtel->absolute_name.

    The variable lv_dtel_name contains the data element name of the field. Then you could use this name to find the corresponding description in DD04T.

    Be aware that I do not catch any exception in the code...

    Best regards, Nicolas

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 07, 2016 at 12:55 PM

    You can use function DDIC_DATA_DESCRIPTION_SCAN for your table and get all the information you need. And for reference, any functions or class with "DDIC" or "DDIF" in it will give you data dictionary/metadata info that is useful.

    Add comment
    10|10000 characters needed characters exceeded