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

determine method name by include name (program name)

Fabian_Kegel
Product and Topic Expert
Product and Topic Expert
0 Likes
2,166

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
Read only

LucianoBentiveg
Active Contributor
0 Likes
1,270

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
Read only

LucianoBentiveg
Active Contributor
0 Likes
1,271

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.

Read only

Former Member
0 Likes
1,270

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.

Read only

Fabian_Kegel
Product and Topic Expert
Product and Topic Expert
1,270

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

Read only

Former Member
0 Likes
1,270

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