on 2020 Mar 25 8:53 AM
I am using Python to automate an SAP Logon process by modifying recorded script.
But I have run into a problem. I do not know how to extract the text data I find on SAP.
One process that I am doing is to extract information from Inbox line-by-line.
How can I capture the text using scripting? (Info record, vendor, material, etc)
I tried to record most steps but I have no idea how to capture the .text field.
The record does not pinpoint to that section.
session.findById("wnd[0]").resizeWorkingPane(184, 30, 0) session.findById("wnd[0]/tbar[1]/btn[36]").press() session.findById("wnd[0]/usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[0]/shell").selectedNode = " 2" # Selects Inbox
session.findById("wnd[0]/usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell").selectedRows = "0" # Selects First Row
session.findById("wnd[0]/usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell").selectionChanged()
print(session.findById("wnd[0]/usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell").text) # This thing prints "SAPGUI.GridViewCtrl.1"......
session.findById("wnd[0]/usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[0]/shell").pressToolbarButton("DISP")
session.findById("wnd[0]/usr/tabsSO33_TAB1/tabpTAB1").select()
print(session.findById("wnd[0]/usr/tabsSO33_TAB1/tabpTAB1").text)
# This thing prints "Doc. contents" ......I need to get (Info record, vendor, material, etc)
If you look at SAP_Capture_3.png photo, I have identified the shell. But I cannot get the text data of it...
print(session.findByID("wnd[0]/usr/cntlSINWP_CONTAINER/shellcont/shell/shellcont[1]/shell/shellcont[1]/shell").text)
Above code only gives me "SAP.HTMLControl.1"...........I want the contents.
Help me please.
Request clarification before answering.
Dear stefan.schnell,
Thank you for your reply.
I have taken an alternative path by downloading and reading the data.
I will try the html method you suggested in future.
Thank you sir.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 4 | |
| 3 | |
| 3 | |
| 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.