0

I am writing a VBScript in VB.Net to automate some operation in SAP GUI. The script is recorded from SAP. All I need to do is to put this script under a button click event on vb.net.

I have done this far but get stuck at one point. While doing the execution of the script, SAP displays a Message Box with two buttons labelled "Redetermine" & "Cancel" and I have to Click on "Redetermine" button to make the script run further. The number of appearance of this message box is not fixed. Some times it appears twice and some times more than twice.

How can I detect the Message Box from my VB.Net application and automatically click on the "Redetermine" button if the message box appears?

Any help or advice is highly appreciated. Thanks. Verma

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
vpv
  • 920
  • 2
  • 20
  • 46
  • Why use VB.net to automate SAP actions rather than a BDC? – Bryan Cain Mar 22 '11 at 15:30
  • @Bryan Good question, however even with a BDC you'd have the same problem. Unless you know the exact circumstances that cause the pop-up the BDC will not know how to respond. – Esti Apr 11 '11 at 02:35

1 Answers1

0

In SAP, there is an option to record the steps performed in the SAP screen. Although the control id in SAP are dynamically generated, they follow a pattern. The recorded script can be executed in VB.Net as VBScript. This is way currently I am solving my purpose. But any better idea is always welcome.

vpv
  • 920
  • 2
  • 20
  • 46