Skip to Content
-1
Apr 18, 2017 at 07:09 AM

New COND statement; how to not change value?

114 Views

Hi,

I have an itab with a color-field, and I use several cond-statements to fill it. However, It gets reset each time the cond statement is false. Is it possible to come around this?

" Menge

<gs_data>-cc = COND #( WHEN l_menge_i <> l_menge_p THEN VALUE #( BASE <gs_data>-cc( fname = 'MENGE' color-col = '3' color-int = '1' ) ) ).

" Wmnge

<gs_data>-cc = COND #( WHEN l_wmnge_i <> l_wmnge_p THEN VALUE #( BASE <gs_data>-cc( fname = 'WMNGE' color-col = '3' color-int = '1' ) )

In my exampe table CC is filled in first statement, but when statement is false for WMNGE, the table is cleared.

I've added a second base-statement, and that seems to work, but it appends a blank line to the table.

(...)
WHEN l_wmnge_i = l_wmnge_p THEN VALUE #( BASE <gs_data>-cc ( ) ) ).

Is there anyway that the CC-table remains untouched when the COND-statement is false?