Reputation: 617
I am trying to use SAP GUI Scripting to read "current value" set for parameter "sapgui/user_scripting" via t-code RZ11. I can connect to SAP instance, login and execute RZ11 with my script. But I can't read the current value set for "sapgui/user_scripting" and print to console.
self.session.findById("wnd[0]/tbar[0]/okcd").text = "rz11"
self.session.findById("wnd[0]").sendVKey(0)
time.sleep(2)
self.session.findById("wnd[0]/usr/ctxtTPFYSTRUCT-NAME").text = "sapgui/user_scripting"
value = self.session.findById("wnd[0]/usr/ctxtTPFYSTRUCT-TYPE").text
print(value)
I am using above code. But the output in console is "sapgui/user_scripting". I need the output to be "TRUE". Please help
Upvotes: 1
Views: 884
Reputation: 13676
When using RZ11
in my SAP version, it shows a GuiHTMLViewer object:
It's a little bit difficult to read data from the HTML control. It can be complex also because there are 2 types of HTML controls depending on SAP GUI settings.
I recommend to find a workaround to display the value via a GUI object other than GuiHTMLViewer, like:
clicking the button Change Value
:
self.session.findById("wnd[1]/usr/txtNEW_PARVALUE").text
or run the program RSPARAM
(using SA38
or SE38
) to display values in GuiGridView control ; use the filter button in order to display only one line:
self.session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").getCellValue(0,"USER_VALUE")
7.52:
self.session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell").getCellValue(0,"PAR_USER_WERT")
For more information, see the API documentation at https://community.sap.com/topics/gui/scripting.
Upvotes: 3