Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAP Screen Personas

Hello Experts,

Is there  a way in which we can modify the properties of the on screen controls with the script? I mean making a control visible /invisible on the basis of a condition?

Regards,

Manu

replied

Steve, Manu,

You are both right: Steve hiding a button/control is not supported in Personas, yet. As usual, I cannot promise a feature for the future but I can promise you that we are watching SCN quite closely and take your feedback into consideration for future versions.

So, now, since you know it is not supported, yet, I show you how you can work around this with a trick

  1. Create a label with no text
  2. Position the label to the left of your button
  3. Make sure it has a higher z-index then the button
  4. Change the background color to the same background as the background of the area behind the button (Note: by default the label background is transparent)
  5. Very important: make sure that the width of the label is NaN.
  6. Now, you can create a script button that enters "        " into the label to hide the button and another script button that enters "" to show the button

So, why is this working? If the label width is NaN then the label will adjust its width based on the input text. Filling the label with spaces will extend it over your button and because of the solid background color your button is invisble and unclickable.

Cheers,
Tobias.

11 View this answer in context
Not what you were looking for? View more on this topic or Ask a question