08-25-2013 7:23 AM
Hi,
I would like to develop a program which given a table name, returns all its fields and their types.
If a certain type is a structure, I need to get its elements, as well, and their types.
I'm aware of the function ddif_fieldinfo_get which returns the data types of all fields in a certain table, but it doesn't handle complex data types of structures like I need...
Does someone have any idea or reference for me?
Thanks in advance
08-26-2013 1:45 AM
Hi,
May be this would help
DATA: gcl_abap_structdescr TYPE REF TO cl_abap_structdescr,
gt_ddicinfo TYPE ddfields,
wa_dfies TYPE dfies.
FIELD-SYMBOLS: <ddic_info> TYPE LINE OF ddfields.
gcl_abap_structdescr ?= cl_abap_structdescr=>describe_by_name( 'BKPF' ).
gt_ddicinfo = gcl_abap_structdescr->get_ddic_field_list( ).
LOOP AT gt_ddicinfo INTO wa_dfies.
WRITE: wa_dfies-tabname, wa_dfies-fieldname, wa_dfies-position.
ENDLOOP..
Cheers,
Arindam
08-26-2013 1:45 AM
Hi,
May be this would help
DATA: gcl_abap_structdescr TYPE REF TO cl_abap_structdescr,
gt_ddicinfo TYPE ddfields,
wa_dfies TYPE dfies.
FIELD-SYMBOLS: <ddic_info> TYPE LINE OF ddfields.
gcl_abap_structdescr ?= cl_abap_structdescr=>describe_by_name( 'BKPF' ).
gt_ddicinfo = gcl_abap_structdescr->get_ddic_field_list( ).
LOOP AT gt_ddicinfo INTO wa_dfies.
WRITE: wa_dfies-tabname, wa_dfies-fieldname, wa_dfies-position.
ENDLOOP..
Cheers,
Arindam
08-27-2013 6:20 AM
Hi Arindam,
Thank you, but I've found an answer and wrote it down as a document
08-26-2013 6:48 AM
08-27-2013 6:21 AM
Hello Kiran,
That's my own document I wrote after doing some research
You're more than welcome to learn from it and show your appericiation (reply, like or rate)
09-22-2016 4:42 PM
Daniel,
Not sure if you are still following this.
Did you upload your document someplace that you can share it?
I don't see it in your post. Also the link Kiran gave below, says access restricted. Thanks jay