Automating in SAP: How to select an entry in a drop-down list based on a partial string?

Hi experts,

I’m trying to automate the creation of transactions in SAP and faced some issues. Here is some background and the issue faced:

  • An Excel spreadsheet is used as the data source.

  • Users will typically maintained certain fields in the spreadsheet for SAP import in numeric form, e.g. “1001” for, say, a certain customer grouping type, without the full description, say, “Local Customers”

  • While doing the automation in SAP, some fields cannot be Typed Into, and instead the entry must be selected via a drop-down (using F4).

  • A drop-down list would typically show the concatenation of the code (e.g., “1001”) and the description (“Local Customers”) so the scrapped text from a drop-down box may look like this after scrapping:

    1001 Local Customers
    1002 Overseas Customers
    1003 One-Time Customers
    1004 VIP Customers

  • The problem is, the field in the spreadsheet would be maintained as “1001”, but I won’t be able to use Click Text to select “1001”.

Does anyone here have any suggestions what can be done (elegantly, hopefully) to automate this part?

Thanks in advance!

You can try with Regex:
First Scrap the data from the drop down
1001 Local Customers
1002 Overseas Customers
1003 One-Time Customers
1004 VIP Customers

Save it a variable say fulloutput

then use if condition to check fulloutput.contains(“yourexcelword”)
if contains
then you Match activity and use reqex function to get the whole word
else throw the Bussiness exception
Then use the Type into actiivty

hope it helps :slight_smile:

You an try clicking the drop down and then click text and give ‘1001’ in click text and it will click on 1001 Local Customer,

This wold be simple to solve the issue, correct me if I am wrong anywhere,

Pavan H

Hi guys,

Thanks for the suggestions. Turns out that both suggestions can’t work in quirky SAP.

Eventually, I found a solution:

  1. Tab to the field
  2. Input the required code, e.g. “1001” and hit enter, and tab to proceed to the next field.

It is just how SAP works!

Anyhow, appreciate your suggestions!


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.