Does anybody can help?
We use a macro to export the report as a pdf-file.
We loop over a lot of cost-center-nodes and export all of the nodes as pdf. Every works fine!
But we have the problem, that the initialization doesn't work correctly for us.
The first file contains sometimes the data from the last analysis.
To get this problem fixed, we loop twice about the first round. But I don't lose my abdominal pain with this solution.
Maybe one of you has same experiences and can help..
This is only a small part of coding for this question.:
Sub pdf_ablegen()
For int_i = 1 To strKnotenanzahl
'===================================================
'SAPSetRefreshBehaviour / PauseVariableSubmit => OFF
'===================================================
lResult = Application.Run("SAPSetRefreshBehaviour", "Off")
lResult = Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "On")
'set HC_DEPARTM must be empty
'============================
lResult = Application.Run("SAPSetVariable", "ZISH_0HC_DEPARTM_SEL01", "", "INPUT_STRING")
'set calmonth
'============
lResult = Application.Run("SAPSetVariable", "ZISH_0CALMONTH_INT_PF01", strZeitraum2, "INPUT_STRING")
'set node of costcenter
'======================
'000108-WK-ACHB.BWUC
lResult = Application.Run("SAPSetVariable", "ZKOSTENST_EINZEL_OPT", strKostenstellenknoten, "INPUT_STRING")
'==================================================
'SAPSetRefreshBehaviour / PauseVariableSubmit => ON
'Berichte / Queries werden geladen
'==================================================
lResult = Application.Run("SAPExecuteCommand", "PauseVariableSubmit", "Off")
lResult = Application.Run("SAPSetRefreshBehaviour", "On")
Next int_i
End Sub