When creating test scenarios, you may often need to capture a document number (such as a Sales Order or Material Document) from the SAP Status Bar message and reuse it in the next step of the process.
PerfecTwin provides a convenient StatusBar Step that allows you to extract only the value you need and store it directly into a Variable with minimal setup.
🧭Method
To extract a value from the Status Bar, you can follow these simple steps:
Add a StatusBar Step to your unit.
Place this step right after the screen where the Status Bar message appears.
(If the step is added before the message is displayed, the value cannot be captured.)
For example, suppose the following message appears in the Status Bar:
Standard Order 8576 has been saved.
If you would like to extract only the order number 8576, configure the step as follows:
Extraction Target: Select Status Bar
Extraction Range: Select Pattern
Pattern: Enter the entire message exactly as shown
⚠️ Please make sure the pattern matches the message exactly, including spaces and punctuation.
Then, wrap the number you want to extract with {}:
Standard Order {8576} has been saved.
Next, choose the Variable where this value should be stored.
With this setup, 8576 will be automatically extracted and saved into the selected Variable.
📍Important Note
Everything in the pattern must be identical to the actual Status Bar message except for the part wrapped in {}.
If there is even a small difference in spelling, spacing, or punctuation outside of {}, the extraction will fail.
With the pattern as below, the number from the second message will not be extracted because the message text is different (Return Order vs. Standard Order).
Pattern:
Standard Order {8576} has been saved.Message 1:
Standard Order 8577 has been saved.--> ⭕Message 2:
Return Order 8578 has been saved.--> ❌
A single StatusBar Step can extract one value at a time.
For instance, if the message is:
Standard Order 8576 has been saved, and Material Document 500001334 has been saved.
It is not possible to extract both numbers in one step like this:
Standard Order {8576} has been saved, and Material Document {500001334} has been saved.
--> ❌
❓When the Message Pattern Is More Complex
If the Status Bar message does not follow a simple pattern and {} alone is not enough to extract the value, you can use a Script Step to apply JavaScript logic for more flexible extraction.
Please refer to the Script Step manual for more details.
Comments
0 comments
Please sign in to leave a comment.