on 05-11-2012 6:40 AM
Hello Experts,
I have migrated to the new CTable in WD ABAP. I realise that there is no lead selection available so i used the selected elements to retrieve the selection.
Now I wonder, incase there is a selected row and i want to refresh the table and set the same selected row back as selection, i fail as i need the index of the row and then set based on index.
Could you please help?
Thanks in Advance,
Piyush
Hi,
Just try to get the index before refresh and set it after refresh.
data lv_index type i.
CALL METHOD lo_nd_empdetails->get_lead_selection_index
receiving
index = lv_index
.
CALL METHOD lo_nd_empdetails->set_lead_selection_index
EXPORTING
index = lv_index
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Jayanthi,
Thank you for your reply.
The problem here is, when i try to retrieve the index through
CALL METHOD lo_nd_empdetails->get_lead_selection_index
receiving
index = lv_index
I get the value 2- . It does not return the index of selected row. May be this is again the problem with unsupport of Lead Selection in CTABLE element.
Can yo usuggest anything here?
Thanks and Regards,
Piyush
Hi,
As suggested, you can use get_index method of if_wd_context_element.
DATA lo_ndTYPE REF TO if_wd_context_node.
data lo_element type ref to if_wd_context_element.
lo_nd = wd_context->get_child_node( name = wd_this->wdctx_node).
data lv_index type i.
* @TODO handle non existant child
IF lo_nd IS NOT INITIAL.
* get element via lead selection
lo_element = lo_nd->get_element( ).
ENDIF.
IF lo_element IS NOT INITIAL.
CALL METHOD lo_element->get_index
receiving
my_index = lv_index
.
ENDIF.
And then use set_lead_selection_index.
Hi Chengalarayulu,
I tried the code but there is no method GET_CONTEXT_ELEMENT in interface IF_WD_CONTEXT_NODE.
Can you suggest the alternative.
Also if i have the table, and an action is performed on particular row ( Click of button ), how can i realise the row for which the button was clicked?
Thanks in advance
Piyush
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.