Jump to content

SAP + Auto IT


Go to solution Solved by sagarphirke,

Recommended Posts

Hello Experts ;

I just got introduced to Auto It.

I wanted to create a simple automation script which will login to SAP and Open a Transaction Code.

But I got stuck.Can anyone suggest how the SAP can be invoked with Auto IT ?

Below is the script I have written so faar :-

; Start SAP
Run("C:Program FilessapFrontEndSAPguisapgui.exe /H <my SAP Host and server no> ")
 
; Wait until SAP is open
WinWaitActive ("SAP Logon 720", 1 )
Send(" sagarp" TAB "PWD")  
Send
 
With this script it is able to open the SAP log-in screen but the userid (sagarp) and pasword (PWD) is not getting entered.
 
I think the SAP screen got opened because it standard windows command but it is not able to sense SAP screen.
 
 
I have maintained all the setting in SAP as mentioned in the other post (SAP GUI Scripting interface is enabled )
 
Pls help me and guide what is missed by me ?
 
regards;
Sagar
 
 
Link to comment
Share on other sites

Hi Dabble;

I tried control send but did not worked  :ermm:

From Auto Info tool i get below info but not much usefull.

Basic Window Info :-

Class : SAP_FRONTEND_SESSION

 

 

Hi sagarphirke,

use the window info tool Au3Info to get more info on your SAP window and then use control send to enter your credentials.
 

Link to comment
Share on other sites

The problem with your above script is that the script does not know where the cusrsor is at the time of SEND

Not very stable. But if you do it this way you will have to test and find how many times you have to send TAB after window is focused and active to get the cusrsor in the the first input field...maybe one, maybe none.

Then you can sand username  - TAB - Send Password

Link to comment
Share on other sites

Maybe this is useful -> '?do=embed' frameborder='0' data-embedContent>> or '?do=embed' frameborder='0' data-embedContent>>

 

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

/hi;

I tried to just send the USERID.

But the same is also not sent to the userid field.

Some how the autoit is not sensing the SAP screen.

Does anything needs to be done additional to the script 

 

The problem with your above script is that the script does not know where the cusrsor is at the time of SEND

Not very stable. But if you do it this way you will have to test and find how many times you have to send TAB after window is focused and active to get the cusrsor in the the first input field...maybe one, maybe none.

Then you can sand username  - TAB - Send Password

Link to comment
Share on other sites

Yes. Plenty..

 as mentioned before you will have to find out:

Is WinWaitActive actually waiting ?  put a sleep in there to test

After and only after the window is active and focuses can you begin to interact with it with the send command

Send TAB with sleeps so you can see where the cursor is and when.

And Then you can start to send your ID and PW....

Lot s of playing and testing..... :graduated:

Link to comment
Share on other sites

For this to work the cursor has to be blinking in the ID input box...

; Start SAP
Run("C:\Program Files\sap\FrontEnd\SAPgui\sapgui.exe /H <my SAP Host and server no> ")

; Wait until SAP is open
WinWaitActive ("SAP Logon 720", 4)
Send("sagarp")
Send("{TAB}")
Send("password")

Probably followed by a Send ENTER or something.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...