cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic refresh of queries into workbook

Former Member
0 Kudos

Dear SAP fans,

I am using a workbook with 2 BEX queries and some VBA coding for each "onRefresh".

I set both queries to "refresh query when opening the workbook" so that my workbook is automatically updated when I open it.

Unfortunately the "system" automatically refreshes the queries in the "wrong" order. Therefore my result in incomplete...

Any idea to refresh the queries in the right order?

Alternatively, I was thinking to refresh the second query via VBA coding, but I can't get it right...

Thanks in advance for your help!!

Kind regards

Julien

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi both,

Thanks a lot for your great answer:

S.Sankaran,

I saw the same behaviour, but was not quite sure it will be the rule...

This solution does work!

However I would be happy to use Sebastian solution, which sounds cleaner and more flexible...

Unfortunately I do not manage to make it work: I do not manage to get the option definition..

Seastian,

Could you help me to open the object katalog of the sapbex.xla?

Thanks again both of you!

Julien

Former Member
0 Kudos

Hi Julien,

opening the object katalog is pretty easy, you just have to start the Bex Analyzer then press alt+F11 ( for opening the Visual Basic editor ) then mark "SAPBEX(sapbex.xla)" and press F2 ( to open the object katalog).

So thats it, now you can see all function that included in sapbex.xla.

Kind regards

Sebastian

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks you again!

Easy indeed... But it open a wild range of possibility for me!

I manage to refresh my query:

Run "sapbex.xla!SAPBEXrefresh", False, Sheets(X).Cells(Y,Z)

Since definition is as below:

'Function SAPBEXrefresh(allQueries As Boolean, [atCell As Range], [iShowScreen As Boolean]) As Integer

An now I know were to look for other functions...

Thanks again

Former Member
0 Kudos

Hi,

The order in which u add the queries in the workbook, the reverse order it will be refreshed.

so remove the queries from the workbook and add in such a way that that the query to be refreshed first to be added at last.

The last added query will be refreshed first.

thanks ,

S.Sankaran

Edited by: Sankaran Shanmugam on Jan 29, 2008 5:11 PM

Former Member
0 Kudos

Hi Julien,

you can try to refresh it with the VBA function SapBexrefresh

 Run "sapbex.xla!SAPBEXrefresh", True 

"True" is the Option for refresh all queries but I guess there is also one option where you can put the Query name .

( For more Information that a look into the obejct katalog of the sapbex.xla )

hope this helps

Sebastian