on 10-23-2008 4:58 PM
Hi,
When i selected a row of table, the value which is of selected row, is adding to dropdownbyindex but other values of dropdownbyindex is deleting.
How can i add a value that is selected row's field of a table to dropdownbyindex? (as a javascript method that object.additem('value')).
Thanks.
Hi,
Get the lead selection row of the table using the GET_LEAD_SELECTION (check for other related methods) and read the value of the field that you want.
Using this value, first try to add this to a other table and try to bind this table to the DropDownByIndex.
Regards
Lekha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanks again,
i've already appened the value of selected row into internal table.
i'm writing my codes if you want to research .
DATA lo_nd_gt_orders TYPE REF TO if_wd_context_node.
DATA lo_el_gt_orders TYPE REF TO if_wd_context_element.
DATA ls_gt_orders TYPE wd_this->element_gt_orders.
DATA lt_sel_items TYPE STANDARD TABLE OF
wd_this->element_gt_sel_items.
DATA ls_sel_items TYPE wd_this->element_gt_sel_items.
* navigate from <CONTEXT> to <GT_ORDERS> via lead selection
lo_nd_gt_orders = wd_context->get_child_node( name =
wd_this->wdctx_gt_orders ).
* @TODO handle not set lead selection
IF lo_nd_gt_orders IS INITIAL.
ENDIF.
* get element via lead selection
lo_el_gt_orders = lo_nd_gt_orders->get_element( ).
* @TODO handle not set lead selection
IF lo_el_gt_orders IS INITIAL.
ENDIF.
* alternative access via index
* lo_el_gt_orders = lo_nd_gt_orders->get_element( index = 1 ).
* @TODO handle non existant child
* IF lo_el_gt_orders IS INITIAL.
* ENDIF.
* get all declared attributes
lo_el_gt_orders->get_static_attributes(
IMPORTING
static_attributes = ls_gt_orders ).
data:
Node_order type REF TO IF_WD_CONTEXT_NODE.
ls_sel_items-vbeln = ls_gt_orders-vbeln.
APPEND ls_sel_items to lt_sel_items.
* navigate from <CONTEXT> to <SFLIGHT> via lead selection
Node_order = wd_Context->get_Child_Node( Name = `GT_SEL_ITEMS` ).
*Node_order->Bind_Table( lt_sel_items ).
Node_order->BIND_STRUCTURE( ls_sel_items ).
Hi,
Check the cardinatliy of the Table once.
In the deugging were you able to find all the values in the Ls_items and the lt_orders table.
Check out this PDF for more help -
http://www.sap-press.de/download/dateien/1079/sappress_web_dynpro_for_abap.pdf
Regards
Lekha
Hi Nurulla,
This is where your problem lies: You are binding a new internal table to the node GT_SEL_ITEMS. This will take away all the old values
* get all declared attributes
lo_el_gt_orders->get_static_attributes(
IMPORTING
static_attributes = ls_gt_orders ).
data:
Node_order type REF TO IF_WD_CONTEXT_NODE.
ls_sel_items-vbeln = ls_gt_orders-vbeln.
APPEND ls_sel_items to lt_sel_items.
* navigate from <CONTEXT> to <SFLIGHT> via lead selection
Node_order = wd_Context->get_Child_Node( Name = `GT_SEL_ITEMS` ).
*Node_order->Bind_Table( lt_sel_items ).
Node_order->BIND_STRUCTURE( ls_sel_items ).
Your algorithm should actually be
Retrieve lt_sel_items from node GT_SEL_ITEMS first at the beginning of the code.
and then append ls_sel_items to this lt_sel_items .
So your code should now be.
DATA lo_nd_gt_orders TYPE REF TO if_wd_context_node.
DATA lo_el_gt_orders TYPE REF TO if_wd_context_element.
DATA ls_gt_orders TYPE wd_this->element_gt_orders.
DATA lt_sel_items TYPE STANDARD TABLE OF
wd_this->element_gt_sel_items.
DATA ls_sel_items TYPE wd_this->element_gt_sel_items.
* navigate from <CONTEXT> to <GT_ORDERS> via lead selection
lo_nd_gt_orders = wd_context->get_child_node( name =
wd_this->wdctx_gt_orders ).
* @TODO handle not set lead selection
IF lo_nd_gt_orders IS INITIAL.
ENDIF.
* get element via lead selection
lo_el_gt_orders = lo_nd_gt_orders->get_element( ).
* @TODO handle not set lead selection
IF lo_el_gt_orders IS INITIAL.
ENDIF.
* alternative access via index
* lo_el_gt_orders = lo_nd_gt_orders->get_element( index = 1 ).
* @TODO handle non existant child
* IF lo_el_gt_orders IS INITIAL.
* ENDIF.
* get all declared attributes
lo_el_gt_orders->get_static_attributes(
IMPORTING
static_attributes = ls_gt_orders ).
data:
Node_order type REF TO IF_WD_CONTEXT_NODE.
ls_sel_items-vbeln = ls_gt_orders-vbeln.
* navigate from <CONTEXT> to <SFLIGHT> via lead selection
Node_order = wd_Context->get_Child_Node( Name = `GT_SEL_ITEMS` ).
*Retrieve the table from GT_SEL_ITEMS and then add the ls_sel_items to it
Node_order->get_static_attributes_table(
IMPORTING
static_attributes = ls_gt_orders ).
APPEND ls_sel_items to lt_sel_items.
Node_order->Bind_Table( lt_sel_items ).
finally i changed something that,
data:
Node_order type REF TO IF_WD_CONTEXT_NODE.
ls_sel_items-vbeln = ls_gt_orders-vbeln.
APPEND ls_sel_items to lt_sel_items.
* navigate from <CONTEXT> to <SFLIGHT> via lead selection
Node_order = wd_Context->get_Child_Node( Name = `GT_SEL_ITEMS` ).
*Retrieve the table from GT_SEL_ITEMS and then add the ls_sel_items toit
Node_order->get_static_attributes_table(
IMPORTING
table = lt_gt_orders ).
loop at lt_gt_orders INTO ls_gt_orders.
ls_sel_items-vbeln = ls_gt_orders-vbeln.
APPEND ls_sel_items to lt_sel_items.
ENDLOOP.
Node_order->Bind_Table( lt_sel_items ).
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
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.