cancel
Showing results for 
Search instead for 
Did you mean: 

Data change event in ALV

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

rub_alfonso
Explorer
0 Kudos

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 !!

Answers (6)

Answers (6)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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

Former Member
0 Kudos

Hi Gurus,

Neone knows abt this please let know..!

Best Regards,

Navin Fernandes

Former Member
0 Kudos

Hi Gurus,

Neone knows abt this please let know..!

Best Regards,

Navin Fernandes

Former Member
0 Kudos

Hi Gurus,

Neone knows abt this please let know..!

Best Regards,

Navin Fernandes

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hi,

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