cancel
Showing results for 
Search instead for 
Did you mean: 

Error while running AO report through macro

Former Member
0 Kudos

Hi Experts,

I am getting below error while running analysis office report through macro.

We are using AO 1.4 SP12. Our BW is on 7.31 SP8.

When I run this report without macro, its working fine. Error comes while running the same through macro. I have also attached log file for more information.(Please remove .text from that file)

Appreciate you response.

Regards,

Niket Talati

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Niket,

Does your marcro refresh the datasources in the workbook?

How have you created your connection are they directly to BW or do you use BOBJ and create the OLAP connections there?

Former Member
0 Kudos

Hi Michael,

Thanks for the response.

Yes, there are 6 clusters in the report and for each cluster the below code runs. It is in loop:

    Call Application.Run("SAPSetRefreshBehaviour", "Off")

    Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "On")

    Call Application.Run("SAPSetVariable", "ZUEMONYEAR", MMYY, "INPUT_STRING", "DS_2")

    Call Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "Off")

    Call Application.Run("SAPSetRefreshBehaviour", "On")

    Call Application.Run("SAPSetFilter", "DS_2", "ZBORIGIN__ZMCMKTCLS", ClusterCode, "INTERNAL_KEY")

I have debugged this code and got to know that, I am getting this error in line no 5. For the first cluster, I am able to get data, but when macro runs for 2nd cluster, it is giving this error in line no 5 (Loop for 6 clusters).

We have created IDT connection to BW, calling 1 BW query from it.

If you need whole code, please give me your email id, I will send you.

Thanks a lot for your help.

Regards,

Niket Talati

Former Member
0 Kudos

Hi Niket,

If you have created your connections in IDT I am assuming you store them in the BusinessObjects Platform. I do know the API does not support logging on to the BusinessObjects Platform.

Can you dire do a direct connection?

Former Member
0 Kudos

Hi Michael,

Thanks for the response. The issue is not related to login, since I am able to get data for 1 cluster. From the 2nd cluster the analysis add-in got disabled and getting this error.

Yes..I also tried with direct connection to BW platform and created a new report, but issue remains same.

Regards,

Niket Talati

Former Member
0 Kudos

Hi,

It looks like you have a lot happening in your workbook. Can backup your workbook and then try strip out everything expect your queries and the VBA to refresh as there are lots of errors in the log you attached.

The error on DS2 looks like;

Error: API Error SAPSetFilter ErrAliasCannotBeResolved: Formula alias DS_2 cannot be resolved | 2015-06-30T14:51:16 | com.sap.ip.bi.pioneer.core.exceptions.CrExceptionHelper.SetLastError() ()

Former Member
0 Kudos

Hi Niket,

is your "DS_2" coded fix into the 6 clusters?

Since you are writing about a loop I would have expected a variable name, here, where you increase the Parameter like "DS_" & i ...?!

Or is this example just for our understanding?

Best regards, Martin

Former Member
0 Kudos

Hi Martin,

Thanks for the reply.

DS_2 is our data source name for analysis for office. So we couldn't write ds_something.

If you need any more information, let me know.

Regards,

Niket Talati