cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to select a row in ALV in Webdynpro

0 Kudos

Hi everyone,

I have developed a webdynpro application and I have declared component usage for SALV_WD_TABLE.

The data gets displayed in the ALV, but always the first row is selected.

When I try to select another row,I am not able to select.

Could anyone please suggest what might be the problem ?

Thanks in advance.

Regards,

Kumudha.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Kumudha,

After going through all replies, I think ur looking for a Application Just similar to

Web Dynpro Component : WDT_ALV

Description : Sample solution for tutorial ALV in Web Dynpro A

Web Dynpro Component : WDR_TEST_DYN_ALV_USAGE

Description : Web Dynpro Application wdr_test_dyn_alv_usage / Component WDR_TEST_DYN ALVUSAGE

Here U can check, for selection of rows in ALV.

Note: To see this in your system please do activate these services

sap/bc/webdynpro/sap/wdt_alv and sap/bc/webdynpro/sap/wdr_test_dyn_alv_usage in T-code SICF

if still ur not getting the requested result then, it is due to Patch Update in your SAP S/m.

Regards,

Lokesh

0 Kudos

Hi All,

This was due to recent patch update, issue got resloved with application of Note: 1363334

Thanks one and all.

Regards,

Kumudha.

Answers (2)

Answers (2)

arjun_thakur
Active Contributor
0 Kudos

Hi Kumudha,

Just check the selection property of the node (which you have binded to the data node of the ALV component) to 0:1 or 0:n.

Regards

Arjun

0 Kudos

Hi Arjun,

I have set the selection property of the node to '0:n'.

I haveeven tried changing this to '0:1', but it didnt work in both the cases.

And cardinality I have set to '1:n'.

Please suggest.

Regards,

Kumudha.

Former Member
0 Kudos

Hi,

If u are having the selection property as 0:n and cardinality as 0:n then it should work. Plz check it once again.

Please check if u have done something wrong in coding.

Former Member
0 Kudos

First row may be selected because you must have set Initialize Lead Selection to True in your context node bound to ALV.

Other is you have to set the Row selectable property of ALV to true using the below code

  • SET row selectable as true

CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_TABLE_SETTINGS~SET_ROW_SELECTABLE

EXPORTING

VALUE = ABAP_TRUE.

where LR_FUNCTION_SETTINGS is TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

Hope you got the idea.

Regards

Manas Dua

0 Kudos

Hi Manas,

I have tried to add the code you have given in the "WDDOINIT" method of the view being used.

But , the row didnt get selected.

Please suggest.

Regards,

Kumudha.

Former Member
0 Kudos

Hi,

As said above cardinality should be 0..n as your alv can have 0 or N rows.

Selection can be 0..1 or 0..N based on your scenario.

Can you paste the piece of code you have written, so that we can try to figure out if something is wrong.

Ideally, with above mentioned steps it should work.

Regards

Manas Dua

0 Kudos

Hi Manas,

Thanks for the inputs.

I am placing the code below for your reference.

I try to change the below as Display Text as Code...But it is not happening Plz check

-


method wddoinit.

if wd_this->ls_setup is initial.

select single * from yyua_c_setup into wd_this->ls_setup

where system_id = sy-sysid.

endif.

"adjustments for ALV

data lo_cmp_usage type ref to if_wd_component_usage.

lo_cmp_usage = wd_this->wd_cpuse_alv( ).

if lo_cmp_usage->has_active_component( ) is initial.

lo_cmp_usage->create_component( ).

endif.

data: l_ref_interfacecontroller type ref to iwci_salv_wd_table .

l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).

data: l_value type ref to cl_salv_wd_config_table,

lr_header_t type ref to cl_salv_wd_header,

lv_text type string.

l_value = l_ref_interfacecontroller->get_model( ).

data: lr_column_settings type ref to if_salv_wd_column_settings,

lr_input_field type ref to cl_salv_wd_uie_input_field,

lr_column type ref to cl_salv_wd_column.

  • Set column title and position

lr_column = l_value->if_salv_wd_column_settings~get_column( 'CSINSTA' ).

lr_column->set_position( 1 ).

  • lv_text = cl_wd_utilities=>get_otr_text_by_alias( 'Z_REFERENCE/REQUEST_NUMBER' ).

lr_column->r_header->set_text( 'Installation' ).

lr_column->r_header->set_ddic_binding_field( '00' ).

lr_column = l_value->if_salv_wd_column_settings~get_column( 'ERFUNAME' ).

|

lr_column->set_position( 18 ).

  • lv_text = cl_wd_utilities=>get_otr_text_by_alias( 'Z_REFERENCE/ACTIVITY_DATE' ).

lr_column->r_header->set_text( 'Job profile ext' ).

lr_column->r_header->set_ddic_binding_field( '00' ).

  • Hide columns

lr_column = l_value->if_salv_wd_column_settings~get_column( 'ERFTSTMP' ).

lr_column->set_visible( 0 ).

lr_column = l_value->if_salv_wd_column_settings~get_column( 'AETSTMP' ).

lr_column->set_visible( 0 ).

lr_column = l_value->if_salv_wd_column_settings~get_column( 'STATUS' ).

lr_column->set_visible( 0 ).

lr_column = l_value->if_salv_wd_column_settings~get_column( 'PRIO' ).

lr_column->set_visible( 0 ).

lr_column = l_value->if_salv_wd_column_settings~get_column( 'ISSUE' ).

lr_column->set_visible( 0 ).

*

data: lr_functions type ref to if_salv_wd_function_settings,

lr_function type ref to cl_salv_wd_function,

lr_button_t type ref to cl_salv_wd_fe_button.

  • Add self-defined functions in toolbar

lr_functions ?= l_value.

lr_function = lr_functions->create_function( 'SELECT' ).

create object lr_button_t.

  • lv_text = cl_wd_utilities=>get_otr_text_by_alias( 'Z_REFERENCE/VIEW' ).

lr_button_t->set_text( 'Select' ).

lr_function->set_editor( lr_button_t ).

data : LR_FUNCTION_SETTINGS TYPE REF TO CL_SALV_WD_CONFIG_TABLE.

create object LR_FUNCTION_SETTINGS.

  • SET row selectable as true

CALL METHOD LR_FUNCTION_SETTINGS->IF_SALV_WD_TABLE_SETTINGS~SET_ROW_SELECTABLE

EXPORTING

VALUE = ABAP_TRUE.

endmethod

-


Regards,

Kumudha.

Former Member
0 Kudos

Hi

Simply replace lr_function_settings with l_value.

You already have a referenc to alv model class.

check it then

Regards

Manas Dua

0 Kudos

Hi Manas,

I have checked replacing with l_value, but no change.

The row is still not getting selected.

Please advise.

Regards,

Kumudha.

Former Member
0 Kudos

Lets wait for Thomas's input then..

It should work with above mentioned checks.

Try creating a new ALV and see if it behaves the same.

Regards

Manas Dua