Skip to Content
0
Apr 05, 2011 at 09:31 AM

Make cells of Table control grayed out(input disabled) based on condition

1213 Views

Hello Experts,

I have a requirement where the data is getting populated in table control from my custom tables.

Now in three columns of the table control if the data is coming as blank from z table then I have to show the cell as editable so that user can put the data and it can be saved back in custom table but If some data is coming from custom table and it is shown in the table control then the cell should be grayed out(Non Editable).

To achive this I'm using the Following piece of code but it is not working still.

In PBO

loop at gi_actual_tc

into gw_actual_tc

with control tc_actual

cursor tc_actual-current_line.

module tc_get_lines.

endloop.

MODULE tc_get_lines OUTPUT.

data : lv_index TYPE sy-index,

lv_index1 TYPE sy-index.

lv_index = sy-tabix.

CHECK gw_actual_tc-zlc_subcon IS NOT INITIAL.

LOOP AT SCREEN.

IF screen-name = 'GW_ACTUAL_TC-ZLC_SUBCON'.

lv_index1 = sy-tabix.

IF lv_index = lv_index1.

screen-active = 0.

exit.

ENDIF.

  • screen-intensified = 1.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDMODULE.

Please let me know where I'm missing the trick here.

Thanks,

Jai