Hiding table in SAP Adobe Forms

7.6k Views Asked by At

I am working on a project in Adobe Forms (Interactive Forms) in SAP ABAP, and I have a table that can contain data or not according to some Select statements. When it contains data the table will be printed out otherwise the table must be hidden. I have tried to do this by using FormCalc (and also JavaScript) in the form script and the code is as follows: (and it didn`t work)

'''
//form::ready

if( $.hasData == null) then
  $.presence = "hidden"
else $.presence = "visible"
endif
'''

If data came from Select statement the table is populated and otherwise it is not. The table is printed in both situations, so it is not an implementation error.

1

There are 1 best solutions below

0
On BEST ANSWER

Select JavaScript as script type and put following into initialization event of table element:

if(this.Row1.Cell1.rawValue == "")
{
   this.HeaderRow.presence = "hidden" ;
}

where cell1 is a cell of data row of your table and HeaderRow is a header.

enter image description here