cancel
Showing results for 
Search instead for 
Did you mean: 

ALV - problem to disable row selection (SET_ROW_SELECTABLE)

Former Member
0 Kudos

Hi,

I'm using an (non editable) ALV with a supply function to display details to each line.

I have to buttons "New" and "Modify" to insert a new line or to modify an existing row (in the details).

This works fine.

Now what I want to do is, if the user press one of the buttons "New" or "Modify", I want to disable the row selection of the ALV, so the user can't select another row during inserting or editing.

For this, I've implemented in the WDDOMODIFYVIEW of the view the coding to enable or disable the row selection


(...)
lo_value->if_salv_wd_table_settings~SET_ROW_SELECTABLE( ABAP_TRUE ).
* or
lo_value->if_salv_wd_table_settings~SET_ROW_SELECTABLE( ABAP_FALSE ).
(...)

In case of "New" this works fine. The row selection is disabled.

But not in case of "Modify".

There is a strange behaviour:

The row selection is not completely disabled. It looks like you can select rows, but if you select another row, it is automatically jumping to the first row and also the details is updated to the first row.

The different between "New" and "Modify" is, that in "New", I create a new element in the ALV.

Than it works correct. If I do the same in "Modify", I have the same correct behavior.

But of course, I don't want to insert a new row in my "modify" mode.

So maybe it has something todo with set lead selection?

Maybe I do something wrong or that is a problem in the abap release. But I can't find anything in OSS.

Thanks in advance!

Andreas

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Rahul,

thank you very much for your answer.

That's correct, the ALV is in read only mode.

I think your suggestion with the confirmation popup could solve my problem.

I will try it out.

But I'm still confused about the current behaviour.

The other steps (disable/enable the buttons) I already do.

Kind Regards,

Andreas

Former Member
0 Kudos

Hi,

I would like to propose another approach here,

I assume that ALV is in read only mode.

1. User select the row and press the "Modify" button. As soon as user press the modify button "disable" the Modify and New button.

2. Once the user is finish with the changes and press save. Enable the new and modify button.

3. Without saving if user select anyother row then raise the "Save" confirmation popup with Yes, NO and Cancel button.

4. If User press the New button then add new row and disable the "New" and "Modify button". Follow the Step 2 and 3 for this case also.

I hope this will give you some idea.

Thanks,

Rahul