cancel
Showing results for 
Search instead for 
Did you mean: 

AFO Workbook - Integrated Planning - avoid call of BICS_PROV_GET_RESULT_SET

Gunter_Cokl
Participant
0 Kudos
782

Hi,

I use AFO for BI IP solution. I have a SAVE Button and the macro executes following 3 steps:

1. SAVE Data

2. Planning Sequence

3. SAVE Data

After each Step BICS_PROV_GET_RESULT_SET ist called for the whole Workbook (3 Queries) - and therefore the performance is not the best.

How can I avoid e.g. the first 2 calls of BICS_PROV_GET_RESULT_SET as from my point of view it would be only necessary after the last step?

I tried to use "SAPSetRefreshBehaviour" with parameter "OFF" before 1. Step and with "ON" after 3rd step, but it had no effect.

Best regards

Gunter

former_member186338
Active Contributor
0 Kudos

It's better to provide your macro code.

View Entire Topic
Gunter_Cokl
Participant
0 Kudos

Hi, sorry, here is the macro:

******************************

Sub ART_GRP_SAVE()

Dim lResult As Long

Dim lResult1 As Variant

lResult = Application.Run("SAPSetRefreshBehaviour", "Off")

'1. Save data

lResult = Application.Run("SAPExecuteCommand", "PlanDataSave")

'2. distribute data

lResult = Application.Run("SAPExecutePlanningSequence", "PS_1")

'check if PS_1 was successful

lResult1 = Application.Run("SAPListOfMessages", "ERROR")

If IsArray(lResult1) Then

If UBound(lResult1) > 0 Then

MsgBox ("Distribution to material level ended with error (Planning Sequence PS_1)")

Exit Sub

End If

End If

'3. If step 2 successful: Save data again

lResult = Application.Run("SAPExecuteCommand", "PlanDataSave")

lResult = Application.Run("SAPSetRefreshBehaviour", "On")

End Sub

******************************

I added the "SAPSetRefreshBehaviour" command, but in RSTT I can see that BICS_PROV_GET_RESULT_SET is still executed. The only effect I can see is that BICS_PROV_GET_DATA_CELL_MASK is not executed during OFF phase.