SAP Login Issue version 7.40

use Type Into:

Forgot to mention, I logged in SAP manually with that user’s sap id & password, and identify the field on my computer.

@kiko.wei

Hello Kiko,

yes, this could be the reason. If you use SS0 it is not necessary to login. Here an explanation from SAP: “With SSO, SAP GUI users can only select the AS ABAP system to log on to from the SAP Logon Pad, without needing to interactively provide a user name and a password.”

Try the Element Exists activity, to check if the User field exists, with an If condition to handle your requirement.

Best regards
Stefan

I tried, but user still received the same error :sob:

image

1 Like

@kiko.wei

Hello Kiko,

that sounds weird. The Element Exists activity finds the user name field, but the SAP Login activity not. I don’t have the slightest idea what could be the reason of this behavior. Let us try another way to see how it looks on the different computers. Here a tiny VBScript to analyze via SAP GUI Scripting API the first level of UI elements of the SAP User Area.

'-Begin-----------------------------------------------------------------

Sub Main

  Set SapGuiAuto = GetObject("SAPGUI")
  If Not IsObject(SapGuiAuto) Then
    MsgBox "Error at GetObject"
    Exit Sub
  End If

  Set app = SapGuiAuto.GetScriptingEngine
  If Not IsObject(app) Then
    MsgBox "Error at GetScriptingEngine"
    Exit Sub
  End If

  Set connection = app.Children(0)
  If Not IsObject(connection) Then
    MsgBox "Error at Connection"
    Exit Sub
  End If

  If connection.DisabledByServer = True Then
    MsgBox "SAP GUI Scripting Disabled by Server"
    Exit Sub
  End If

  Set session = connection.Children(0)
  If Not IsObject(session) Then
    MsgBox "Error at Session"
    Exit Sub
  End If

  If session.Info.IsLowSpeedConnection = True Then
    MsgBox "LAN Low Speed Connection"
    Exit Sub
  End If

  Set UserArea = session.findById("wnd[0]/usr")
  For i = 0 To UserArea.Children.Count() - 1
    Set Child = UserArea.Children.Item(CLng(i))
    Output = Output + Child.Id + vbCrLf
  Next
  MsgBox Output

End Sub

'-Main------------------------------------------------------------------
Main

'-End-------------------------------------------------------------------

Store this VBS code into your project directory, I store it as Check.vbs.

image

Try only this on the different computers:

image

After the start of the SAP Logon and after opening the SAP session, what the SAP Logon activity does, you should see this:

image

Send us the screenshots of the different computers, yours on which it works and the other on which it does not. And please make sure that no other SAP window is open at startup.

Best regards
Stefan

Stefan, thanks for your help. Later then user found a pattern that when she also opens another SAP production system, there will be error. I am still verifying whether this is the cause. If not, I will try your script. Anyway, I will get back to you if any progress.

1 Like