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: 

Navigate to technical objects programatically

arshad_ansary2
Active Participant
0 Kudos

Hi Folks,

We are developing an internal tool  for developers in our team. The tool will produce output of a technical objects list. It can be program,Function Module,Class methods, DB table,BADI,Exits(pre/post/OVR), Implicit enhancements etc

Is there any way to porgramatically handle the navigation when the user clicks on the object name other than doing recording for and filling BDC tab for each object type.

Regards

Arshad

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

For many workbench objects you can use FM TR_OBJECT_JUMP_TO_TOOL or WB_NEW_WORKBENCH_START .

Regards,

Raymond

7 REPLIES 7

shah_viraj
Active Participant
0 Kudos

Sir,

Can you please elaborate the requirement. What I understood is you want to call the transactions regarding different objects (SE37,SE38,SMOD,CMOD etc..) from a single Z programme. Please explain in little more detail.

Thanks,

Viraj.

0 Kudos

Hi Viraj,

I should be able to navigate to code or DDIC elements  just like in SAP tools like SCI,SE30 etc depending on the object (it can be Class methods,Function modules, or table or table type )

Regards

Arshad

0 Kudos

Ok. So why don't you use CALL TRANSACTION ?

Please explain how this tool will be useful?

raymond_giuseppi
Active Contributor
0 Kudos

For many workbench objects you can use FM TR_OBJECT_JUMP_TO_TOOL or WB_NEW_WORKBENCH_START .

Regards,

Raymond

0 Kudos

Hi Raymond,

Thanks a lot for your reply. As you said this FM TR_OBJECT_JUMP_TO_TOOL works in most of the cases.

In my case, It should also be possible to navigate to Pre/Post/Overwrite exits of method directly.For that I took the ENHINCLUDE field value from table ENHINCINX and passed to FM R3TR PROG parameter it is going to the Enhancement implementation and not to the corresponding Post exit/Pre exit /Overwrite exit method.Is there any way I can navigate to this exit methods directly

One more issue is with the navigation to BADI as well as Enhnacement options as TADIR does not have PGMID OBJECT corresponding to that.

Regards

Arshad

0 Kudos

Don't limit yourself to values in TADIR, there are also subobjects (not R3TR but LIMU) for some sub-objects,

Execute this snippet to get a list

DATA: gt_types TYPE TABLE OF ko100,
       g_disvariant TYPE disvariant.
CALL FUNCTION 'TRINT_OBJECT_TABLE'
      EXPORTING
           iv_complete  = 'X'
      TABLES
           tt_types_out = gt_types.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
      EXPORTING
           i_structure_name = 'KO100'
           i_save           = 'A'
           is_variant       = g_disvariant
      TABLES
           t_outtab         = gt_types
      EXCEPTIONS
           OTHERS           = 0.

Else, you could try some navigarion in SE80 (with debug or under SAT/SE30 tool) to identify standard tools for those objects. Then you will have to play with classes and FM of the workbench manager from FM WB_NEW_WORKBENCH_START  to class cl_enh_tool_hook_impl or to cl_enh_tool_hook_def, (But in this case you will go further than I went)

Regards,

Raymond

Juwin
Active Contributor
0 Kudos

You can use cl_wb_worklist along with RS_TOOL_ACCESS for this purpose.

This example code, shows how to do this for a program. This can be extended for other objects also.

report navigation_example.

data:lcl_wrklist type ref to cl_wb_worklist,

      i_wrklist  type wbworklist,

      l_wrkitem  type wbworkitem.

l_wrkitem-id-type = 'P'.

l_wrkitem-id-name = sy-cprog. "Program name to navigate to

l_wrkitem-state-line = 2"Navigation position of the program

append l_wrkitem to i_wrklist.

lcl_wrklist = cl_wb_worklist=>get_worklist( sy-uname ).

call method lcl_wrklist->clear.

call method lcl_wrklist->add_objects

  exporting

    p_objects = i_wrklist.

call method lcl_wrklist->store.

call function 'RS_TOOL_ACCESS'

  exporting

    operation    = 'SHOW'

    object_name  = sy-cprog

    object_type  = 'PROG'

    with_worklist = 'X'.

call method lcl_wrklist->clear.