cancel
Showing results for 
Search instead for 
Did you mean: 

Event associated to dropdown with select options

Former Member
0 Kudos

Hello,


   I have the following code in the method WDDOINIT:


* add a new field to the selection

  wd_this->m_handler->add_selection_field(

       i_id                  = 'TIPO'

       i_description     = 'Tipo'

       it_result            = range_table

       i_as_dropdown  = abap_true

       it_value_set      = lt_value_set

  ).

I need to retrieve the event associated with the dropdown to perform different actions depending on the selected value.

An easy way to solve it would use the dropdown tool layout but this involves an additional task.


Does anyone know how to do? It's possible to do what I indicate?

Thanks in advance!!!

Xavi

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Create an Action ( in Actions tab) and pass that action name to parameter I_HELP_REQUEST_HANDLER of method add_selection_field( )

Hope this helps u,

Regards,

Kiran

Former Member
0 Kudos

Hello Kiran,

   How I have to pass the name to parameter? Since this parameter is of type object.

Thanks.

Xavi.

ramakrishnappa
Active Contributor
0 Kudos

Hi,

You can pass the action as object reference as below


     data lr_action type ref to if_wd_action.

    

     lr_action = wd_this->wd_get_api( )->get_action( name = 'ON_SELECT' ).

    

     now pass lr_action to the method ADD_SELECTION_FIELD

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Hello Rama,

   I create the action and pass the parameter as you indicated me, but still not working. I've put a break point in the action and does not stop.

  data lr_action type ref to if_wd_action.

  lr_action = wd_this->wd_get_api( )->get_action( name = 'SELECCION_TIPO' ).

* add a new field to the selection

  wd_this->m_handler->add_selection_field(

  i_id              = 'TIPO'

  i_description     = 'Tipo'

  i_help_request_handler = lr_action

  it_result         = range_table

  i_as_dropdown     = abap_true

  it_value_set      = lt_value_set

  ).

What more can I do?

Thanks!!!

Xavi.

ramakrishnappa
Active Contributor
0 Kudos

Hi Xavi,

Sorry, this event will trigger for when we press F4 ( for search help call ) on select option.

I don't think we have a standard method to register to an event on select options.

But we can use global options CHECK button for validating the data.

Hope this helps you.

Regards,

Rama

former_member184578
Active Contributor
0 Kudos

Hi,

Yep. It's for F4 help handler and I expected that it will trigger for value set as well( too bad that there is no provision ).

As suggested, you have press Enter/ Check to handle the drop down on select.

Regards,

Kiran

Former Member
0 Kudos

Hello,

thank you both for your help!!!


Xavi