cancel
Showing results for 
Search instead for 
Did you mean: 

session variables in sap personas 2.0

sivaganesh_krishnan
Contributor
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

sivaganesh_krishnan
Contributor
0 Kudos

@Tamas Hoznek @Steve Rumsby any inputs on this guys ?

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.

sivaganesh_krishnan
Contributor
0 Kudos

Thanks !.. i am curios whether we can use the session to store values. is that possible in personas?

Former Member
0 Kudos

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.

former_member189842
Participant
0 Kudos

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,

Former Member
0 Kudos

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.

Answers (0)