You have 2 requirements, both of which are tricky.
1. Selection of the record.
Are you able to select the record?
You have to do the following settings, the variable name should be a global variable. You need to update your table record according to this variable in PAI in Loop on internal table.
2. Make particular cells editable.
Your simple Loop at screen does not work. You will have to read the columns from your table control and then set the editable or non-editable attributes there.
This you will have to do in PBO in Loop on internal table.
Sample code:
DATA: gwa_cols TYPE scxtab_column. "scxtab_control-cols. LOOP AT tc_wt_alloc-cols INTO gwa_cols. IF <Condition> gwa_cols-invisible = abap_true. MODIFY tc_wt_alloc-cols FROM gwa_cols. ENDIF. ENDLOOP.