Skip to Content
0
Former Member
Nov 16, 2006 at 12:42 PM

Gui Scripting logon problem

266 Views

Hi, All!

I'm trying to use GUI Scripting API to automate some tasks. I use Delphi with imported SAPFEWSELib_TLB Library.

I need to open new connection to SAP system and execute a transaction. I wrote the code like this:

var

appGui: GuiApplication;

sapConnection : GuiConnection;

sapCurrentSession : GuiSession;

1: sapConnection := appGui.OpenConnectionByConnectionString('/H/10.47.200.103/S/3201', 1, 0);

2: sapCurrentSession := sapConnection.Sessions.ElementAt(0) as GuiSession;

3: sapCurrentSession.StartTransaction('fo33');

OpenConnectionByConnectionString method creates GUI window and promts for Logon and Password input from user. Line 2 and 3 proceed immediately after line 1 and this do not depends on the fact of the successfull log on.

How can I make this code to wait until End User enters Logon and Password and process line 2 and 3 only after successfull log on?

Thanks in advance!!

Aleh Pratasenia