on ‎2023 Jan 31 11:02 PM
screenshot-2023-01-31-165810.png
screenshot-2023-01-31-165902.png
stefan.schnell or anyone help me figure out how to store text within an element in the SAP Logon 770 GUI? I tried using the recording function to capture the element and then doing the .text at the end, but I keep getting errors every time.
This is the code below with the two elements I am trying to grab text from. I am able to click on the elements but not store their texts. Am I doing this correctly? If so please let me know the correction. I have also attached two images of the two elements I am trying to store the text for.
storage_bin_1 = session.findById("wnd[0]/usr/shell/shellcont[1]/shell/shellcont[0]/shell").text
storage_bin_2 = session.findById("wnd[0]/usr/ctxt/SCWM/LAGP-LGPLA").text
print(storage_bin_1)
print(storage_bin_2)
Request clarification before answering.
Hello epona1453,
welcome in the SAP Community.
Your approach to store storage_bin_2 is correct. Here an example with WSH. Whether Python or WSH is used here makes no difference. The use of the SAP GUI Scripting API is independent of the programming language.

To read a cell from a grid you need the column name. You can see an example below how to detect it (line 6 and with the index of Columns you can detect the name, line 11).
With that column name you can read the content of a cell with GetCellValue method (line 15).

You can see in the last line of the console the result AA of the selected line in the grid.
Best regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.