cancel
Showing results for 
Search instead for 
Did you mean: 

Help on Button Choice of alv tool bar

Madhu2004
Active Contributor
0 Kudos

Hai , i created a button choice on the ALV tool bar .

and now problem is how to capture the choices i.e how to check which choice is selected on the button?

i defined an event handler methos with refernce to the event ON_FUNCTION of the alv.

Please help me , its urgent,

Madhuh

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Madhuh,

could you help me? I have a similar issue. It seems that you are one step ahead cause for me it is not possible to see the button choice in ALV.

How did you set the button choice object to the ALV toolbar?

I tried following:


  DATA: lr_interfacecontroller TYPE REF TO iwci_salv_wd_table,
        lr_alv_conf            TYPE REF TO cl_salv_wd_config_table,
        lr_func_settings       TYPE REF TO if_salv_wd_function_settings,
        lr_function            TYPE REF TO cl_salv_wd_function,
        lr_menu_action         TYPE REF TO cl_salv_wd_menu_action_item,
        lr_button_choice       TYPE REF TO cl_salv_wd_fe_button_choice,
....

* create button choice
  CREATE OBJECT lr_button_choice.
* function ID (need for field propeties?!)
  lr_function = lr_func_settings->create_function( 'BTN_CREATE_ETA' ).
* set text
  lv_text = cl_wd_utilities=>get_otr_text_by_alias( '/SCMTMS/UI_COMMON/CREATE_ETA' ).
  lr_button_choice->set_text( lv_text ).
* create menu objects for the categories depending on allowed categories:
  LOOP AT lt_value_set INTO ls_value_set.
    CONCATENATE 'CREATE_ETA' ls_value_set-key INTO lv_id.
    lv_text = ls_value_set-value.
*   create menu action now
    CREATE OBJECT lr_menu_action
      EXPORTING
        id = lv_id.
    lr_menu_action->set_text( lv_text ).
*   Add action menu to button choice
    lr_button_choice->add_choice( lr_menu_action ).
  ENDLOOP.

  lr_function->set_editor( lr_button_choice ).

But that dumps in my case inside wd salv coding because of last statement. Is that the right way to do?

Do you have a context mapping to the interface controller of ALV for that function? If yes how does it look like.

Thanks in advance for your help!

Regards Rico

Former Member
0 Kudos

Hi,

the coding works fine. The dump was caused by another issue. There is no add. context binding to ALV needed.

Regards Rico

Former Member
0 Kudos

hi madhu,

in the on_function method of the alv u have to search for the function you would have created for button choice.Write the foloowing code for it:

CASE r_param->id.

when 'BUTTON_CHOICE'.

your code

ENDCASE.

'BUTTON_CHOICE' is the function name you would have created for the button choice.

Hope this helps.

Please avoid awards if answer is useful

former_member182372
Active Contributor
0 Kudos

Madhuh, post the code for ALV configuration.