on 05-29-2013 2:17 PM
Hi Guys,
I need to implement an ALV that can have editable and non-editable rows. I assign to the context for each element its corresponding properties of an attribute, When i debugg I can see them but in the ALV are always the same. When I create an ALV:
1° Get or create the instance of ALV
2° Set a correct format for ALV:
3° Create the input field assigning each column to a fieldname in a context
lr_aux->set_enabled_fieldname
lr_aux->set_read_only_fieldname
...
and so on
4° I assign its corresponding properties for each element in the context.
Finally I see the ALV with the same properties in all columns.
The main idea should be something like the following scracth:
+editable
-read only
+|+|+|-
-|-|+|+
+|+|-|-
But now are all the same
How could I solve it?
Thanks
Sergio.
Hi Sergio
For that you need to add same number of technical columns as the number of columns your ALV has.
Then set the read only fieldname for each column with unique technical column name and handle the values of the technical column separately.
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 Sergio,
I guess you might have missed one of the following things. .
1. lo_model->if_salv_wd_table_settings~set_read_only( abap_false ).
This is mandatory to use if you want to make your ALV editable.
2. lr_aux->set_enabled_fieldname( )
Do not use this. Instead use only lr_aux->set_read_only_fieldname( ) with the column name that contains your Boolean values abap_true and abap_false for editable rows and non editable rows.
Thanks,
Vishu Agarwal
Hi Sergio ,
You can try something like this...
1. Create one node say NODE1 with required attributes.
2. Create another node2 say NODE2 with same number of attributes of first node, and data type of each attribute should be WDY_BOOLEAN. (Here attribute names of Node1 and Nod2 should be same).
3. Bind readonly property of each attribute with node2 attributes.
4. Now handle readonly property as follows.
lo_nd_node1 = wd_context->path_get_node( path = `NODE1` ).
lo_el_node1 = lo_nd_node1->get_element( ).
lo_nd_node2 = wd_context->path_get_node( path = `NODE2` ).
lo_el_node2 = lo_nd_node2->get_element( ).
lo_nd_node1->get_static_attributes_table( IMPORTING table = lt_node1 ).
LOOP AT lt_node1 INTO ls_node1 .
IF ls_node1-<XYZ> = 'ABC'.
lo_el_node2->set_attribute( name = -<XYZ> value = abap_true ).
lo_el_node2->set_attribute( name = -<PRQ> value = abap_false ).
.
.
.
ENDIF.
ENDLOOP.
Regards,
ELSEIF ls_node2-<PQR> = 'LMN'.
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.