on 01-28-2009 7:36 AM
Hi All,
I need to make the lead selection row of the table editable..I could able to do this when i create readonly attribute in the same node to which i have binded the table but i want a separate readonly attribute and the selected row only need to be changed which i click on the change button. Please help me..
Thanks
Swapna
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanks for the reply...i dont have any problem to change the entire table to editable mode...but i want only selected row (when user clicks on lead selected of a particular row ) should change to editable mode when clicked on change button..please let me know..how is this possible?
The threads already explained how to make a particular row editable/non editable based on a condition (eg., if index =3 or wa_mara-meins = 'EA' )....but my requirement is to make the seletceted row (upon user click) should be changed to editable..
Edited by: Swapna Sharma on Jan 28, 2009 11:50 AM
Hi Swapna,
please follow the following steps
1. create a table
2. create context as follows
a). create node with name node1
b). create attributes in the node 1.kunnr 2. name1.3)mode1.4)mode2
3. bind the table with the context
4. then bind readonly porperty of column1 with mode1 column2 with mode2.
also set column 3 and 4 visible property to none
5. in the method init write the following code.
data lo_nd_node1 type ref to if_wd_context_node.
data lo_el_node1 type ref to if_wd_context_element.
data ls_node1 type wd_this->element_node1.
navigate from <CONTEXT> to <NODE1> via lead selection
lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
types: begin of ty_kna1,
kunnr type kunnr,
name1 type name1,
mode1 type boolean,
mode2 type boolean,
end of ty_kna1.
data: it_kna1 type table of ty_kna1.
data: it_kna2 type table of ty_kna1.
data : wa_kna1 type ty_kna1.
select kunnr land1 into table it_kna1 from kna1 up to 10 rows.
loop at it_kna1 into wa_kna1.
wa_kna1-mode1 = 'X'.
wa_kna1-mode2 = 'X'.
append wa_kna1 to it_kna2.
endloop.
lo_nd_node1->bind_table( it_kna2
).
6. now create a edit button and on action event write the following code
DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
data lt_temp TYPE wdr_context_element_set..
DATA lo_el_node1 TYPE REF TO if_wd_context_element.
DATA ls_node1 TYPE wd_this->element_node1.
lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
lo_el_node1->get_static_attributes(
IMPORTING
static_attributes = ls_node1 ). "here you will get the selected row
data: it_tab type table of wd_this->element_node1.
data:it_tab2 type table of wd_this->element_node1.
data: wa_itab type wd_this->element_node1.
lo_nd_node1->get_static_attributes_table(
importing
table = it_tab ). " here you will get the itab
loop at it_tab into wa_itab.
if wa_itab-kunnr eq ls_node1-kunnr.
wa_itab-mode1 = ' '.
wa_itab-mode2 = ' '.
endif.
append wa_itab to it_tab2.
endloop.
lo_nd_node1->bind_table( it_tab2 ).
Thanks
Shaik Shadulla.
Edited by: shaik shadulla on Jan 28, 2009 1:58 PM
Edited by: shaik shadulla on Jan 28, 2009 2:15 PM
Hallo,
other options than an attribute in the data node are not available,
the best you can do is create a subnode (cardinality 1..1) that you should fill manually.
grtz,
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.