Handling errors in SAP GUI Scripting code


You can take reference from GUI Scripting help section and it can explain things in detail.

It provides you default property types as per requirement. If you want to perform next step, stop or abort user step, you can use the following properties.


ValueDescription
SSuccess
WWarning
EError
A Abort
 I  Information


See the below code that uses above property type to display different messages −

Public Sub get_status_bar_value_exit_if_Error()
   Dim usr_resp AsString
   If(session.findById("wnd[0]/sbar").messagetype = "E"Or
      session.findById("wnd[0]/sbar").messagetype= "W") Then
   usr_resp =MsgBox(session.findById("wnd[0]/sbar").Text & Chr(13) &"Show the Error in SAP ?",
vbYesNo)
    If usr_resp =vbYes Then
 Else
    Callgo_to_Sap_home
 End If
 End
 End If
End Sub


Updated on: 12-Jun-2020

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements