cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to select a row in ALV?

Former Member
0 Kudos

Hi Experts,

I am enhancing a standard e-recruiting WD ABAP component.

It produces a search result as ALV.

I am not able to select any row in ALV by clicking it like we normally do in ALV.

I wrote below code to allow selection:

 
lo_value->if_wd_salv_table_settings~set_selection_mode( cl_wd_table=>e_selection_mode-single).

.

Even after this I am not able to select any row by clicking it.

Need help to solve this.

Regards,

Sumit Oberoi

Accepted Solutions (0)

Answers (2)

Answers (2)

gopi_narendra
Active Contributor
0 Kudos

Hi Sumit,

You may try to do this

lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
  lo_alv = lo_interfacecontroller->get_model( ).

*** No row is selectable
  lo_alv->if_salv_wd_table_settings~set_row_selectable(
          value  = abap_true ).

Regards

Gopi

Former Member
0 Kudos

Hi Gopi,

I have ried everything.

This all is fine.

I have solved it.

The reason is :

The data is getting binded to the ALV in WDDOMODIFY everytime.

This was not showing the row as selected.

I put the binding code in below if condition.

st_time = 'x'.
Endif. 

Everything is fine.

Thanks for help everyone!

Regards,

Sumit Oberoi

to confirm this I tried doing the same in

Former Member
0 Kudos

Hi ,

Please check the cardintality of the node property for selection 1:1 or 1:n or 0:N to which the ALV DATA is bound.

Check wether the lead selection is set to true.

This is for the multiple selection of rows without the leadselect being set.

CALL METHOD lv_model->if_salv_wd_table_settings~set_selection_mode
      EXPORTING
        value = cl_wd_table=>e_selection_mode-multi_no_lead.

for single selection check out with this if requried

cl_wd_table=>e_selection_mode-single_no_lead.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

Thanks for your answer.

I have checked.

The cardinality is 0..n and the selection is 0..1.

The Lead selection is not set to true.

Please guide.

Regards,

Sumit Oberoi

Former Member
0 Kudos

Hi All,

I think lead selection in happening but the row does not appears to be selected in the ALV.

I checked the lead selection status in the ON_LEAD_SELECT event and it is same as the r_param->index.

I am not able to figure out the problem.

Any help is welcomed.

Regards,

Sumit Oberoi

Former Member
0 Kudos

Hi Sumit,

Try to do the same with the E_SELECTION_MODE as Auto.

Single means the lead selection is set and can be viewed as a highlighted one.

Single NoLead means the lead selection is set but cannot be seen as higlighted one when run the application.

If that doesnt work fine

Please check out the selection behaviour E_SELECTION_CHANGE_BEHAVIOUR what it is set to

(Auto,Manual, IfNo loss).

Check out where you have set this selection Mode. Are you modifying the same in any event.

One more thing, If you are using the latest version based on the selection mode you have set for ALV you can see the SELECTALL/DELESECT SELECTION icon. You can also check that way.

Regards,

Lekha.

Former Member
0 Kudos

Hi Lekha,

Thanks for your constant support!

I checked there is no icon on the top left corner (which i am seeing in other ALVs)

I wrote a handler for ON_LEAD_SELECT event.

Following is the code:

 wd_this->zlv_index = r_param->index.
lo_nd_rcf_assignments->set_selected( index = wd_this->zlv_index ).

It is not showing any effect on the screen,

Regards,

Sumit Oberoi

Former Member
0 Kudos

Hi Sumit,

If there is no such icon visible then it means that there is no Selection set for your ALV.

Moreover setting of selection mode is usually done in any Inbound plug/WDDOINIT/WDDOMODIFYVIEW

as per the requirement.

ON_LEAD_SELECT will trigger only when there is already a lead selection set for that ALV.

Try to set the selection mode in WDDODINT of that view. Then use the ON_LEAD_SELECT event to get the details of the selected index one.

As per your requirement, You are setting index in this event ON_LEAD_SELECT .

Regards,

Lekha.

Former Member
0 Kudos

Hi lekha,

I creatred the alv table and displed the data from the sflight.

how to edit the each and every cell,i mean how to put the cell to property inputfield in the ALV(salv_wd_table).

in this table i have to add extra row and fill the details in that row and save it.this is my requirement.

How to edit the fileds in ALV table.

thakns&Regards

Rams

Former Member
0 Kudos

Hi,

To have the inputfields for the ALV.

Get the column references of the ALV table and for each column rference create a inputfield object

type CL_SALV_WD_UIE_INPUT_FIELD.

lo_value is model object.

  CALL METHOD lo_value->if_salv_wd_column_settings~get_columns
    RECEIVING
      value = wd_this->lit_columns.

LOOP AT wd_this->lit_columns INTO wd_this->lis_columns.
      lv_id = wd_this->lis_columns-id.
      wd_this->gref_column = wd_this->lis_columns-r_column.


case lv_id.

when ' colname'.
            CREATE OBJECT lr_input
              EXPORTING
                value_fieldname = lv_id.

            CALL METHOD wd_this->gref_column->set_cell_editor
              EXPORTING
                value = lr_input.

when ' colname'.
            CREATE OBJECT lr_input
              EXPORTING
                value_fieldname = lv_id.

            CALL METHOD wd_this->gref_column->set_cell_editor
              EXPORTING
                value = lr_input.

endcase.
endloop.

Or you can take a attribute READ_ONLY for the node to which ALV table is bound.

Set the readonly property to abap_false (for input field) by looping through the table.

Get the column references and get the textview reference for each column and use the set_read_only

method by passing the attribute name.

This way the textview will now become the inputfield when the read_only property is set to abap_false.

Regards,

Lekha.