$session = Get-Property $connection "Children" @(0)
Free-Object $session
#-Begin-----------------------------------------------------------------
#-Includes------------------------------------------------------------
."$PSScriptRoot\COM.ps1"
#-Main----------------------------------------------------------------
$SapGuiAuto = Get-Object( , "SAPGUI")
If ($SapGuiAuto -isnot [__ComObject]) {
Exit
}
$application = Invoke-Method $SapGuiAuto "GetScriptingEngine"
If ($application -isnot [__ComObject]) {
Free-Object $SapGuiAuto
Exit
}
$connection = Get-Property $application "Children" @(0)
If ($connection -eq $Null) {
Free-Object $application
Free-Object $SapGuiAuto
Exit
}
$session = Get-Property $connection "Children" @(0)
If ($session -eq $Null) {
Free-Object $connection
Free-Object $application
Free-Object $SapGuiAuto
Exit
}
Throw [System.ApplicationException] "Error"
Free-Object $session
Free-Object $connection
Free-Object $application
Free-Object $SapGuiAuto
#-Error routine-------------------------------------------------------
Trap {
Free-Object $session
Free-Object $connection
Free-Object $application
Free-Object $SapGuiAuto
Exit
}
#-End-------------------------------------------------------------------
"-Begin-----------------------------------------------------------------
REPORT zsapguiscript.
DATA:
lg_result TYPE i
.
lg_result = cl_gui_frontend_services=>is_scripting_active( ).
WRITE: lg_result.
"-End-------------------------------------------------------------------
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 |