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: 

RSSH hierarchy maintain userexit IF_RSSH_HIERMAINTAIN

Former Member
0 Kudos

I need to add a button and the function in the standard class cl_rssh_maintain calling on BW.

Button should call my part of the program.

I created a program in which calling class:

call method cl_rssh_hiermaintain=>start

exporting

i_hieid = '02EL4FGSDQ8J9SBKE1H00HK7P' "my test hierarchy

i_objvers = 'A' "active version

  • i_s_hiesel =

i_mode = 'M' "modify

  • I_T_MDHIERATTR =

i_r_userexit = l_if_userexit "my interface user exit (problem) !!!

exceptions

cancelled = 1

others = 2

.

Works great, maintenance of the hierarchy is displayed without problems.

In basic program, I filled the class CL_GUI_TOOLBAR with no problem.

I added two more buttons and features. The test object is functioning well.

But I need send it to the class interface IF_RSSH_HIERMAINTAIN.

I used this code for fill interface, but is still empty:

try.

l_if_userexit->change_toolbar( exporting i_r_toolbar = go_toolbar ). "go_toolbar is filled CL_GUI_TOOLBAR

catch cx_sy_ref_is_initial into l_ref.

l_ref->get_text( receiving result = l_msg ).

endtry.

l_msg give me (Dereferencing of the NULL reference).

When I looking for another steps functionality of the program, it should be use as an interface userexit.

No information, no documentation.

But how do I send CL_GUI_TOOLBAR through the IF_RSSH_HIERMAINTAIN to CL_RSSH_HIERMAINTAIN?

Anyone dealt with something similar? Any simple code or some path to documentation?

Thanks

Edited by: Lukas Olszar on Dec 22, 2010 8:38 AM

1 REPLY 1

Former Member
0 Kudos

I found a solution. It is necessary to create a new class in se24 (eg ZIF_RSSH_HIERMAINTAIN), that is inserted into the interface IF_RSSH_HIERMAINTAIN.

Below is the code:


data: l_if type ref to if_rssh_hiermaintain.
data: lcl_if type ref to  zif_rssh_hiermaintain.

CREATE object lcl_if.

l_if = lcl_if.

  call method cl_rssh_hiermaintain=>start
     exporting
       i_hieid        = '02EL4FGSDQ8J9SBKE1H00HK7P'
       i_objvers      = 'A'
       i_mode         = 'M'
      i_r_userexit   = l_if
        exceptions
       cancelled      = 1
       others         = 2
           .

Then you can modify methods in your Z class and cl_rssh_maintain

For example add button in IF_RSSH_HIERMAINTAIN~CHANGE_TOOLBAR:


CALL METHOD i_r_toolbar->add_button
      EXPORTING
        fcode     = space
        butn_type = cntb_btype_sep
        icon      = space
        text      = space.

 call method i_r_toolbar->add_button
      exporting
        fcode       = '%RSSHUSER%SELOPT'      "Function Code
        icon        = ICON_CREATE_TEXT  "ICON name
        is_disabled = ' '        "Disabled = X
        butn_type   = cntb_btype_button"Type of button
        text        = 'Select option'   "Text on button
        quickinfo   = 'Select option'  "Quick info
        is_checked  = ' '."Button selected

Then we can modify the methods and standart class is already seen as a standard userexit.

In the interface is a method for modifying the access code, but this method isn´t used in the classes hiermaintenance .