SAP — Read status bar
SAP — Read status bar
Section titled “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.
How it works
Section titled “How it works”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:
| Type | Meaning |
|---|---|
S | Success (or informational; careful, some empty results arrive with this type) |
W | Warning |
E | Error |
A | Abort |
I | Information |
Required parameters
Section titled “Required parameters”None.
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanSapSession | — | SAP session. Omit it inside the body of an SAP — Attach or SAP — Log on. |
Output
Section titled “Output”Returns a dictionary with three keys:
| Key | Type | Content |
|---|---|---|
type | string | Message type: S, W, E, A, I, or empty. |
text | string | Message text. |
isError | boolean | true 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.
Common errors
Section titled “Common errors”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.
Example
Section titled “Example”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: statusIf 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"Related activities
Section titled “Related activities”- SAP — Press button and SAP — Press toolbar button — already fail on their own on an
EorAerror. - SAP — Run transaction — checks by itself that the transaction opened.
- SAP — Get text — read any other text on the screen.