on 02-17-2012 1:10 AM
Hi,
How can i get the Index Number if an Item Selected on Webdynpro ALV Component.
Thanks and Regards,
SenthilPandi C
HI,
Use the following code to get the index of selected item.
DATA lo_nd_node TYPE REF TO if_wd_context_node.
DATA lo_el_node TYPE REF TO if_wd_context_element.
DATA ls_node TYPE wd_this->element_node.
DATA value type index.
* navigate from <CONTEXT> to <NODE> via lead selection
lo_nd_node = wd_context->get_child_node( name = wd_this->wdctx_node ).
* @TODO handle not set lead selection
IF lo_nd_node IS INITIAL.
ENDIF.
* get element via lead selection
lo_el_node = lo_nd_node->get_element( ).
* @TODO handle not set lead selection
IF lo_el_node IS INITIAL.
ENDIF.
CALL METHOD LO_ND_NODE->GET_LEAD_SELECTION_INDEX
RECEIVING
INDEX = value " the variable value stores the index of selected element
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I think you are reading the index of an empty node, Because the WDDOMODIFY method will be triggered at
start up of application after WDDINIT method and you are not filling the node in DOINIT. so you will be reading
the index of empty node which would be negative.
As you told you want to process the selected line of ALV you can get the lead selection in the
ON_LEAD_SELECT event of ALV, So remove your code from modify and write it here.
1)Create an event handler for on lead select event of ALV
2)go to methods tab and create new method with method type as event handler and click on F4 in the event
column and select ON_LEAD_SELECT event from the popup.
3) write your code into this method.
There is no such property called lead selection for Node.
Did you mention the ALV Component Property?
Check clearly for every node we have one property "initialize lead selection" . Check whether you selected this property or not.
And am talking about node which is binded to your normal table or alv table.
Regards
Srinivas
Hi,
Read the context node :
1. element = lonode->get_lead_selection( ), this will return the selected row content.
2. GET_LEAD_SELECTION_INDEX method of if_wd_context_node will return the index.
Thanks,
Shailaja Ainala.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.