cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Personas 2.0 - IF condition for create/edit/display modes

KaushalShah
Active Contributor
0 Kudos

Hi,

I'm writing a flavor for an ECC transaction (REBDPR), that has the transaction code for create/edit/display modes (unlike for example VA01 for create, VA02 for edit & VA03 for display).

I've created a number of script buttons that do various things. But I need to grey out the buttons if screen is loaded in display mode.

I thought I would use a new script button, configured to be triggered upon screen load (using main user area's  onCreateHandler property).

But I'm struggling to figure out how to identify if the screen is being loaded in CREATE or CHANGE or DISPLAY mode, using script's IF condition.

There is a button on the screen, that changes it's IconID property from B_CREA to B_CHNG to B_DISP, depending upon mode. But I don't know how to write an IF condition that exploits this IconID property of this control.

I tried with control.IconID & control/IconID with "equals to" condition, but it didn't work.

Has anyone every tried or achieved this with Personas 2.0?

Or is there any other option that I can try?

Any help or guidance much appreciated!

Accepted Solutions (1)

Accepted Solutions (1)

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

You don't have access to control properties in Personas 2.0 scripting save for a few. The icon ID is not one of them.

Depending on how the transaction is built, perhaps you can use the 'is visible' or 'is hidden' conditions or maybe 'control exists' / 'control does not exist' IF conditions to find out what mode the transaction is in.

Essentially you have to find a field that has either a different value per mode or a control that is / is not part of the screen to make the decision.

KaushalShah
Active Contributor
0 Kudos

Thanks Tamas for the response. When you say "save for a few", could you let me know what all properties can we access and how?

"is visible" or "is hidden" doesn't seem to be helping. If there is a way to access "IsReadOnly" property, it might help. But I haven't been able to find this in IF condition options.

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

The only available ones are those that you can select as an option for the IF statement. Visible/hidden, exists/doesn't exist.

Answers (1)

Answers (1)

former_member105930
Active Participant
0 Kudos

Not being familiar with this transaction myself it does sound as though you may need to try and gain an understanding of how this transaction enters its various states. Is it by clicking on the Edit, display type buttons? If so, replace these with scripted buttons that do what you wish like greying out certain fields.

Is it perhaps by entering data in a certain field and then pressing enter? If so, then attach a script to the Enter action etc.

KaushalShah
Active Contributor
0 Kudos

Thanks Ian. Yes, this seems to be one option I will have to consider. There are set of buttons (create, display and change) on selection screen, so might have to replace them with scripts.

Also, once in display or change mode, user can switch from one mode to another using small change button. So I will need to replace that one as well.

If I can't find anything else, will go ahead with that option.

KaushalShah
Active Contributor
0 Kudos

Looks like I'm struggling to grey out a field as well. I can only see option to hide a control or make a hidden control visible. But there isn't an option to make a field greyed out or read-only. Any suggestion please?

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Unfortunately this is not available. However for read-only (or disabling a button) you can do a trick that is sort of a workaround.

You could have a transparent image covering the input field or the button which has a higher Z-index than the control underneath. Then, you can hide or show this image using a script action. If the image is shown, it is not possible to enter a value or click on the button, but the control underneath will still be fully visible.

This is still not perfectly equivalent of "graying out" the field, but at least it provides a similar end result. I can even imagine that instead of a completely transparent image, you would use one that's opaque and of a certain color so that the field underneath is still visible, but the image makes it appear as it was grayed out.