Skip to Content
author's profile photo Former Member
Former Member

Data change event in ALV

Hi Gurus,

I have an editable ALV. I have used Data_check event but it is not fulfilling my requirement since i need to press enter and changing value in each cell.

Does anyone know of any event which will automatically trigger when alv data is changed and how..?

Best Regards,

Navin Fernandes.

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • Posted on Jan 17, 2012 at 03:41 PM

    Hi people,

    first of all, have to say sorry about my poor english.

    The way I´ve done to check ALV modifications in DATA_CHECK event is like this :

    1) Set ALV property with

    " l_value->if_salv_wd_table_settings~set_data_check(

    if_salv_wd_c_table_settings=>data_check_on_cell_event_val )."

    In this way, you are able to check ALV modifications pressing ENTER button.

    2) Now, you can say ... "but ... what happens if I don´t want to press ENTER button" ? Then, you can do this :

    Set ALV property with

    " l_value->if_salv_wd_table_settings~set_data_check(

    if_salv_wd_c_table_settings=>data_check )."

    And then, force the Web Dynpro passing by DATA_CHECK event using this code wherever you want (on an action or on WDDOBEFOREACTION ...):

    "DATA : l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table.

    l_ref_interfacecontroller = wd_this->wd_cpifc_alv_items( ).

    l_ref_interfacecontroller->data_check( )."

    3) But this is not all ... x_DDD ... you can say "ok, but ... what happens if I want to combine those 2 solutions ?, that is, check modificatons pressing ENTER or in a concrete action ?" Then you have to do this :

    3.1 - Initialize ALV property just to check modifications pressing ENTER :

    " l_value->if_salv_wd_table_settings~set_data_check(

    if_salv_wd_c_table_settings=>data_check_on_cell_event_val )."

    3.2 - On WDDOBEFOREACTION, change property to data_check, force passing by data_check, and then change again ALV property to the first value (the one with you enable DATA_CHECK pressing ENTER button). Example code :

    " l_ref_interfacecontroller = wd_this->wd_cpifc_alv_items( ).

    l_value = l_ref_interfacecontroller->get_model( ).

    *Se cambia para Data_CHECK

    l_value->if_salv_wd_table_settings~set_data_check(

    if_salv_wd_c_table_settings=>data_check ).

    *Se fuerza el Data Check

    l_ref_interfacecontroller->data_check( ).

    *Se vuelve a cambiar para que salte el DATA_CHECK pulsando ENTER

    l_value->if_salv_wd_table_settings~set_data_check(

    if_salv_wd_c_table_settings=>data_check_on_cell_event_val )."

    The conclusion is that you can change dinamically that property.

    Regards !!

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 03, 2010 at 09:26 AM

    Hi,

    Check this link it may help your query.[http://wiki.sdn.sap.com/wiki/display/WDABAP/HowtotriggertheeventON_CELL_ACTIONin+ALV]

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 03, 2010 at 09:34 AM

    You can make use of a timed trigger uielement which will trigger after a specific time interval.

    In here you can check may be after every10 secs if data was changed and if yes proceed with your requirement.

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 03, 2010 at 12:40 PM

    Hi Gurus,

    Neone knows abt this please let know..!

    Best Regards,

    Navin Fernandes

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 03, 2010 at 12:42 PM

    Hi Gurus,

    Neone knows abt this please let know..!

    Best Regards,

    Navin Fernandes

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 03, 2010 at 12:42 PM

    Hi Gurus,

    Neone knows abt this please let know..!

    Best Regards,

    Navin Fernandes

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 03, 2010 at 01:36 PM

    Keep in mind the that ALV is just a reusable component around the standard UI elements. The InputField doesn't have an OnChange event in WDA. Although technically possible, that would add a lot of overhead with all the extra round trips to the server. SAP is careful to balance functionality with performance in this regard. This is why the data change event in ALV is triggered by the enter key or the check button.,

    From the online help:

    You can define when the data check is carried out.

    · When the user chooses the pushbutton Check from the toolbar

    · When the user chooses ENTER or triggers a system action

    · When you execute the method DATA_CHECK (see DATA_CHECK)

    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/c8/6c80dbedfe42d1a93f8e6df1d7244a/frameset.htm

    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/96/20cca12f3c4bf59597c5cbfa00388d/frameset.htm

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.