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: 

Find/split corresponding Class and Method Name for Object Type 'METH' in table E071

subhajit
Active Participant
0 Kudos

Hello all,

I have a query that I would like to seek help for from you all as an expert.

In E071, for a method, the Object Type 'METH', Object Name is generally the Class Name concatenated with Method Name.

Example:

for CL_ABC_TESTCL_PROPOSAL_DPC_EXT and method GET_DATA, it would be CL_ABC_TESTCL_PROPOSAL_DPC_EXTGET_DATA.

My requirement is to split it down to the individual Class and Method Name at runtime after getting this object name.

Obviously there are length and Class name considerations and there are multiple scenario's as Class name would not necessarily start with CL every time and length of 30 for a Class name might not be fully occupied.

Any solution to split that Object Name in case of Object Type 'METH' into its corresponding Class and Method name ?

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos
CASE e071-object.
  WHEN 'METH'.
    class = e071-obj_name(30).
    method = e071-obj_name+30.

I don't think it will ever change and I don't understand your doubts about "there are multiple scenario's as Class name would not necessarily start with CL every time and length of 30 for a Class name might not be fully occupied."

6 REPLIES 6

Sandra_Rossi
Active Contributor
0 Kudos
CASE e071-object.
  WHEN 'METH'.
    class = e071-obj_name(30).
    method = e071-obj_name+30.

I don't think it will ever change and I don't understand your doubts about "there are multiple scenario's as Class name would not necessarily start with CL every time and length of 30 for a Class name might not be fully occupied."

Thanks Sandra for the help and clearing the doubt.

BGarcia
Active Contributor

Hi Subhajit,

There are multiple ways of achieving it. One can be to use the static method CONVERT_E071_TO_PAK_OBJECT_KEY of class CL_CLS_TRANSPORT_QUERIES (or CL_CLS_HELPER).

There, you just need to pass PGMID, OBJECT and OBJ_NAME in the IM_E071 parameter and you'll get the data you're looking for in the corresponding exporting parameter.

See if that helps a little more.

Kind regards,
Garcia

subhajit
Active Participant
0 Kudos

Thank You for the help.

raymond_giuseppi
Active Contributor
0 Kudos

Look at source of FM TR_OBJECT_JUMP_TO_TOOL for 'METH'

(The FM used for navigation from TR to Workbench Editor)

* Code for METH
      ELSEIF iv_pgmid = 'LIMU'  AND  iv_object = 'METH'.
        lv_obj_type = 'METH'.
        lv_obj_name = iv_obj_name+gc_clas(gc_meth).
        lv_encl_obj = iv_obj_name(gc_clas).
" Navigate from constant to include TTYPLENG
*** constants for OO transport objects (ABAP class etc.) **************
           gc_clas       TYPE i  VALUE '30',
           gc_meth       TYPE i  VALUE '61',

You could also use a where-used search from the constants to find relevant method/FM.

0 Kudos

Thank You for the help