Skip to Content
0
Former Member
Aug 21, 2011 at 05:04 PM

How to change the screen element of a single field in a table control

21 Views

Hi Gurus,

I want to change the screen element of a single field (or the whole row) in a table control according to a condition.

I have 2 columns in the table control. One is an input column and one output only. When user enters values into the input column, they need to be compared against the values in the other column, and if there is a discrepancy, the row where the discrepancy is needs to be highlighted.

I have tried the following code which highlights the whole column ...

CONTROLS: TC_ZVOYG_BINS TYPE TABLEVIEW USING SCREEN 0500.

DATA: wa_tc_zvoyg_col LIKE LINE OF TC_ZVOYG_BINS-cols.

LOOP AT G_TC_ZVOYG_BINS_ITAB

INTO G_TC_ZVOYG_BINS_WA.

if G_TC_ZVOYG_BINS_WA-zdelivery_bin ne G_TC_ZVOYG_BINS_WA-zactual_bin.

loop at screen.

IF screen-name = 'ZVOYG_BINS-ZACTUAL_BIN'.

wa_tc_zvoyg_col-screen-intensified = 1.

MODIFY tc_zvoyg_bins-cols FROM wa_tc_zvoyg_col TRANSPORTING

screen-intensified WHERE screen-name = screen-name.

endif.

endloop.

endif.

endloop.

And also the following code which makes no change ...

LOOP AT G_TC_ZVOYG_BINS_ITAB

INTO G_TC_ZVOYG_BINS_WA.

if G_TC_ZVOYG_BINS_WA-zdelivery_bin ne G_TC_ZVOYG_BINS_WA-zactual_bin.

loop at screen.

IF screen-name = 'ZVOYG_BINS-ZACTUAL_BIN'.

screen-intensified = '1'.

modify screen.

endif.

endloop.

endif.

endloop.

Thanks in advance.