Quantcast
Channel: SCN : Discussion List - Scripting Languages
Viewing all articles
Browse latest Browse all 325

VBA \ VB.NET error capturing logon manager

$
0
0

I want to make the opening and starting of my SAP Script flawless if thats possible..

 

this will login for me all good, but I want to make sure ever option has a 'error check'

 

so from the beginning,

 

-make sure the SAP program is open - 'on error resume next' has solved this for me but any other ways to do it would be awesome.

-SAPName and SAPClient is actually available for the person when they run it

-ensure scripting is enabled

-load SAP window to continue with the rest of the script

 

did i miss a variable ?

 

do i make sense?

 

i have added 'on error resume next' but when i turn off scripting to 'debug' SAP actually pops up saying its disabled,

can i check without 'hassling' SAP ?

 

 

SAPName = "04. DoH\AHO ECC PRD - PRD"

SAPClient = "400"

PAClient = "wnd[0]/usr/subSUBSCR_HEADER:/1PAPAXX/HDR_40017A:0100/txt$_DG02_400A17_DTX_P0000_STAT2"

 

If Not IsObject(App) Then

 

Set SAP = GetObject("SAPGUI")

Set App = SAP.GetScriptingEngine

 

End If

 

Set SAPConnection = App.OpenConnection(SAPName, True)

Set session    = SAPConnection.Children(0)

 

session.findById("wnd[0]/usr/txtRSYST-MANDT").Text = SAPClient

session.findById("wnd[0]/usr/txtRSYST-BNAME").Text = UserID

session.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = Password

session.findById("wnd[0]").sendVKey 0

 

 

 

sorry to pester you all...newbie .... trying to learn as i go ...


Viewing all articles
Browse latest Browse all 325

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>