473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

To connect and login SAP application automatically using VBScript

roberttonafelix
hi friends,

If it is possible to create a VB Script for auto log on in to SAP app...

I tried with the below code but it was working for the first window but it was not used for second window which currently opened...

here is the code....

Expand|Select|Wrap|Line Numbers
  1. Set sapsHShell = WScript.CreateObject("WScript.Shell")
  2.  
  3. quotes=chr(34)
  4.  
  5. sapSHShell.Run quotes & "C:\Program Files\SAP\FrontEnd\SAPgui\saplgpad.exe" & quotes ,2,false
  6.  
  7. wscript.sleep 1000
  8.  
  9. 'Note: Sap Gui Scripting activex control is called from the SAP Launch pad I believe.
  10.  
  11. Set SapGui = GetObject("SAPGUI")
  12.  
  13. Set application = SapGui.GetScriptingEngine
  14.  
  15. Set connection = application.OpenConnection("Prd", True)
  16.  
  17. wscript.sleep 1000
  18.  
  19. Set Session = application.children(0)
  20.  
  21. session.findById("wnd[0]/S_APPL_LOG").text= Username
  22.  
  23. session.findById("wnd[0]/S_APPL_LOG").text= Password
  24.  
  25. session.findById("wnd[0]").sendVKey 0
Thanks in Advance,
Robert.J
Dec 8 '12 #1
0 4780

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Scott | last post by:
Is there a way to check if a file exist using VBScript in an ASP page. So the code might go something like this: If Exists("C:\Junk\1.txt") then Do something Else Do something else End If ...
4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
1
by: omar | last post by:
im migrating from asp to asp.net. im a bit confused about form authentication in ASP.NET ... in ASP if I wanted to create a login application I would simply query the db for the username and...
0
by: csgraham74 | last post by:
Hi guys, I am writing an application in asp.net but im attempting to write some client side validation. I have most of this working but i am having trouble reading cookies set in asp.net using...
0
by: neon123 | last post by:
i am using a sql loader to load data into oracle 8. i am using vbscript to run the sql loader. i need to pass username and password entered through vbscript ,,into the visual basic application . ...
0
by: ani007 | last post by:
Hi, I need some information on how to run the applications on remote machine. Exactly what i want is , I have site , from which I shud be able to execute my automation scripts residing in...
2
by: ublow56 | last post by:
I am trying to create an ASP application using javascript. I found may ways to connect to Ms Access using VBScript, but I can't find any for the Javascript... Can someone help me??? I just need...
5
by: meenu_susi | last post by:
hi all Could you please help me out i creating folder using vbscript.. I have used the following code... <SCRIPT LANGUAGE="VBScript"> <!-- Option Explicit
5
Soniad
by: Soniad | last post by:
Hello, I want to include asp file within vbscript, this file name i am taking in variable . and when i use this variable in the include tag outside delimiters(<%%>), it does not work, <%Dim...
0
nicebasic
by: nicebasic | last post by:
I have written a program in VB that can disconnect my PC from the Internet. I have an ADSL Modem, not a Dial-Up one. Now, I need a code that can Dial a specified Connection in my Network...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.