Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Interface method Signature...

Former Member
0 Likes
1,155

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.

2 REPLIES 2
Read only

franois_henrotte
Active Contributor
0 Likes
605

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.

Read only

0 Likes
605

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