cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with ALV toolbar

Former Member
0 Kudos

Dear Experts,

I have created a table with ALV(using SALV_WD_TABLE) in one of my WDP components. I can able to display ALV table with default "Print version and Export" Buttons.

But when i try to enable buttons ( ex: Delete row,PDF), It is not at all showing the buttons in the ALV toolbar.Can anyone help me out where i did wrong?.

P.S : I have created two additional buttons in ALV toolbar (Submit and Additional values). PFB the snap shot.

Here is the below code for that .

  DATA lr_buttonui TYPE REF TO cl_salv_wd_fe_button.
  DATA button1    TYPE REF TO cl_salv_wd_function.
  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

  lo_cmp_usage wd_this->wd_cpuse_alv( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.
  "get model
  DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
  lo_interfacecontroller wd_this->wd_cpifc_alv( ).

  DATA lv_value TYPE REF TO cl_salv_wd_config_table.
  lv_value = lo_interfacecontroller->get_model(
  ).
*----------Button creation on the alv toolbar---------*
  "Submit Button
  CREATE OBJECT lr_buttonui.
  lr_buttonui->set_text('Submit')."setting the text of the button on alv toolbar
  button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'SUBMIT')."creating the function for alv button
  button1->set_editor( lr_buttonui ).

  "Addtional Values' Selection Button
  CREATE OBJECT lr_buttonui.
  lr_buttonui->set_text('Addtional Values')."setting the text of the button on alv toolbar
  button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'ADDTIONAL_VALUES')."creating the function for alv button
  button1->set_editor( lr_buttonui ).

*--------Delete row and PDF buttons------*
  lv_value->if_salv_wd_std_functions~set_pdf_allowed( abap_true ).
  lv_value->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_true ).

Thanks

Katrice

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

You need to set the values of delete and PDF to ABAP_false.

CREATE OBJECT lr_buttonui.

   lr_buttonui->set_text('Delete Rows')."setting the text of the button on alv toolbar

   button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'DELETE_ROWS')."creating the function for alv button

   button1->set_editor( lr_buttonui ).

  

     CREATE OBJECT lr_buttonui.

   lr_buttonui->set_text('PDF')."setting the text of the button on alv toolbar

   button1 = lv_value->if_salv_wd_function_settings~create_function( id = 'PDF')."creating the function for alv button

   button1->set_editor( lr_buttonui ).

    

   lv_value->if_salv_wd_std_functions~set_pdf_allowed( abap_false ).

   lv_value->if_salv_wd_std_functions~set_edit_delete_row_allowed( abap_false ).


http://scn.sap.com/thread/1981963

Thanks

Vijay

Message was edited by: Vijay Vikram

Message was edited by: Vijay Vikram

Former Member
0 Kudos

Thanks Vijay & Abirami,

It works.Issue Resolved.

Thanks

Katrice

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Can you add the below lines at the beginning of your code and let me know.

IF_SALV_WD_TABLE_SETTINGS~SET_READ_ONLY (false)

IF_SALV_WD_STD_FUNCTIONS~SET_EDIT_INSERT_ROW_ALLOWED (true).

Best Regards,

Abirami