Skip to end of metadata
Go to start of metadata

Planning Objects and VBA macro in AO

  • SAPExecutePlanningSequence implicitly refreshes the planning sequence
  • A SAPSetPlanParameter call requires the planning object to be refreshed, so that the parameter values can take effect
  • Therefor to make SAPSetPlanParameter work:
    either: call Application.Run("SAPExecuteCommand", "Refresh", <alias>) before the first SAPSetPlanParameter call
    or: set on the Components tab > workbook > Planning -> "Refresh Planning Objects on Refresh All"
  • In general, for troubleshooting:  assigned the return value of SAPSetPlanParameter to a variable lResult 
    If the variable has value 0, it means execution failed. With SAPGetProperty LastError, the root cause could be found out. For example, it gets error number 31 "31 The specified data source is invalid. The alias may be wrong or the data source is not yet refreshed."  Read more about LastError.
  • The behavior of  SAPSetPlanParameter is the same as SAPSetVariable for query variables.

Process Chain of Planning Sequence Triggered in AO

If a Process Chain that executes a Planning Sequence is triggered in a Fox formula planning function called in AO, the process chain must run in batch mode.  Process chain run in synchronize mode in the AO session is not supported. 

  • No labels