Hello,Â
Currently trying to automate line selection in ME22N. This doesn’t appear to be possible, outside of a VB Script running SAP. This isn’t ideal, so I wanted to see if this community had any other items?Â
Â
Â
Hello,Â
Currently trying to automate line selection in ME22N. This doesn’t appear to be possible, outside of a VB Script running SAP. This isn’t ideal, so I wanted to see if this community had any other items?Â
Â
Â
Hi ​
Please explain the issue that you are facing along with your use case that you are trying to automate for a better understanding.
​
Hello, the SAP script path I’m trying to click does not store the line row number. For this reason the SAP select item package doesn’t work. I have tried using various actions in the SAP action package. I am using this script. But the control ID is not consistently found.Â
Â
Function SelectRow(rowNumber)
  On Error Resume Next ' Enable error handling  If Not IsObject(application) Then
    Set SapGuiAuto  = GetObject("SAPGUI")
    Set application = SapGuiAuto.GetScriptingEngine
  End If  If Not IsObject(connection) Then
    Set connection = application.Children(0)
  End If  If Not IsObject(session) Then
    Set session   = connection.Children(0)
  End If  If IsObject(WScript) Then
    WScript.ConnectObject session, "on"
    WScript.ConnectObject application, "on"
  End If  session.findById("wnd"0]").maximize
  ' Ensure rowNumber is set and valid
  If IsNumeric(rowNumber) And rowNumber <> "" Then
    Dim tablePath
    tablePath = "wnd<0]/usr/subSUB0:SAPLMEGUI:0020/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211"
    Â
    ' Check if the first path exists
    If Not session.findById(tablePath, False) Is Nothing Then
      session.findById(tablePath).getAbsoluteRow(CInt(rowNumber)).selected = true
      session.findById(tablePath & "/btnMEPO1211-STATUSICONe0,8]").setFocus
    Else
      ' Use the alternative path
      tablePath = "wndÂ0]/usr/subSUB0:SAPLMEGUI:0015/subSUB2:SAPLMEVIEWS:1100/subSUB2:SAPLMEVIEWS:1200/subSUB1:SAPLMEGUI:1211/tblSAPLMEGUITC_1211"
      session.findById(tablePath).getAbsoluteRow(CInt(rowNumber)).selected = true
      session.findById(tablePath & "/btnMEPO1211-STATUSICONe0,8]").setFocus
    End If
  Else
    MsgBox "Invalid row number: " & rowNumber
  End If  If Err.Number <> 0 Then
    ' Log the error or handle it as needed
    MsgBox "An error occurred: " & Err.Description
    Err.Clear ' Clear the error
  End If
  On Error GoTo 0 ' Disable error handling
End Function
​
​
The recorder is not an option. It doesn’t have visibility into the SAP table at all.
Hi ​
In SAP if you are not able to use recorder: capture action then please check if the GUI scripting option is enabled within your SAP Logon.
Â
To enable SAP script recording and playback, you need to access your SAP GUI settings and activate the "Script Recording and Playback" feature, which can be found under "Customize Local Layout" in the SAP Logon window.
Â
Please ensure the "Scripting" option is enabled within your SAP client settings to allow recording and playback of actions within the SAP interface.
Hi ​
Â
Â
Flow looks like this:
Â
​
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.