on 01-31-2012 3:06 PM
Hi Experts,
I am enhancing a webdynpro component where i have added a button ui element to call a pop up where user can attach files to lines item.
I want to retrieve the line number on which user has clicked the "button".
For example if the lead selection is on first row and user clicks button on 2nd row how can i retrieve which line item number user has clicked on?
Thanks
Bhanu
You can get context element, and from context element you can get index (http://help.sap.com/saphelp_nw73/helpdata/en/32/bf5b4150b38147e10000000a1550b0/content.htm IF_WD_CONTEXT_ELEMENT-GET_INDEX).
WDEVENT->GET_CONTEXT_ELEMENT( 'CONTEXT_ELEMENT' ).
If the element is located in a Table, the context element is the element from the row in which the action was triggered (vertical coordinate).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Maksim,
Thanks for reply.
In on action of the button i tried retrieving the index of the record.
But lo_el_receipts is initial in case no lead selection is done and user clicks on attachment button.
DATA LO_ND_RECEIPTS TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_RECEIPTS TYPE REF TO IF_WD_CONTEXT_ELEMENT
LO_ND_RECEIPTS = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_RECEIPTS ).
LO_EL_RECEIPTS = LO_ND_RECEIPTS->GET_ELEMENT( ).
CALL METHOD LO_EL_RECEIPTS->GET_INDEX
RECEIVING
MY_INDEX = index .
Could you please advice
LO_ND_RECEIPTS->GET_ELEMENT( ).
return lead selected element.
Why don't you try approach I suggested? Retrieve context element from the event object?
data:
lr_element type ref to if_wd_context_element,
lv_index type i.
lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
lv_index = lr_element->get_index( ).
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.