cancel
Showing results for 
Search instead for 
Did you mean: 

Hide button in webdynpro standard

Former Member
0 Kudos

Hi friends,

    In the past some folks guided me to hide and change standard buttons; now I'm stuck with a toolbar which does not respond to my code when I want to hide it

  Im enhancing webdybpro HRECM00_PLANNING_UI method WDDOMODIFYVIEW of view v_planning:

  lr_lbl ?= view->get_element( ID = 'ADJUST_COMPENSATION' ).

  IF  lr_lbl IS NOT INITIAL.

    lr_lbl->set_visible( 01 ).

  endif.

  lr_lbl ?= view->get_element( ID = 'SALV_WD_PDF' ).

  IF  lr_lbl IS NOT INITIAL.

    lr_lbl->set_visible( 01 ).

  endif.

but when debug it it seems that the method get_element is not getting anything. This is the detail of the webdynpro and toolbar buttons I want to hide (not all of them):

Any help will be greatly appreciated!!

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Those buttons are not part of the view but ALV's. So you have to hide the ALV toolbar buttons using if_salv_wd_std_functions.

write the below code:


data lr_interfacecontroller type ref to iwci_salv_wd_table .

data lr_value type ref to cl_salv_wd_config_table.

lr_interfacecontroller = wd_this->wd_cpifc_alv_comp( ).

lr_value = lr_interfacecontroller->get_model( ).

lr_value->if_salv_wd_std_functions~set_pdf_allowed( value = abap_false ).

You can refer this thread:

Regards,

Kiran

Former Member
0 Kudos

Thank you!

I place that code in the WDDMODIFYVIEW of view V_PLANNING, but I get the error that the method WD_CPIFC_ALV_COMP is unknown, or protected or private.

Am I placing this in the wrong place?

Thank you once again

former_member184578
Active Contributor
0 Kudos

Hi,

You are placing it correct, ALV_COMP is the name of the component usage. Expand the component usages and see the name of Component usage for the ALV component whether it is ALV or some other.. then you just add the WD_CPIFC_<CompUsage_Name> ex: WD_CPIFC_ALV( ).

Regards,

Kiran

Former Member
0 Kudos

Thank you Kiran! I've been trying with no luck

What do you mean by expand? I tried thinks like wd_this->vcu_oadp_planning_data but got always errors

former_member184578
Active Contributor
0 Kudos

Hi,

What I meant was, under the Web Dynpro Component, Expand the component usages and find the component usage:

Here, the name of ALV component usage is 'ALV', in this case, your code will be


lr_interfacecontroller = wd_this->wd_cpifc_ALV( ).

Regards,

Kiran

Former Member
0 Kudos

I don't have anything like that, may it be that this alv is inherited or something like that?

former_member184578
Active Contributor
0 Kudos

Hi,

Looks like, you are checking in the wrong component! From the screen shot which you provided in the original post, I can see the component is OBJECTDATAPROVIDER and the View is DATAVIEWVIEW! And there exists a component usage with name 'ALV' for ALVcomponent.

Regards,

Kiran

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Federico,

If you want to hide standard ALV toolbar buttons,following is the code.

*---->ALV Config table reference
    lv_value = lo_interfacecontroller->get_model( ).

*----->ALV print,export buttons disabled
    lv_value->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).
    lv_value->if_salv_wd_std_functions~set_export_allowed( abap_false ).

*----->Alv personalization viewlist disabled

lv_value->if_salv_wd_std_functions~set_view_list_allowed( abap_false ).

Thanks

KH