Skip to Content
0
Dec 19, 2017 at 12:24 PM

Disable a button in SAP GUI with Screen personas

350 Views

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

Attachments