‎2009 Sep 29 7:20 PM
Hi all you experts!
I need to create a program that get some Table-Fields name from an input file and then compare them with SAP Data Dictionary.
For instance, program reads from the input file "MARA-MARC" then what program have to do is to get the attributes of "MARA-MARC" such as data type (C, N, D, etc.) and length (18 for MARC).
How can I get those attributes giving the TABLE-FIELD name at runtime? Is there any function module to do so? Many thanks in advance for your help.
‎2009 Sep 29 7:46 PM
‎2009 Sep 29 10:00 PM
Hi Ricardo,
search for RTTS Run Time Type Services with classes CL_ABAP_TYPEDESCR, ..STRUCTDESCR,..
Regards,
Clemens
‎2009 Sep 30 1:03 AM
Hi Ricardo,
A conventional technique getting the required fields, attributes etc. for a given table is using the transparent table DD03L.
Have success,
Heinz
‎2009 Sep 30 3:49 AM
Hi Ricardo,
<li>If you want to know single field properties, DESCRIBE statement needs to be used.
<li>If you want to know multiple fields properties, use DDIF_FIELDINFO_GET as suggested by Srinivas above
REPORT ztest_notepad.
TABLES:mara.
DATA:typ TYPE string.
DATA:len TYPE i.
DESCRIBE FIELD mara-matnr
TYPE typ
LENGTH len IN CHARACTER MODE.
WRITE:/ typ, len.
Thanks
Venkat.O
DATA:it_table_info TYPE TABLE OF dfies.
DATA:wa_table_info LIKE LINE OF it_table_info.
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = 'MARA'
TABLES
dfies_tab = it_table_info.
LOOP AT it_table_info INTO wa_table_info.
WRITE:/ wa_table_info.
ENDLOOP.