Quantcast
Viewing all articles
Browse latest Browse all 9369

Re: Hiding a table column for a particular condition

This is how I solved it:

 

1. Declare a boolean variable in the form interface and flag it true or false depending on whether the condition was met or not in the Code Initialization of the form. Example code below:

 

DATA:  ls_items TYPE zlo_s_promo_item.

LOOP AT it_promo_items INTO ls_items
  WHERE prom_sell_price IS NOT INITIAL.  EXIT.
ENDLOOP.

lv_psell_flag = boolc( sy-subrc IS NOT INITIAL ).

 

 

2. Define the column header as Text Field then bind it to the boolean variable declared in step 1. FormCalc script for the column header should be as under:

 

if ( $.rawValue == "X" ) then
$.presence = "hidden";
endif

 

3. The FormCalc script for the column value (defined as Decimal field in my case) should be as under:

 

 if ( $.rawValue == null or $.rawValue == "" or $.rawValue == 0.00 ) then  $.presence = "hidden";
 endif

 

Result is the entire column (including the column header) is displayed or hidden depending on the value of the boolean variable.

 

Hope this helps someone in future who might be stuck at a similar issue.

 

Cheers,

Sougata.


Viewing all articles
Browse latest Browse all 9369

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>