‎2025 Sep 24 4:43 PM - edited ‎2025 Sep 25 6:48 AM
Hello gentlemen,
Do you know if material proposition window (tooltip table with material description window on screenshoot) can be opened with script running?
In my case: operator enters legacy code 50907 in Material, but this code is in Material_description, he confirms it by click and then registers quantity of FG to warehouse in MFP1. I have a script that takes confirmed material number, goes to folder finds .jpg project and opens picture on second monitor to compare drawing project with physical product if it is the same and operator doesnt register something else. My problem is that with script running this window proposition do not open. When there is no legacy code, meaning input from keyboard = material code in SAP - then all is good and there is no problem.
Do you know if I can have this proposition window working in SAP with script running and how to get this? Thank you
script:
Dim SapGuiAuto, SAPApp, SAPCon, session
Dim shell, fso, drawingFolder, materialValue, drawingPath
Dim lastMaterial
Set shell = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
drawingFolder = "M:\Prod\photos\"
Set SapGuiAuto = GetObject("SAPGUI")
Set SAPApp = SapGuiAuto.GetScriptingEngine
Set SAPCon = SAPApp.Children(0)
Set session = SAPCon.Children(0)
lastMaterial = ""
Do
WScript.Sleep 50000
If session.Info.Transaction = "MFP1" Then
On Error Resume Next
materialValue = session.findById("wnd[0]/usr/subSPLITTED_SCREEN:SAPLVHUDIAL2:0053/subAREA1:SAPLVHUDIAL2:0110/tabsTABSTRIP1/tabpTAB1/ssubSUB1:SAPLVHUDIAL2:0200/ctxtPLAPPLDATA-MATNR").Text
On Error GoTo 0
If materialValue <> "" And materialValue <> lastMaterial Then
drawingPathPng = drawingFolder & materialValue & ".png"
drawingPathJpg = drawingFolder & materialValue & ".jpg"
shell.Run "taskkill /IM Photos.exe /F", 0, True
If fso.FileExists(drawingPathPng) Then
shell.Run """" & drawingPathPng & """"
ElseIf fso.FileExists(drawingPathJpg) Then
shell.Run """" & drawingPathJpg & """"
End If
lastMaterial = materialValue
WScript.Sleep 50000
End If
End If
Loop
Request clarification before answering.
Hello,
the enhanced search is not supported when using SAP GUI Scripting.
See also SAP Note 587202 - "Restrictions when using SAP GUI Scripting".
You can take over values for input fields from the modal (list based) searchhelp.
Best regards,
Frank
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.