cancel
Showing results for 
Search instead for 
Did you mean: 

Can I dynamically switch between Screen Personas based on actions taken on-screen?

Daniel_Frantz
Explorer
0 Kudos
236

Is it possible for users to be shown a different Screen Persona based on manual inputs?

For example, if a user uses QM01 to to create a quality notification and they enter "Z3" for notification type, they'd be shown the Z3 persona. If they entered "Z2" for notification type, they'd see the Z2 persona. 

I appreciate the help, and am open to a different approach if a more appropriate one is available!

SAP Screen Personas 

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

Of course. You can switch the flavor via scripting, based on input value.
session.utils.changeFlavor

Another way could be using different viewports and switching between those instead of another flavor. Then, you would need to deal with just a single flavor during flavor assignment which will make administration easier.

It really depends on the actual scenario. If the two layouts are very different across multiple screens, then having separate flavors is probably simpler. If the difference is only in one screen, then going the viewport way would be beneficial.

View Entire Topic
Daniel_Frantz
Explorer
0 Kudos

Thank you for the help! For this screen it is looking like I will need to use different personas as some of the same fields need to be labeled differently based on the scenario.

Could you help me to understand how to reference a field on the screen for a script? I found an example shown below where a variable on-screen was is identified using session.findByID. Where do I find the quoted variable location for the script (line 2)?

//Set Variable for Order Type
var Order=session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP*/tabpT\\01/ssubSUBSCREEN_BODY:SAPMV45A:4301/ctxtVBAK-AUART").text;

//Switch flavor if order type is = ZFOC
if (Order =="ZFOC");
{session.utils.changeFlavor("00505686770A1ED78DA1150E838D9420");}

SAP Screen Personas 

 

 

 

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

You'd use the Inspector in the script editor, to reference the property of a control you are interested in. Take a look at the video in our most recent course on the SAP Learning platform to see an example how to do that. It's at about the 3:40 mark: https://learning.sap.com/courses/adapting-the-ui-in-sap-s-4hana-cloud-using-sap-screen-personas/usin...