cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Button Disable in the ALV Table

Former Member
0 Kudos

Hi All ,

I have One Requirement, i have Two table one is company and another is Branches , Braches will display as the company , In the Branch view I have there button one ADD , EDIT , DELETE ,

i can add the new branches corresponding to the company ,also we can edit and delete the branches corresponding to the company .

BUT the problem is if there is no branch exit only ADD Button display in the Branches View and Rest of the Two Button EDIT and DELETE should be Disable Mode; please help how to do this, Any method for Disable for ALV Button.

Regards ,

Nihar Swain .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi nihar

to disable a alv customized button use this code.

DATA: lo_button TYPE REF TO cl_salv_wd_fe_button,

lo_btn_function TYPE REF TO cl_salv_wd_function,

l_text1 type string.

l_text1 = 'button_text'.

CREATE OBJECT lo_button.

  • Set the button text 'button_text' .

CALL METHOD lo_button->set_text

EXPORTING

value = l_text1.

    • Create the function for binding with the toolbar.

lo_btn_function = lo_config_model_value->if_salv_wd_function_settings~CREATE_FUNCTION( 'func1' ).

lo_button->set_enabled( ABAP_FALSE ). -> to disable button

  • Assign the button to the toolbar function.

lo_btn_function->set_editor( lo_button ).

regards

chythanya

Former Member
0 Kudos

Thanks Chytanya .

Answers (0)