Skip to Content
SAP Analysis for Microsoft Office

Secrets About Message Handling

Tags:

Regarding message handling inside of Analysis for Office I heard a lot of open questions and issues.


This article should help to clarify the open questions and give a possible solution for issues.
Please comment the article for anything new, I will enhance the article according to that.

General

What does “message handling” mean?

Your backend (normally BW) and Analysis for Office are able to throw messages. There are different flavors of messages:

  • - Information
  • - Warning
  • - Error
  • - Critical

If a message occurred the message window slides in.

Example for an information thrown by BW:

You are now able to click on that box to open a separate window with detailed information:

The text “RSPLS_CR-026” defines the message class (RSPLS_CR) and the message number (026).
If you open a customer incident at SAP that helps to support you faster.

Messages inside the message class “ID” are Analysis for Office messages and aren’t related to a specific backend:

Alternatively you can open the message window via “Help=>Show Messages”

Last but not least you can use the formula =SAPListOfMessages() to put the message inside the grid:

The {-brackets indicating that the result might be bigger than one row. Keep the possible overlap in mind if you plan to put grids below that formula.

VBA

Please keep in mind that this feature is not officially documented and supported!

For sure the strong Analysis for Office API also offers possibilities to handle messages.

With


' defined in ThisWorkbook
Public Sub Workbook_SAP_Initialize()

     Call Application.Run("SAPExecuteCommand", "RegisterCallback", "BeforeMessageDisplay", "Callback_BeforeMessageDisplay")

End Sub

you can define a callback.


'defined in a module
Public Sub Callback_BeforeMessageDisplay()

Dim addIn As COMAddIn

    Dim automationObject As Object

    

    Set addIn = Application.COMAddIns("SBOP.AdvancedAnalysis.Addin.1")

    Set automationObject = addIn.Object

    Set mAO = automationObject.GetApplication()

    Dim lMessageService As IMessageService

    Set lMessageService = mAO.GetMessageService()

    Dim lMessages

    lMessages = lMessageService.GetMessages()

   

    'Get the first message

    Dim m As BiApi.IMessage

    Set m = lMessages(0)

   

    'Enhance it now with your coding

    ' -insert all messages into a collection for later analysis, probably your own             message window

    ' -ignore messages because of the severity or ID

    ' -add your own message

End Sub


The information which is available via the message object:


During your custom VBA coding you also have the chance to throw your own message:

         Dim lResult As Long
         lResult= Application.Run("SAPAddMessage", "This is a new error message!", "ERROR")


Please have a look into the official Analysis for Office documentation for further information.


Please have a look into Advanced COM API via VBA - Part 1 for detailed information how to reference the BiAPI library.

Suppress Messages

Some (BW) messages you can suppress for specific Queries. For that open the transaction RSRT and enter a valid Query name:

Open the messages dialog via “Edit->Messages” or “CTRL+SHIFT+F3”:

In specific categories you can now decide if you want to suppress a message:

Q&A

“I saw a message sliding in, but after clicking on the window, the message dialog is empty”
or “New messages are deleting old messages”


That are common issues. The only solution is to implement the message handling as described above by yourself.

Former Member