cancel
Showing results for 
Search instead for 
Did you mean: 

web dynpro alv row deselect

Former Member
0 Kudos

Hi,

is it possiple to deselect a row in an alv grid?

i try something like this

data node TYPE REF TO if_wd_context_node.
   data lv_old_index type i.
   data lv_new_index type i.
DATA: r_param TYPE REF TO if_salv_wd_table_lead_select.
   lv_new_index = r_param->index.
   lv_old_index = r_param->old_index.

IF lv_old_index = lv_new_index.
node = wd_context->get_child_node( 'ZPROFESSOR_AENDERN' ).
node->set_lead_selection_index( if_wd_context_node=>no_selection ).
ENDIF.

But i got this Error
Zugriff über 'NULL' Objektreferenz nicht möglich

my connected context node for the alv is ZPROFESSOR_AENDERN and it got the Cardinalität 0..N and the Selection 0..N

I realy tried a lot and search the web for a Solution but not a chance.

Please Help me .

Regards

TK

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

thanks for you Answer, but then i get an dump

that there is no contextbinding and the lead selection is no t set....

so this wont work either.

kr

tk

Former Member
0 Kudos

Hi

it worked for me

  • find the Node properties

  • ALV initial screen before populating data

  • ALV screen after populating the data

  • no lead is selected initially when i am populating data into the ALV

The reason for your dump is there might be some code written in order to fetch the selected node

Points please if helpful

Regards

Subhash

Former Member
0 Kudos

Hi,

ok...this could be possible...thx for the Answer

kr

tk

Answers (3)

Answers (3)

Former Member
0 Kudos

but with this soulution comes a new problem.

Damm MVC Modell.

is there a tutorial or a tipp where someone realises this:

one view for creating and changing + alv table with selct

all together bondet on one context node?

in the past i got 2 context nodes and 2 viewes. one for creating and one for changing

an now i want to realize one view were i can use for creating and changeing + alv table.. all with the same context node

this is driving me crazy...

Former Member
0 Kudos

to solve my problem i try to implement an ON_CLICK event on my ALV-table view.

but the event does not start...i realy dont know why?

maby becaue of the missing lead selection?

here the context node for the alv table

Former Member
0 Kudos

EDIT: if i use ON_LEAD_SELECT it fits...

i dont get it...pfff

but it seems to be forbidden, to show the same view twice in a component.

so can not use the same view fore changing and edit my data.

or is there a way?

former_member184958
Active Participant
0 Kudos

Hi,

ele_node = wdevent->get_context_element('CONTEXT_ELEMENT').

Through the above code we will get the index of selected field pass the index to lead selection.

Hope helpful to you.

Regards,

John.

Former Member
0 Kudos

Thank for Your Answer,

but i asked for the deselect of a row.

kr

tk

Former Member
0 Kudos

Hi

It is possible !

the reason you might be getting the error is because

Initialization Lead Selection property of the node is enabled  !

You need to un check the Initialization Lead Selection  check box of the node which is being displayed in the ALV,

Then by default no row will be selected. Hope this is helps solve your problem

Points please if it helps

Regards

Subhash