cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro ABAP ALV - Server Roundtrip when Checkbox in ALV is checked

Former Member
0 Kudos

Hi Team,

Have a scenario where I have displayed a list in Web Dynpro ABAP ALV. The first column is a checkbox and when the user checks it or unchecks it, their is a server roundtrip which slows down the application. Is there any way to avoid the server trip?

I have the following code snippet:

obj_config->if_salv_wd_table_settings~set_read_only( value = abap_false ).

obj_alv_config->if_salv_wd_table_settings~set_enabled( abap_true ).

obj_alv_config->if_salv_wd_table_settings~set_cell_action_event_enabled( value = abap_true ).

CREATE OBJECT obj_checkbox EXPORTING checked_fieldname = obj_column-id.

CREATE OBJECT obj_cv_checkbox.

obj_cv_checkbox->set_key( 'CHECKBOX' ).

obj_cv_checkbox->set_editor( obj_checkbox ).

obj_column->add_cell_variant( r_cell_variant = obj_cv_checkbox ).

obj_column->set_cell_editor( obj_checkbox ).

obj_column->set_sel_cell_variant_fieldname( 'SELECT' ).

Please help.

Thanks

Sanjay

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi All,

I'm closing this thread and passed this to my manager. I guess we will use the table control instead OR someone from our company will raise a customer message.

Thanks all for your support

Former Member
0 Kudos

Hi Sanjay,

did you happen to find a solution / work-around for this? I am fighting with the same effect (by the way, this also happens with dropdown_by_keys in ALVs) and it is very, very annoying.

I am also facing what seems to be a variant of this problem when using the append-line functionality of the ALV: as soon as the user checks a checkbox or selects a drop-down entry, a server roundtrip is triggered and the new (empty) line just disappears

Regards,

Sebastian

Former Member
0 Kudos

Thank you Tom,

Any insights how we can disable the onToggle event. Since we are using the CL_SALV_WD_UIE_CHECKBOX element, there is no access to the onToggle event while definition itself. Should we use something else?

What should be the course of action to get this resolved if a new Note has to be created? Your guidance is much appreciated.

Best regards

Former Member
0 Kudos

Thank you Ashish and Vivek for your responses.

Ashish: The checkbox UI element is not redundant in my scenario. I'm displaying 10 records in the ALV and want to select 5 of them and process them by activating a button. My only problem is that it does a server roundtrip 5 times when I click the checkbox which is not acceptable.

Vivek: I guess you are mistaken. I deactivated the Cell Action event handler and the config, but still the server trip is happening.

Some more info for the forum:

I used the checkbox in normal web dynpro ABAP table control (Not ALV) and there is no roundtrip. Looks like this happens only in ALV. I'm pretty sure that this is very simple and standard and there should be a way out, but have tried different things and could not fix this.

Our system: ECC 6.0, SP 17, Enhancement pack 2

Any pointers would be appreciated please. I guess there should be a simple code change or an SAP note.

Best

Sanjay

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

The checkbox will fire a server event if the onToggle event is registered. I suspect that when the ALV renders the inner checkbox that it is setting the onToggle so that it can in turn offer the event via its component interface. Even if you don't register for the corresponding ALV events, it may still trigger the onToggle. I couldn't find an OSS note that would change this behaviour.

Former Member
0 Kudos

Hi Sanjay,

Since WD is a UI technology, any action the user does on the UI will trigger a server roundtrip. However you can limit the amount of processing that is done on this action handler handler method of the UI element.

If no processing is required on this checkbox and even if you do not want any round trip to occur, that possibly means that this UI element is redundant.

Best Regards,

Ashish.

Former Member
0 Kudos

Hello ,

Since you have already set the cell action enabled using the following code

obj_alv_config->if_salv_wd_table_settings~set_cell_action_event_enabled( value = abap_true ).

You can not avoid the round trip .

As of webdynpro have provided cell_action option for individual .

May be we can expect this functionality in future .

Regards

Vivek