cancel
Showing results for 
Search instead for 
Did you mean: 

Add Browse & Upload Objects to ALV Toolbar

Former Member
0 Kudos

I have the Browse and Upload Objects working with my WD4A ALV Report, but I can only display the Objects above or below the ALV. I would like to place the Browse and Upload Objects on the ALV toolbar; next to the Insert, Append, Check Buttons. Any suggestions? Thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

uday_gubbala2
Active Contributor
0 Kudos

Hi Stacy,

Try going through this [blog |https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/101df93f-4b5c-2910-14aa-9eb0338c2110]by Rakesh in which he has added the input fields & pushbutton within the ALV toolbar.

Regards,

Uday

Former Member
0 Kudos

Hello,

Take a look on this: [WDA - User defined functions in ALV|].

Regards.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can add custom buttons to the ALV toolbar using the if_salv_wd_function_settings~create_function method of the cl_salv_wd_config_table class.

DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
  l_ref_cmp_usage =   wd_this->wd_cpuse_alv( ).
  IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
    l_ref_cmp_usage->create_component( ).
  ENDIF.

  DATA l_salv_wd_table TYPE REF TO iwci_salv_wd_table.
  l_salv_wd_table = wd_this->wd_cpifc_alv( ).
  DATA l_table TYPE REF TO cl_salv_wd_config_table.
  l_table = l_salv_wd_table->get_model( ).
  l_table->if_salv_wd_table_settings~set_scrollable_col_count( 8 ).
  l_table->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).

  DATA function TYPE REF TO cl_salv_wd_function.
  function = l_table->if_salv_wd_function_settings~create_function( `FUN1` ).
  DATA button1 TYPE REF TO cl_salv_wd_fe_button_choice.
  CREATE OBJECT button1.
  button1->set_text( 'My Custom Button' ).
  DATA button_item1 TYPE REF TO cl_salv_wd_menu_action_item.
  CREATE OBJECT button_item1
    EXPORTING id = 'BUT1'.
  button_item1->set_text( 'Item #1' ).
  button1->add_choice(
    EXPORTING
      value = button_item1 ).
  function->set_editor( button1 ).

You can play around with other variations as there are other UI elements besides the button choice that you can place on the toolbar.