cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Persona Script to Open TCODE with Flavor

tokgozatakan
Participant
0 Kudos
1,400

I am opening display quotes (VA23) with a flavor; when I click to change mode (VA22) it is being opened without a flavor. I have also designed a separate flavor for VA22.

How can I write a script that would open the same quote in VA22, while applying that flavor for VA22.

Accepted Solutions (1)

Accepted Solutions (1)

kmagons
Product and Topic Expert
Product and Topic Expert

Good day!

First, make sure the two flavors one for VA23 and the other for VA22 are shared with the target users via the PFCG role or direct user assignment. More information here.

Then you have two options to chose from:

1) Make the VA22 SAP Screen Personas flavor default for the given role/user in the /PERSONAS/ADMIN transaction. Doing so the flavor will be always activated when switching t-code to VA22 for the target users

2) Activate the desired VA22 flavor dynamically via script by using the session.changeFlavor(String flavorGUID) scripting API.

Thank you!

Best regards,

Krists Magons

SAP Screen Personas Dev Team

tokgozatakan
Participant
0 Kudos

Dear kmagons,

Thanks for the recommendation, since we'll be embedding this WebGUI for another application (C4C), we cannot assign it as the default flavor, as the same users still need to see everything in GUI. So the second option is our way to go.

The help document provides some info, but I was wondering if there are any blogs that you can share with us, that match our specific requirement?

kmagons
Product and Topic Expert
Product and Topic Expert

I do have a guide with exact steps at hand, but a simple conceptual solution would be like this:

- Edit the VA23 Personas Flavor

- Select the "Change" button, open the Events Dialog

- Assign an onClick script

- In the script add a line that dynamically applies the target flavor after the transaction has changed. Something like this:

session.findById("wnd[0]/tbar[1]/btn[46]").press(); // -> This is the change button of VA23

session.utils.changeFlavor("FA163EB96F251EDCA78BD2C79B8606BE"); // -> This applies the specific flavor of VA22 after the standard change button logic is executed

return true; // -> this suppresses the standard Change button logic

Thanks,

Krists

tokgozatakan
Participant
0 Kudos

Hey kmagons,

I finally had the chance to implement it, and it works nicely, thanks a lot!

Answers (2)

Answers (2)

Ritz
Active Contributor

also , there should be need for seocnd flavor as in original GUI screen we can toggle between displaya nd change mode , so in your first flavor click on edit and also adopt the screen from VA22 in same flavor, so when user will change mode the extra screen you adopted will appear.

Thanks

RD

Ritz
Active Contributor

tokgozatakan

Quick thoughts say add a button for "change" , add an script to this button which will copy the quote number from existing screen then call VA22 flavor and enter the copied value. ThanksRD