on 04-30-2015 6:49 PM
Hi ,
Is there any way i can able to store values to a variable as global and use the same variable in different tcodes for sap personas flavors?
Regards,
Sivaganesh
@Tamas Hoznek @Steve Rumsby any inputs on this guys ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Other than using Steve's approach to cache variable values via JavaScript, the only other alternative I see would be storing these values in the backend via a WebRFC, then read them back later on with another WebRFC. This would work but it isn't the most elegant solution - and it requires ABAP development.
The technique Tamas Hoznek is referring to is described in this blog - .
Essentially you use "Calculate in JavaScript" actions to store data "globally", in other words in the browser window object. Those values persist between scripts and even between transactions. The disappear when the browser page is refreshed. I think this is what you are looking for.
Be aware that this technique does still work in Personas 3 when run in a browser. However, Personas 3 is also supported in the native Windows and Java versions of SAPgui, and there this technique doesn't work. There is no "window" JavaScript object in the Windows SAPgui. There is a new mechanism supported in Personas 3 for storing data more persistently, so if you are building flavours that you want to be usable in the GUIs as well as in a browser, you'll need to plan to convert to this standard technique when you upgrade to Personas 3.
Steve.
Hi Steve
There is a new mechanism supported in Personas 3 for storing data more persistently,
I'm wondering if you have a link to documentation of this topic. We have finished the open sap course and there was no mention of it. I checked help doca and there s nothing mentioned. I would like to learn. please let us know.
Thanks,
There's no documentation specifically abut this yet (maybe I need to add it to my list of Personas 3 blogs to write:-) but I'm talking about the put and get utility methods described here: Scripting Utility Methods.
Essentially there are "put" and "get" functions that store (key, value) string pairs. These methods work in Personas scripts running in the Windows GUI as well as in a browser. If you want to store values more complex than strings (e.g. arrays, objects), you'll need to serialise them - JSON.stringify might be a good thing to use for that.
Steve.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
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.