Hi Jay,
Yes, understood your requirement.
Let us say you have columns a, b, c, d, e, f. and now you wish to make c, d columns as read only for old records but these should be editable for a new line.
Go to VIEW LAYOUT, choose the cell editor ( input field/etc ) of column c and bind the property "READONLY" to the attribute CELL_READ
Similarly do for the other column D as well.
Now, you have setup the READ only property of columns which will be decided by the value of CELL_READ.
" To make columns C, D as read only for the existing records
Hope you are getting data and binding it to context node .. usually in WDDONIT( ) method of your view.
data lt_data .... " this is your internal table
field-symbols: <fs_data> like line of lt_data.
..... here you got data from data base
.... loop over table and set CELL_READ to TRUE
loop at lt_data assigning <fs_data>.
<fs_data>-CELL_READ = abap_true. " Setting TRUE for read only mode.
endloop.
.... .bind this data to context node
lo_node->bind_table( lt_data ).
.... So whenever you need to make cells as read only... then pass cell_read = ABAP_TRUE and bind it back to context.
Hope this helps you.
Regards,
Rama