Application Development 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: 

determine method name by include name (program name)

fabiankegel
Employee
Employee
0 Kudos

Hi,

I am looking for a function that is able to determine the name of a method by its include name.

Here is an example for the class CL_GUI_ALV_GRID

include name: CL_GUI_ALV_GRID===============CM002

method name: ACTIVATE_REPREP_INTERFACE

Thank you for your help,

Fabian

1 ACCEPTED SOLUTION

LucianoBentiveg
Active Contributor
0 Kudos

There isn´t such FM, But you can access table TMDIR with class name and method index, you can obtain this values spliting the report name by '='.

Reward points if helps.

Regards.

4 REPLIES 4

LucianoBentiveg
Active Contributor
0 Kudos

There isn´t such FM, But you can access table TMDIR with class name and method index, you can obtain this values spliting the report name by '='.

Reward points if helps.

Regards.

Former Member
0 Kudos

Hi,

I dont think that there is any such function module...

Also, more than one method can have same include.

But consider this scenario..

when you try to delete an include, i guess it shows warning that some report or method uses it..

Debugging that piece of code can give you your answer.

Regards,

Tanveer.

Mark helpful answers.

fabiankegel
Employee
Employee

Hi,

I found the class cl_oo_include_naming. You can use this class to determine the method name for an include. Here is a part of my coding:

lr_include_naming ?= cl_oo_include_naming=>get_instance_by_include( progname = lv_incl_name ).

lv_method_name = lr_include_naming->get_mtdname_by_include( progname = lv_incl_name ).

Best regards,

Fabian

Former Member
0 Kudos

U can also try this static method:

data: l_source TYPE trdir-name value 'CL_WB_SOURCE_REQ_DISPATCHER===CM008',

l_obj_name TYPE rseuap-obj_name,

l_obj_type TYPE rseuap-obj_type.

CALL METHOD cl_wb_source_req_dispatcher=>get_ta_object_from_sourcename

EXPORTING

p_source_name = l_source

IMPORTING

p_object_type = l_obj_type

p_object_name = l_obj_name

EXCEPTIONS

no_objecttype_found = 1

OTHERS = 2.

Walter