You can use this API method as a generic command to execute the commands described below.
Use this command to recalculate entered planning data.
Use this command to save entered planning data.
Dim lResult As Long
lResult= Application.Run("SAPExecuteCommand", "PlanDataSave")
If you execute this command, the entered planning data is saved.
Use this command to reset planning data entered since the last save of data.
Use this command to reset planning data entered since the last successful recalculation of data.
Use this command to quit input-ready mode and switch to display mode while planning data.
Use this command to switch to input-ready mode while planning data.
Use this command to pause the execution of variables using the parameter "On". To end the pausing, use the command with parameter "Off".
When PauseVariableSubmit is in mode "On", all Analysis formulas and most of the Analysis macros will not be executed. The following macros will be executed: SAPAddMessage, SAPSetVariable, PauseVariableSubmit "Off".
Use this command to hide and show Analysis UI components for a workbook. You can use the command for the types "Ribbon", "ContextMenu" and "TaskPane".
You can hide the complete ribbon ("All") and show it again ("Default"). For the context menu, you can hide the single refresh or the complete menu and show the complete menu again. For the design panel, you can hide the Analysis and the Components tab and show the complete design panel again.
Use this command to display the prompts dialog. You can call the workbook or data source prompts dialaog. To call the dialog, the data source(s) need to be refeshed.
lResult= Application.Run("SAPExecuteCommand", "ShowPrompts", "DS_1")
If you execute this command, the prompts dialog for DS_1 is displayed. This is only possible if the variables are not merged in the workbook.
lResult= Application.Run("SAPExecuteCommand", "ShowPrompts", "ALL")
If you execute this command, the prompts dialog for all data sources in the workbook is displayed.
Use this command to initially refresh the data in the workbook. You can specify one data source or one planning object as a parameter that should be refreshed. If you do not enter a parameter or you enter the string 'ALL' as parameter, all data sources and planning objects will be refreshed. If you execute this command for a data source which is already refreshed, all corresponding crosstabs are redrawn.
Dim lResult As Long
lResult= Application.Run("SAPExecuteCommand", "Refresh", "DS_1")If you execute this command, the data for data source DS_1 is refreshed.
Dim lResult As Long
lResult= Application.Run("SAPExecuteCommand", "Refresh")
If you execute this command, the data of all data sources is refreshed.
Dim lResult As Long
lResult= Application.Run("SAPExecuteCommand", "Refresh"; "DS_1;DS_2")
If you execute this command, the data of data source DS_1 and DS_2 is refreshed.
Use this command to refresh all or defined data sources in the workbook. You can specify the data sources that should be refreshed. If you do not enter a parameter or you enter the string 'ALL' as parameter, all data sources will be refreshed. If you execute this command for a data source, the corresponding data is updated from the server and the crosstabs are redrawn.
Dim lResult As Long
lResult= Application.Run("SAPExecuteCommand", "RefreshData", "DS_1;DS_3")
If you execute this command, the data for data source DS_1 and DS_3 is refreshed from the server.
Use this command to technically restart all or defined data sources in the workbook. Technically restarting a data source has the same effect than deleting and reinserting it with keeping the current navigation state and the selected prompt values. The complete process of adding or initially refreshing a data source is executed. After the restart, new data from the database will be included in the corresponding crosstabs. Before you can restart a data source, the data source has to be initially refreshed, for example with the command Refresh. If you do not enter a parameter or you enter the string 'ALL' as parameter, all data sources will be restarted. If you want to define a set of data sources that should be restarted, you can enter them as parameter with a semicolon separated list.
Dim lResult As Long
lResult= Application.Run("SAPExecuteCommand", "Restart", "DS_1;DS_2")
If you execute this command, the data of data sources DS_1 and DS_2 is restarted.
Use this command to stop one or several data sources from redisplaying with parameter 'Off'. To reactivate the redisplaying, use the command with parameter 'On'. A data source can be set to off at any time. It can also be done in the callback Workbook_SAP_Initialize, for example. All parameters are mandatory and may not be blank.
If the command is used with parameter On, any crosstabs of the requested data sources that have pending updates, will be redisplayed automatically.
The configuration AutoRefresh of a data source is always independent of the 'Pause Refresh' of the workbook. A crosstab based on a data source is redisplayed if the workbook is not paused and the data source is not paused. The AutoRefresh value of a data source can be received with macro SAPGetProperty (SAPGetPropert y("IsAutoRefresh","DS_1").
Dim lResult As Long
lResult= Application.Run("SAPExecuteCommand", "AutoRefresh", "Off", "DS_1;DS_2")
If you execute this command, any crosstabs on top of data sources DS_1 and DS_2 are not redisplayed automatically anymore.
Use this command to register a callback. The following callbacks can be registered with SAPExecuteCommand: AfterRedisplay, BeforePlanDataSave, BeforePlanDataReset, BeforeMessageDisplay.
Use this command to unregister the callbacks listed above.
Dim lResult As Long
lResult= Application.Run("SAPExecuteCommand", "UnregisterCallback", "AfterRedisplay")
If you execute this command, the AfterRedisplay callback is unregistered.