on 07-08-2015 12:56 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.