Skip to Content
0

Disable a button in SAP GUI with Screen personas

Dec 19, 2017 at 12:24 PM

90

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Tamas Hoznek
Jan 07 at 02:14 AM
0

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?

Share
10 |10000 characters needed characters left characters exceeded