Skip to content

SAP — Read status bar

Type: sap-read-status-bar  ·  Package: SAP Activities v1.0.5  ·  Output: Dictionary<string,object>

Reads SAP’s status bar, the bottom line of the window where SAP tells you what happened with the last action: “Document 4500000123 saved”, “No table entries found for specified key”, a validation error. It is the way for your flow to react to SAP’s answer, for example to record the number of a document just created or to skip a case with no data.

It reads the message currently on the main window’s status bar (wnd[0]/sbar) and returns its type and text. It doesn’t wait or perform any action: read it right after the activity whose result you want to know. If there is no message, the type and text come back empty.

SAP message types are:

TypeMeaning
SSuccess (or informational; careful, some empty results arrive with this type)
WWarning
EError
AAbort
IInformation

None.

ParameterTypeDefaultDescription
sessionZoanSapSession—SAP session. Omit it inside the body of an SAP — Attach or SAP — Log on.

Returns a dictionary with three keys:

KeyTypeContent
typestringMessage type: S, W, E, A, I, or empty.
textstringMessage text.
isErrorbooleantrue if the type is E or A.

If there is no message (or the main window has no status bar), type and text come back as "" and isError as false. Only the message type and code go to the log, never its text, because the status bar often repeats business data.

Reading the bar doesn’t fail even when it is empty. It can only fail with the errors common to all activities, such as a missing session.

Skip the export when the query returns no data:

SAP Press Toolbar Button selector = "wnd[0]/tbar[1]/btn[8]"
SAP Read Status Bar → output: status
If condition = str(status["text"]).Contains("No table entries")
├─ then:
│ Log level = warning message = "The query returned no records"
└─ else:
SAP Export List path = "C:\output\" fileName = "t000.txt"