cancel
Showing results for 
Search instead for 
Did you mean: 

ReloadData() script does not refresh data. Any ideas why?

Former Member
0 Kudos

Hi All,

I'm working on a near real time scenario where my data has to refresh on the Design studio application, without ending the session of the application, for every 30 minutes. I used the Realtime SDK -timer component and achieved a screen change. But the data refresh does not happen. I wrote DS_1.reloadData(); on the on timer script box for the timer component and restarted the timer. But this does not refresh my data.

I'm using DS1.5 as my client tool and BEx query as my backend. I checked a lot of discussions in SCN and the developer guide for DS1.5. Everywhere it says that reloadData() should refresh the data when there is no filter or variable change happening. But this is not happening in my case.

I tried setting a filter value and after a second changed the filter value as well and then did the reloadData() script again. But this does not work wither.

Is there any cache which I can reset or uncheck to refresh data? This is an important feature of the dashboard and is a major requirement. There will be no interaction in the dashboard and there are no variables for me to use. I can create variables but this will be as a last option.

Can someone please help me on this?

Regards,

Varshini.

Accepted Solutions (1)

Accepted Solutions (1)

MustafaBensan
Active Contributor
0 Kudos

Hi Varshini,

In addition to Tammy's suggestion, can you place an APPLICATION.Alert() call in the "On Timer" event to confirm that it is in fact being triggered after 30 minutes?  You might have encountered the 30 minute timeout threshold discussed in the post Timeout in Design Studio.  Perhaps you can verify by testing with a 5 minute timer setting?

Regards,

Mustafa.

Answers (3)

Answers (3)

Former Member
0 Kudos

Has this worked?

We are having a similar issue on DS 1.6. We have a query that has date as a parameter and is bringing back delivery counts on refresh. When the date remains the same, the dashboard is failing to bring back current data. But when I close the application and reopen, the data refreshes.

For some reason, when SAP said we weren't supposed to use TIMER for  PROD purposes, we tried using a button to check if the reloadData() function is even bringing back any data. To our surprise, the function doesn't bring back data when the paramter remains the same. It brings back current data when we change the date however.

Has anyone faced the same issue? If yes, were you able to resolve it or find a workaround?

Thanks & Regards,

Vijay

Former Member
0 Kudos

Hi Tammy,

The Timer I'm using is the Real Time Package timer as mentioned in the discussion by Mustafa. I'll get you screenshots in a while.


Mustafa,


I'm using two timer components in my application. One is to change screens every 30 seconds, which works perfectly. The other is for the data refresh.I did try this out with an application.alert() on both timers and they worked fine.

I do not have issues with session expiration because the application keeps running without any timeout errors even after manual intervention after 4 hours. But the reload does not happen. The next thing I'm going to try is to have just one timer component and test the reloadData() script. If this works then Design Studio probably does not like having more than one timer in an application. But I'm not sure how it will help me.

Regards,

Varshini.

MustafaBensan
Active Contributor
0 Kudos

Hi Varshini,

Based on my testing, running two timers simultaneously works fine.  It seems there must be an issue with the reloadData() script which we need to investigate.

Regards,

Mustafa.

Former Member
0 Kudos

Thanks Mustafa. Then, as a workaround for the reloadData(), I'm going to try out the assignDatasource() and loadDatasource() combination.

Are there any other scenarios or tests that I can try to test if it really is a reloadData() script issue?

Thanks,

Varshini.

Former Member
0 Kudos

The AssignDatasource and LoadDatasource combination of scripts worked.Thanks Mustafa. The only drawback of this is that, I had done some changes on the edit Initial view of my data source. This seems to get reset. I'll have to reassign those changes.

Thanks. But does the reloadData() not work?

Thanks,

Varshini.

MustafaBensan
Active Contributor
0 Kudos

Hi Varshini,

The workaround using the AssignDataSource() and LoadDataSource() combination is intended for the case when the data source is a Universe because reloadData() is not supported for Universes up to DS 1.4, although from the DS 1.5 script content assist documentation it appears that this scenario is now supported.

However, in your case reloadData() should definitely work for a BEx data source.  I was able to successfully verify this in my test system, with two timer components as shown below:

My scripts are as follows:

"On Startup" event of Application:

TIMER_1.start();

TIMER_2.start();

"On Timer" event of TIMER_1:

myTimer1 = myTimer1 + 1;

TEXT_1.setText(myTimer1 + "");

"On Timer" event of TIMER_2:

myTimer2 = myTimer2 + 1;

TEXT_2.setText(myTimer2 + "");

DS_1.reloadData();

"On Result Set Changed" event of data source DS_1:

dataChangeCount = dataChangeCount + 1;

TEXT_3.setText(dataChangeCount + "");

myTimer1, myTimer2 and dataChangeCount are defined as Global Script Variables of type Integer.

The last script is simply to verify that the data source is in fact being reloaded (because it is not visually obvious from the Crosstab update in my case since the backend data itself is static).

So, reloadData() should definitely work in your case.  Perhaps you could reproduce the above test scenario to check the behaviour in your system?

Regards,

Mustafa.

Former Member
0 Kudos

Sure Mustafa. I'll try this out and let you know as soon as possible.

Thanks,

Varshini.

TammyPowlas
Active Contributor
0 Kudos

Varshini - I am wondering if you could use the timer referenced (not the timer SDK) in Mustafa's reply here: Design studio auto refresh every X minutes | SCN

If you are, could you include some screen shots (use camera icon) on how you are using this, similar to the screen shots Mustafa shows?