on 05-29-2011 2:06 PM
Hi All
I have below requirement.
Say In the view leftside Available Languages ItemList Box Rightside Available Languages ItemList Box and Add & Remove Buttons in the middle.
User selects languages from Available Languages ItemList Box clicks on add it will adds to the Available Languages Item List box and ViceVersa with Remove Button.
1) I have created 2 nodes 1) AvlLang 2) SelLang both contains two attributes Key and Value.
2) For AvlLang node, Property : Data Dictonary binded with table. Values are coming fine in Available Languages ItemList Box.
3) How can i add selected language into the node Available Languages.
Please provide the code snippet how to achieve this.
BR
X- CW
Apart from your request. I am just wondering about your choice of the UI element (itemList box) .I think Shuttle would be appropriate.
What i would do normally is use code generator tool (ctrl + F7 if i remember correctly ).
USe this tool to get the lead selection from Source node and set the node elemen to the target nodet. This will be a good learning for you to use the tool.
If you have trouble. Please let me know.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carlin,
Find below code to copy selected record from one node to another.
Here I am copying it_lips node into pack_mat node.
DATA: wa_temp TYPE REF TO if_wd_context_element,
lt_temp TYPE wdr_context_element_set,
count type c.
DATA : lo_nd_it_lips TYPE REF TO if_wd_context_node,
lo_el_it_lips TYPE REF TO if_wd_context_element,
ls_it_lips TYPE wd_this->Element_it_lips,
lt_it_lips TYPE wd_this->Elements_it_lips,
ls_unpack TYPE wd_this->Element_unpack,
lt_unpack TYPE wd_this->Elements_unpack.
* navigate from <CONTEXT> to <IT_LIPS> via lead selection
lo_nd_it_lips = wd_context->path_get_node( path = `ZRETURN_DEL_CHANGE.CHANGING_3.IT_LIPS` ).
CALL METHOD lo_nd_it_lips->get_selected_elements
RECEIVING
set = lt_temp.
* navigate from <CONTEXT> to <PACK_MAT> via lead selection
lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).
LOOP AT lt_temp INTO wa_temp.
CALL METHOD wa_temp->get_static_attributes
IMPORTING
static_attributes = ls_it_lips.
ls_pack_mat-vgbel = ls_it_lips-vgbel.
ls_pack_mat-vgpos = ls_it_lips-vgpos.
append ls_pack_mat to lt_pack_mat.
CLEAR ls_pack_mat.
endloop.
lo_nd_pack_mat->bind_table( new_items = LT_PACK_MAT
SET_INITIAL_ELEMENTS = abap_true ).
Cheers,
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kris/Bal,
Thanks for your answers.
Kris @ : Provided is working fine.
I have 1 Item List Box for it_lips and second List Box is pack_mat. In between 2 listboxes ADD and Remove buttons are there.
If i click on ADD : selected items should add to the 2 Item listbox and shouldn't remailn in the 1 Item List Box.
When i click on Remove button viceversa should happend.
Could you please provide your suggestions if possible code snippet.
BR
CW
Hello
When i am adding elements from first list box (Node) to second node. It is adding to second list box.
BUT it is remaining in the first list (node)box i don't want those. ViceVersa case.
When i am removing elements from second list box (Node) to first node. It is adding to firstlist box.
BUT it is remaining in the second item list (node)box i don't want those.
How can i remove elements from the nodes for the above requirement.
I followed above code for two list boxes.
Please help with some code.
BR
-CW
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.