‎2006 May 12 7:38 AM
Hi all,
Is there any Function Module that can be used to modify
the signature of a method in an interface from code??
I want to write a FM that imports the interface and
method name and changes the method signature..
Pls Help.
Thanks in advance.
‎2006 May 17 3:46 PM
I don't understand what you try to do.
Signature of a method cannot be changed. What you have to do is to create a new method with new signature.
‎2006 May 17 3:56 PM
Here is a sample program which will give you thep signature of the class/methods. I'm not sure how to update them, or if it is a good idea to do so.
report zrich_0003.
data: l_dref type ref to cl_abap_typedescr.
data: l_clref type ref to cl_abap_classdescr.
data: x_methods type abap_methdescr.
data: x_parameters type abap_parmdescr.
constants: query_class type seoclsname
value 'CL_GUI_ALV_GRID'.
* check if query_class exists in the current system
call method cl_abap_classdescr=>describe_by_name
exporting
p_name = query_class
receiving
p_descr_ref = l_dref
exceptions
type_not_found = 1
others = 2.
if sy-subrc <> 0.
exit.
endif.
l_clref ?= l_dref.
loop at l_clref->methods into x_methods.
write:/ x_methods-name.
loop at x_methods-parameters into x_parameters.
write:/ x_parameters-length,
x_parameters-decimals,
x_parameters-type_kind,
x_parameters-name,
x_parameters-parm_kind .
endloop.
skip 3.
endloop.
Regards,
Rich Heilman