on 03-25-2020 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.
Hello rainmankim,
let us know how your alternative path by downloading and reading the data.
Thanks and 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.
Hi stefan.schnell , I know this thread is a bit old but I thought i try... I have an SAP transaction that generates a list (BoM) unfortunately there's no option to download/save the data except with ctrl+y mark text then copy/paste... my challenge now is i'm trying to automate some data retrieval using SAP scripting and the script doesn't capture this ctrl+y... any suggestions?
Note: i tried list> save (option is greyed out).. i also tried right click to save table to spreadsheet (option doesn't exist).
Thanks a lot!!
BR/Wissam
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.