‎2009 Aug 12 7:55 AM
Hi Expart,
Is there is any FM which return all the variable with there ref type (Data element ,C,id,t... like that ) when we pass the program name . i only know about RS_PROGRAM_INDEX which return all variable with in pgm .
and how to used FM " RS_PROGRAM_INDEX _SOURCE " It's may also return the variable and type .
Plz Plz help to get this
Thanks
Raju
‎2009 Aug 12 12:52 PM
Hi,
I know for Internal Table use class CL_ABAP_STRUCTDESCR,
Try this...
DATA : l_descr_ref TYPE REF TO cl_abap_structdescr.
l_descr_ref ?= cl_abap_typedescr=>describe_by_data( itab ).
Now l_descr_ref->components holds the entire list of fields in itab.
Thanks & Regards,
ShreeMohan
‎2009 Aug 12 8:07 AM
Go to Standard Program LSEMOF02
and search for your FM RS_PROGRAM_INDEX_SOURCE
‎2009 Aug 12 8:59 AM
But i am only pass the program name to RS_PROGRAM_INDEX_SOURCE But it will not return anything.Please help me to get all variable with type in a program .
Thanks
Raju
‎2009 Aug 12 9:45 AM
Try the function Module 'RS_PROGRAM_INDEX'. This returns all the components of the program.
Also, check the FM 'GET_GLOBAL_SYMBOLS'.
Edited by: jaya rangwani on Aug 12, 2009 10:48 AM
‎2009 Aug 12 12:41 PM
Hi ,
By using FM GET_GLOBAL_SYMBOLS , i am only getting the System define ref type ,not getting user define type .
Please help me .
Thanks
Raju
‎2009 Aug 12 12:52 PM
Hi,
I know for Internal Table use class CL_ABAP_STRUCTDESCR,
Try this...
DATA : l_descr_ref TYPE REF TO cl_abap_structdescr.
l_descr_ref ?= cl_abap_typedescr=>describe_by_data( itab ).
Now l_descr_ref->components holds the entire list of fields in itab.
Thanks & Regards,
ShreeMohan
‎2009 Aug 13 6:40 AM
Hi
ShreeMohan Puga...
How to display the attibute of l_descr_ref which ref to class cl_abap_structdescr .that is Components table content length and data type .plz help me to get the value
Thanks
Raju
‎2009 Aug 13 4:09 PM
Hi,
TYPES:
BEGIN OF my_struct,
comp_a type i,
comp_b type f,
END OF my_struct.
DATA:
my_data TYPE my_struct,
descr_ref TYPE ref to cl_abap_structdescr.
FIELD-SYMBOLS:
<comp_wa> TYPE abap_compdescr.
START-OF-SELECTION.
descr_ref ?= cl_abap_typedescr=>describe_by_data( my_data ).
WRITE: / 'Typename :', descr_ref->absolute_name.
WRITE: / 'Kind :', descr_ref->type_kind.
WRITE: / 'Length :', descr_ref->length.
WRITE: / 'Decimals :', descr_ref->decimals.
WRITE: / 'Struct Kind :', descr_ref->struct_kind.
WRITE: / 'Components'.
WRITE: / 'Name Kind Length Decimals'.
LOOP AT descr_ref->components ASSIGNING <comp_wa>.
WRITE: / <comp_wa>-name, <comp_wa>-type_kind,
<comp_wa>-length, <comp_wa>-decimals.
ENDLOOP.Thanks ®ards,
ShreeMohan
‎2009 Aug 14 7:42 AM
Hi Expart ,
I don't want to know the basic type ,i only have to know the ref data type like
P_EBELN LIKE EKKO-EBELN.
Only i want that p_ebeln variable name and type ref is ekko-ebeln ,not CHAR with length 10 .
plz help me to do this .
‎2009 Aug 14 7:56 AM
Hi,
Why don't you copy the FM which gives you basic types and then modify it according to your requirement.
or create our own new program for this.
Regarads,
Raj Gupta
‎2009 Aug 14 8:07 AM
‎2009 Aug 14 8:52 AM
Hi,
Or is there any FM which return the ref type (data element or like ekko-ebeln ) ,if we pass the variable name .
Plz help me .
Thanks
Raju