cancel
Showing results for 
Search instead for 
Did you mean: 

Maintaining Application level values

Former Member
0 Kudos

Hi all,

I have a doubt regarding maintaining Application level data in webdynpro application. If two concurrent users accessing the same webdynpro application if one user changes some data it should be reflected to other user also. This is my requirement. For this Context attribute is not helping me becoz it is maintaining data per user. <b>The changes made to the context is applicable to that user only.</b>

If i want it to maintain for all users , is there any way to achieve it? Using Static variables i can achieve this , but without that is there any way to do it??

Thanks in advance,

Regards,

VJR.

null

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

You can WdScopeUtil to solve this problem.

https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/services/session/api/WDScopeUtil...

You can maintain application level sope

WDScopeUtil.put(WDScopeType.APPLICATION_SCOPE,key,value);

you can retrieve this value

String value=WDScopeUtil.put(WDScopeType.APPLICATION_SCOPE,key);

Regards,

Naga

Former Member
0 Kudos

Hi VJR,

In this case i think you need to do the following though its a little convoluted, seems to me the only way of achieving this on the WD application level.

Write bean classes.Import it as a bean Model into a DC.

Now you'll have to decide upon a factory in this case which will have a

notifier method and a session pool.Similarly a method exposed by the View Controller DC to invalidate its context.Make sure that the Model DC instance is shared by all the session of the View Controller DC.

If you have any confusion let me know.

Regards

Amit

Former Member
0 Kudos

Hi VJR,

Static wont solve this purpose in your case i.e because each object anyways maintains the copy of the static in it data cache so only a static volatile would

solve the purpose in this case.

Except that I think for such an application you'll have to maintain and manage the

session Id and design a layer that would take care of updating the context.

Now since the view context is private you will require to expose the (custom or component)controller context and the and you should rather expose the expected shared context of the controller.Also use the script events to update the context automatically otherwise you'll require to write events to do so and will depend on the user-interaction.

I think if you can share the scope of the application with us.We can discuss it more specifically.

Regards

Amit

Former Member
0 Kudos

Hi Amit,

Thank you very much for your reply.

I will explain my application scope. I have a webdynpro application which has two views in it. First view is login view. The user enters his userid and password and logs in. In the second view there is a table, the data in the table will pulled by calling a webservice for that userid. Let it be some salesOrders of that particular user who logs in.

And there is a list of items(Products) table in the same view. And there is a functionality of adding the some more items to that table. And one thing is that let us suppose we are not storing it in the Database. If i store the newly added item in the database then there is no problem. I can fetch it from the DB.I want it to store at application level.

And when User2 logs in and add an item i want the same to be reflect in the User1 View also. To achieve this where i have to maintain the Data. (I think controller context also User Specific).

I think you have understand my problem. If you want any thing more clear please reply.

Thanks in advance,

VJR.

Former Member
0 Kudos

Hi,

I think u can write the entries from first user to a file in server or u can serialize the file using classes from io package , so that second user can read the same file

Regards

Fahad Hamsa

Former Member
0 Kudos

Hi Fahad Hamsa,

Thank you for your reply. Using a file in a server we can achieve this. But i want to know is there any option (Like Application Variables or any) in Webdynpro to achieve the solution to my problem.

Regards,

VJR.