2024 Jun 24 12:13 PM
Hi,
When a command is send to SAP like "SAPsession.FindById("wnd[0]").resizeWorkingPane(170, 25, False)" and an error occurs I'd like to log the error and let the script continue after user input (if needed) to fix the error. Next I want to use the Log to examine the errors and fix them.
I was thinking to do this via an additional sub that handles the sap command and catches the error like this:
****************************************************************
Private sub resize() 'SAPCommand to be executed
SAPCommand(SAPsession.FindById("wnd[0]").resizeWorkingPane(170, 25, False))
SAPCommand(SAPsession.FindById("wnd[0]/tbar[0]/okcd").text = "/nsu3")
SAPCommand(SAPsession.FindById("wnd[0]").sendVKey(0))
End Sub
Private sub SAPCommand(input) '//SAPCommand to be executed
try
Run SAPCommand
Catch ex as Exception
Log("Error for: " & input & vbCRLF & ex.tostring)
msgbox("Fix the error for command: " & input)
end try
end sub
****************************************************************
I know the above code does not workout at all but it's just for illustration of what I'd like to accomplish.
Thanks!
2024 Jun 25 9:51 AM
Hi Paul!
I think your question doesn't relate to SAP Emarsys Scripting Language (ESL). ESL is used for creating dynamic personalized content in marketing campaigns in Emarsys. Please double check the Tags and assign the relevant one so that an other subject matter expert can help you with an answer.
Thank you!
2024 Jun 25 11:46 AM
Thanks, I'll have a look!