Skip to Content
avatar image
Former Member

ALV Events

Hi,

i want to do something when a row selected. i searched how to do this, all must create an event handler method as on_click but i couldn't create it because the fields of event handler on methods is unwritable.

How can i create an on_click event handler?

Can somebody help me pls?

Thanks.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 27, 2008 at 08:37 PM

    Thank you very much,

    no problem when debuged but when i test the application, an ALV error is taking

    in st22 ;

    UNCAUGHT_EXCEPTION

    CX_WDR_RT_EXCEPTION

    i debuged the program , error is taking in follow

    DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      <here>     l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
    
      DATA: l_value TYPE REF TO cl_salv_wd_config_table.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 27, 2008 at 03:54 PM

    Go to the methods tab of ur view

    1- create a method lets say 'on_enter'

    2- select the method type as 'event handler'

    3- In event column take the f4 help and select on_click event.

    4 - Write the code in this method 'On_enter' as per ur requirements.

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Define like this...

      * Create component usage for alv component
        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.
      
      * Get config model
        DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
        l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
        DATA: l_value TYPE REF TO cl_salv_wd_config_table.
        l_value = l_ref_interfacecontroller->get_model( ).
      
      
      * set cell editor for input fields (~make colum PRICE editable)
        DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
        lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
        lr_column_settings ?= l_value.
        DATA: lr_column TYPE REF TO cl_salv_wd_column.

  • avatar image
    Former Member
    Oct 27, 2008 at 04:26 PM

    Thank you very much,

    i'm doing now, when i have a problem, i will write 😊

    Add comment
    10|10000 characters needed characters exceeded