cancel
Showing results for 
Search instead for 
Did you mean: 

How call to a specific flavor?

Former Member
0 Kudos

Hello,

I want to create a script button to call to one flavor but I don't know if it is possible.

For example:

I have one flavor called SU01NEW, and another flavor called SU01OLD.

If I am in MAIN MENU (SMEN) can I create a transacction/script button to call to each flavor independently?

Best regards.

Accepted Solutions (1)

Accepted Solutions (1)

former_member105930
Active Participant
0 Kudos

Hi,

In SAP Personas 2 SP3 you can use the Switch flavor option:

So the script would end up looking somethign like this:

To get the id of the flavor either select it using the picker tool, or save your script, navigate to the transaction itself and enter edit mode. And then left click on the flavor name to copy the flavor id, then paste it onto your script button when you return to your SMEN flavor.

Pre-SP3 on Personas 2 you can enter the name of the flavor instead.

regards,

Hope this helps.

Former Member
0 Kudos

Sorry, I forgot to say that I am looking for SAP Screen Personas 3.0

Answers (3)

Answers (3)

0 Kudos

Please see this : Scripting Utility Methods - SAP Imagineering - SCN Wiki

Also, from Script Editor, you can use Auto-Suggest.

Like if you start typing

session.

session.utils.

After (DOT), press CTRL+SPACE

It will show you all the methods.

Regards,

Sushant

Former Member
0 Kudos

Hi Sushant,

Good tip!

BTW, in JS, is 'session' the only root object from which I can find all other lower level methods? I mean, is there any other root object like 'session' that will bring some methods?

I can see this tip does not work for the web objects like window, nevigator, browser, document etc. Why?, Thx.

Dong Zhu

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

There is no other object with lower level methods.

Former Member
0 Kudos

Thanks.

So Window, Browser, Document etc objects are not supported by JS in Personas 3.0, can I understand that it not 100% JS compatible in Personas 3.0. But in Personas 2.0, at least window object is supported. Why is it changed in Personas 3.0 to have less JS features? Thx.

Dong

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

I'm not saying that they are not supported. They are. However they don't have the Ctrl+Space option in the editor like the object session has.

So you can certainly use those other objects, but keep in mind that the idea is that your Personas flavor also runs in the native SAP GUI and using those objects in your script will make it not work in SAP GUI.

Former Member
0 Kudos

I see. Thanks for the clarifications. 🙂

Dong

Former Member
0 Kudos

Hi,

Do this in Peronas 3.0:

1: open scripting window, create a JS func called "switchFlav", and add code:

session.utils.changeFlavor("id-of-the-flavor-to-go");

2: On UI, add a script button, attach the "onClick" even to the JS code "switchFlav",

That is it!

If this solves your issue, please mark it as Correct Answer. Thanks.

Dong Zhu

Former Member
0 Kudos

Hi Asier,

I also came across this issue, I wanted to create two different flavours for the same transaction. Normally, if you just use the transaction button I could not get it to work unless I created a custom transaction name and then put that into the transaction button with the flavour attached to that custom name.

These days though, there is a more advanced and better solution. A quick google, and I found this article, SAP Screen Personas Scripting - SAP Imagineering - SCN Wiki

If you scroll down you will find a part of this article that tackles the issue of creating scripts for switching between flavours. I am pretty sure you can edit this script to just fire on a button click rather than a specific order.

Last but not least, could you do me a favour? If you find that this solution works for you, can you mark your question as answered? This way others, when they search for this topic will see that there is a solution inside it and will read it. In addition, it means that other users will know that the problem is solved and they do not have to go through the topic.

Cheers,

Angus

Former Member
0 Kudos

Hi, Did any one tested calling specific flavor using a script?