"-Begin-----------------------------------------------------------------
Report zBLightExample.
"-Variables-----------------------------------------------------------
Data:
BLight Type Ref To zBackgroundLight,
Outlook Type Integer,
hResult Type Integer,
olMsg Type Integer
.
"-Main--------------------------------------------------------------
Create Object BLight.
Check BLight->BackgroundLightExists( ) = 1.
BLight->CreateObject(
Exporting
progid = 'Outlook.Application'
Importing
oleobj = Outlook
hresult = hResult
).
Check Outlook <> 0 And hResult = BLight->S_OK.
BLight->GetPropertyObject(
Exporting
oleobj = Outlook
command = 'CreateItem(0)'
Importing
object = olMsg
hresult = hResult
).
If olMsg <> 0.
BLight->SetProperty(
Exporting
oleobj = olMsg
command = 'To=''my.name@stschnell.de'''
Importing
hresult = hResult
).
BLight->SetProperty(
Exporting
oleobj = olMsg
command = 'Subject=''Test'''
Importing
hresult = hResult
).
BLight->SetProperty(
Exporting
oleobj = olMsg
command = 'Body=''This is a test'''
Importing
hresult = hResult
).
BLight->CallMethod(
Exporting
oleobj = olMsg
command = 'Display'
Importing
hresult = hResult
).
BLight->CallMethod(
Exporting
oleobj = olMsg
command = 'send'
Importing
hresult = hResult
).
BLight->CallMethod(
Exporting
oleobj = olMsg
command = 'Quit'
Importing
hresult = hResult
).
Call Method BLight->FreeObject
Exporting OLEObj = olMsg.
EndIf.
Call Method BLight->FreeObject
Exporting OLEObj = Outlook.
"-End-------------------------------------------------------------------
"-Begin-----------------------------------------------------------------
Program zBLightExample.
"-DataTypes-----------------------------------------------------------
Types BackgroundLight Type Ref To zBackgroundLight.
"-Variables-----------------------------------------------------------
Data:
BLight Type BackgroundLight,
hResult Type Integer,
WMI Type Integer,
oEnum Type Integer,
oNext Type Integer,
ExecQuery Type String,
BIOSManufacturer Type String,
BIOSName Type String,
BIOSVersion Type String,
Text Type String,
Button Type i
.
"-Main----------------------------------------------------------------
Create Object BLight.
Check BLight->BackgroundLightExists( ) = 1.
Call Method BLight->GetObject
Exporting ProgID = 'winmgmts:\\.\root\CIMV2'
Importing OLEObj = WMI hResult = hResult.
Check WMI <> 0 And hResult = BLight->S_OK.
ExecQuery = 'ExecQuery(''Select * from Win32_BIOS''' &&
', ''WQL'', 48)'.
Call Method BLight->CreateEnumeration
Exporting OLEObj = WMI Command = ExecQuery
Importing EnumObj = oEnum hResult = hResult.
If oEnum <> 0 And hResult = BLight->S_OK.
Call Method BLight->GetNextEnumerationObject
Exporting EnumObj = oEnum
Importing NextObject = oNext hResult = hResult.
While oNext <> 0.
Call Method BLight->GetPropertyString
Exporting OLEObj = oNext Command = 'Manufacturer'
Importing String = BIOSManufacturer hResult = hResult.
Call Method BLight->GetPropertyString
Exporting OLEObj = oNext Command = 'Name'
Importing String = BIOSName hResult = hResult.
Call Method BLight->GetPropertyString
Exporting OLEObj = oNext Command = 'Version'
Importing String = BIOSVersion hResult = hResult.
Text = `Manufacturer: ` && BIOSManufacturer &&
CL_ABAP_CHAR_UTILITIES=>CR_LF &&
`Name: ` && BIOSName &&
CL_ABAP_CHAR_UTILITIES=>CR_LF &&
`Version: ` && BIOSVersion.
Call Method BLight->MsgBox
Exporting
Text = Text
Caption = 'Information about BIOS'
Style = BLight->MB_OKOnly
Importing
Button = Button.
Call Method BLight->FreeEnumeration
Exporting EnumObj = oNext.
Call Method BLight->GetNextEnumerationObject
Exporting EnumObj = oEnum
Importing NextObject = oNext hResult = hResult.
EndWhile.
Call Method BLight->FreeEnumeration
Exporting EnumObj = oEnum.
EndIf.
Call Method BLight->FreeObject
Exporting OLEObj = WMI.
"-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 |
---|---|
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |