Skip to content

SAP — Select from dropdown

Type: sap-select-combo  ·  Package: SAP Activities v1.0.5

Selects an entry in an SAP dropdown list. The entry is given by its key, not by the text shown on screen.

Waits for SAP to finish whatever it is processing, finds the dropdown by its selector and selects the entry whose key matches key.

Why the key and not the text? Because the visible text changes with the language used to log on to SAP: a playbook that picked “Standard PO” would stop working when the robot logs on in Spanish. The key (for example NB or 02) is the same in every language.

If the dropdown 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).

ParameterTypeDefaultDescription
selectorselector—The dropdown. Captured selector or SAP id, for example wnd[0]/usr/cmbP_TIPO.
keystring—Key of the entry (for example "02"). Not the visible text, which changes with the session language.
ParameterTypeDefaultDescription
sessionZoanSapSession—SAP session. Omit it inside the body of an SAP — Attach or SAP — Log on.
timeoutnumber—Seconds to wait for the dropdown to appear. Overrides the scope’s elementTimeout. Empty uses the scope value (30 by default); 0 fails on the first try. Decimals allowed.

This activity does not return a value.

MessageCause 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 GUI error when setting the keyThe dropdown has no entry with that key. Check the key (not the visible text) and whether the entry depends on another field on the screen.

Plus the errors common to all activities.

SAP — Run transaction code = "ZREPORTE01"
SAP — Select from dropdown selector = "wnd[0]/usr/cmbP_TIPO" key = "02"
SAP — Send key key = F8