Skip to Content
-1

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

Dec 07, 2016 at 12:38 PM

146

avatar image

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Raymond Giuseppi
Dec 07, 2016 at 01:01 PM
3

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

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Thanks for your reply.

In Cdpos Table EKET and Field is Key field is recorded.
I am checking for Data element for field Key But no data exists.

ncheck.png (89.6 kB)
0

The KEY value should always be initial, it's not a true field, so no description exists.

You could use the KEY_FIELD values of CDPOS which is a concatenation of the primary key fields of the database table You have to add individual columns for those fields in the final internal table and map the KEY_FIELD value to those columns.

NB: table TCDOB contains the list of every table managed for an object, so you could use it (and a DDIF FM) to build a dynamic internal table from CDPOS definition, the key list and some description/text fields.

Regards,
Raymond

1

Ok, Sir Noted.

0
Nicolas VANDER AUWERA Dec 07, 2016 at 01:05 PM
2

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Ok, I will check it.

0
Christopher Solomon
Dec 07, 2016 at 12:55 PM
1

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.

Share
10 |10000 characters needed characters left characters exceeded