Skip to Content

Disable a button in SAP GUI with Screen personas

Hello Community,

i want to disabled a button with an if cause. The code work well in the browser, but not in the SAP GUI.

Where is the failure?

Must I change anything in the settings of Personas?

regards,

Sebastian

var Aufart = session.findById("wnd[0]/usr/subSCREEN_1:SAPLIQS0:1050/subNOTIF_TYPE:SAPLIQS0:1052/cmbRIWO00-QMARTE").text;
session.utils.log(Aufart);

if    (Aufart === "Y9" && session.info.user === "SPREITZERM")
    {
        session.findById("wnd[0]/tbar[1]/btn[13]").enabled=true;
        session.findById("wnd[0]/usr/subSCREEN_1:SAPLIQS0:1050/btnANWENDERSTATUS").enabled = true;
    }
else if (Aufart === "Y9")
    {
        session.findById("wnd[0]/tbar[1]/btn[13]").enabled=false;
        session.findById("wnd[0]/usr/subSCREEN_1:SAPLIQS0:1050/btnANWENDERSTATUS").enabled = false;
    }

else {
    session.findById("wnd[0]/tbar[1]/btn[13]").enabled=true;
    session.findById("wnd[0]/usr/subSCREEN_1:SAPLIQS0:1050/btnANWENDERSTATUS").enabled = true;
    
}

Screenshot Gui Browser: screenshot-browser.png

Screenshot SAP GUI: screenshot-sap-gui.png

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 07 at 02:14 AM

    Depends on your installed version and patch level of the SAP GUI.

    It's possible that this is a bug in the Personas implementation of SAP GUI, if you are using the latest. If so, create an incident for component BC-FES-GUI.

    You could also try to hide the button... does that work?

    Add comment
    10|10000 characters needed characters exceeded