alex devassy
alex devassy

Reputation: 617

Read RZ11 parameter sapgui/user_scripting

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

Answers (1)

Sandra Rossi
Sandra Rossi

Reputation: 13676

When using RZ11 in my SAP version, it shows a GuiHTMLViewer object:

RZ11 display profile parameter details

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:

    RZ11 Change parameter value

    • The value can be obtained with this code:
      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: RSPARAM GuiGridView

    • The value can be obtained with this code (the first argument 0 being the first row, followed by the column name which depends on the ABAP version):
      7.56:
      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

Related Questions