cancel
Showing results for 
Search instead for 
Did you mean: 

Adobe Forms how to hide empty QR Code in table rows

Dear SAP Community,

I am currently working for the first time with SAP Adobe Forms and I am trying to generate a list of inbound deliveries generated as QR Codes so it would be easier for people working with scanners to just scan a delivery and it's products without having them to type it in. I already made it that far that I could create the relation from an import internal table to a table output in the form to generate QR Codes. Right now everything is fine.

But now I have some table fields in my form which sometimes are empty from my importing internal table. As they are empty, I don't want to have them generate as QR Codes as it might cause confusion among the workers.

I already found a similar thread with this issue, and it was mentioned that I should use a script inside the form and use the value "Presence":

Hide the QR code in sap Adobe forms if there is no data

I can do a little bit of javascript but I don't know which event and which element I need to put it in.

I tried to put the script directly into the row element and just tried, how it would look if I would set Presence to hidden.

But I am not happy with the results. The QR code is now not generated, but removed the complete column which now screws up the alignment with the header:

Is there any other way to hide the QR Code itself without removing the complete column?

Thanks for every reply in advance.

BR, Andreas

Accepted Solutions (1)

Accepted Solutions (1)

PascalBremer
Advisor
Advisor

Hi Andreas,
the QR code is the cell in the table row. If you hide it, the cells do not match up with the header column anymore.

As a workarond, keep the current coding, but wrap the qr codes in a subform. Therefore the subform will act as a placeholder for the table row cells.

Here is the preview, in the first row, first qr code is removed, so the second qr code is now in the first column.
When wrapping the qr code in the subform, they keep their hierachy.

0 Kudos

Hi Pascal, thank you so much for your reply.

With the subform it works perfect that the column stays while the QR Code being hidden.

Maybe you could help me with the next issue I am facing now. As I want to only hide the QR Code if the value in the importing table is empty, I tried following script but it seems it is not correct:

if ( hasValue( this.rawValue ) {
	this.presence = "visible";  
} else {
  	this.presence = "hidden";
}

Thank you so much for your help.

BR, Andreas

Answers (1)

Answers (1)

PascalBremer
Advisor
Advisor

Hi Andreas,
hasValue is only available for formcalc scripting. According to your screenshot you are using javascript. Therefore you could write it like:

if (this.rawValue == null || this.rawValue == "") {
  this.presence = "hidden"
}
0 Kudos

Hi Pascal,

Everything works now.

Thank you so much for your help and time.

BR, Andreas