01-08-2007 8:25 AM
Hello,
I have a editable OO ALV Grid. I excluded the standard add row function and I am trying to implement my own add row function. The field catalog of my grid contains at the end a filed cellstyles type lvc_t_styl, for playing with the editabillity of the fields. The problem is like this. When I press my custom "ADD" button, I am running this code.
CALL METHOD g_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
CALL METHOD g_grid->append_rows
EXPORTING
I_ROW_COUNT = 1
.
CALL METHOD g_grid->check_changed_data
IMPORTING
E_VALID = flag
CHANGING
C_REFRESH = 'X'
The problem here is that I don't know how to make only that inserted row editable. For the rest of the table I am playing with the cellstyles field and I am able to make only one row editable, but for this new row I have troulbes, because it is not yet in my internal table and I cannot use the cellstyles field.
Thank you!
01-10-2007 5:55 AM
In the fieldcatalog, set all fields as editable.
<fcat>-edit = gc_true.
In your cellstyles table, make all fields non-editable.
For the existing lines, put the cellstyles table in the record. the cellstyles table will over-ride the layout setting, so the fields will not be editable.
When you insert a line, there will be no cellstyles, to the fields on that line are editable.
Regards
Michael
01-10-2007 5:48 AM
Hi George ,
Send me your whole code .
Second you have a method when data is changed on the screen .
In that methodsyou will er_data_changed object which have mt_inserted_rows this will have the inserted row record use this transfer into your internal table .
01-10-2007 5:55 AM
In the fieldcatalog, set all fields as editable.
<fcat>-edit = gc_true.
In your cellstyles table, make all fields non-editable.
For the existing lines, put the cellstyles table in the record. the cellstyles table will over-ride the layout setting, so the fields will not be editable.
When you insert a line, there will be no cellstyles, to the fields on that line are editable.
Regards
Michael
03-04-2007 1:16 AM
Hi,
What if my some of my fields in the ALV is having drop down list? The new appended row do not seems to display the drop down. Any workaround?
03-04-2007 4:52 PM
Why can't you update your internal table and do a refresh running through all methods which are setting your cell style. Then the new line is set up correctly automatically.
Regards,
Thomas