on 05-29-2013 12:22 PM
Dear Experts,
Can anyone let me know how to read the selected row of the source table and the click of "ADD" button the selected row from source table should me moved to targer table and it should be deleted from source table.
The scenario is : I have dynamically created source table and target table having values.Between source table and target table i have two buttons ADD AND REMOVE records
When i select row in souce table and click on add button,the selected row should be appear in target table and it should get deleted from source table and vice versa.
Awaiting for response.
Katrice
Hi Katrice
You can do the following :
1. Use the method get_selected_elements of the souce node, to get the list of elements selected by the user.
2. Then get the records of the target table by method get_static_attributes_table of the target node.
3. loop on the selected element list from step 1,and get the element values by method GET_STATIC_ATTRIBUTES and append the work area to the target table records obtained from step 2.
4. Remove the selected element by using method remove_element.
5. endloop.
6. Bind target table with the updated records.
Hope this helps.
Regards
Swati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
If the UI Element 'Shuttle' is available in your Webdynpro ABAP Framework, it may help you to avoid manual creation of add - remove buttons and the tricky logic.
Please go with this link it may help you.
http://scn.sap.com/docs/DOC-2293
Thanks,
Sudheer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Katrice Hawkins,
use the below code.
1. To get lead selected data.
DATA lo_nd_<node_name> TYPE REF TO if_wd_context_node.
DATA lo_el_<node_name> TYPE REF TO if_wd_context_element.
DATA ls_<node_name> TYPE wd_this->element_<node_name>.
lo_nd_<node_name> = wd_context->get_child_node( name = 'NODE_NAME' ).
* get element via lead selection
lo_el_<node_name> = lo_nd_<node_name>->get_element( ).
* get all declared attributes
lo_el_<node_name>->get_static_attributes(
IMPORTING
static_attributes = ls_<node_name> ).
* ls_<node_name> will contain lead selected line item
2. To append get the reference of target node and use bind_structure method.
lo_nd_employee TYPE REF TO if_wd_context_node.
lo_nd_employee->bind_structure( new_item = ls_<node_name> set_initial_elements = abap_false ).
3. Delete lead selected line item from source
Regards,
Ragavendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.