SAP — Select tab
SAP — Select tab
Section titled “SAP — Select tab”Type: sap-select-tab · Package: SAP Activities v1.0.5
Switches tabs on an SAP screen that organizes its fields in tabs, such as the data tabs of a master record or a document. Use it before reading or writing fields that live on a tab other than the open one.
How it works
Section titled “How it works”Waits for SAP to finish whatever it is processing, finds the tab by its selector, selects it and waits for SAP to load its content.
Switching tabs usually means a round trip to the server, so afterwards it reads the status bar: if SAP answers with an error (type E) or an abort (type A), the activity fails with that message; any other message is logged.
If the tab is not on the screen yet, the activity waits for it up to the configured limit (timeout or the scope’s elementTimeout, 30 seconds by default).
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
selector | selector | — | The tab to open. Captured selector or SAP id, for example wnd[0]/usr/tabsTABSTRIP/tabpTAB02. |
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. |
timeout | number | — | Seconds to wait for the tab to appear. Overrides the scope’s elementTimeout. Empty uses the scope value (30 by default); 0 fails on the first try. Decimals allowed. |
Output
Section titled “Output”This activity does not return a value.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
Component '…' does not exist in the SAP session. Waited … s for it to appear. The current screen is … dynpro … (transaction …). … | The element did not appear in time. The message says which screen the session is on: it is almost always a different one than expected (a dialog in front, a step that didn’t happen). If the screen is slow, raise timeout. |
SAP replied [E …]: … | After the action, SAP showed an error (E) or an abort (A) in the status bar. The text is SAP’s. |
Plus the errors common to all activities.
Example
Section titled “Example”SAP — Select tab selector = "wnd[0]/usr/tabsTABSTRIP/tabpTAB02"SAP — Get text selector = "wnd[0]/usr/tabsTABSTRIP/tabpTAB02/ssubSUB:ZPROG:0200/txtCAMPO1" → output: valueRelated activities
Section titled “Related activities”- SAP — Get text — read a field on the tab.
- SAP — Set text — write into a field on the tab.
- SAP — Wait for element — wait for a specific element to appear.