2009 Nov 02 1:05 PM
Hi
is there any way how to find out name of structure upon which internal
table was created?
i got internal table passed to function module by any table
type. There can be different types of table passed in. Inside of
module a need to find out the structure of table.
I've found a tricky way how to find this information using following
command 'DESCRIBE FIELD dobj INTO td.', but its probably not a correct
way because using this command is not recommended in application
programs.
Is there any function module, or something i can use for getting this information?
Thanks
2009 Nov 02 1:15 PM
Look at the RTTI classes and their methods, especially CL_ABAP_STRUCTDESCR and CL_ABAP_TABLEDESCR.
http://help.sap.com/abapdocu_70/en/ABENRTTI.htm
Thomas
2009 Nov 02 1:11 PM
se37 --> type function module name --> display
in data declartion part the type would be there .
if the FM is calling from any report then in the main report , there would be definition of internal table . search it .
thanks
2009 Nov 02 1:14 PM
Hello,
You can make use of the SAP RTTS for this purpose.
Search in SDN for details.
BR,
Suhas
2009 Nov 02 1:15 PM
Look at the RTTI classes and their methods, especially CL_ABAP_STRUCTDESCR and CL_ABAP_TABLEDESCR.
http://help.sap.com/abapdocu_70/en/ABENRTTI.htm
Thomas
2009 Nov 02 1:48 PM
Thanks very much
This has solved my problem:
DATA descr_ref TYPE ref to cl_abap_typedescr.
DATA tabname TYPE string.
descr_ref = cl_abap_typedescr=>describe_by_data( itab ).
tabname = descr_ref->absolute_name.