![]() |
VOOZH | about |
The CData Cmdlets for SAP BusinessObjects BI are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to SAP BusinessObjects BI.
The Cmdlets are not only a PowerShell interface to SAP BusinessObjects BI, but also an SQL interface; this tutorial shows how to use both to retrieve SAP BusinessObjects BI data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for SAP BusinessObjects BI. To access SAP BusinessObjects BI data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for SAP BusinessObjects BI.
Once you have acquired the necessary connection properties, accessing SAP BusinessObjects BI data in PowerShell can be enabled in three steps.
To connect to your SAP Business Objects BI instance, you must set the following connection properties:
Install the module:
Install-Module SAPBusinessObjectsBICmdlets
Connect:
$sapbusinessobjectsbi = Connect-SAPBusinessObjectsBI -User "$User" -Password "$Password" -Url "$Url"
Search for and retrieve data:
$state = "CA" $mycustomreport = Select-SAPBusinessObjectsBI -Connection $sapbusinessobjectsbi -Table "MyCustomReport" -Where "State = `'$State`'" $mycustomreport
You can also use the Invoke-SAPBusinessObjectsBI cmdlet to execute SQL commands:
$mycustomreport = Invoke-SAPBusinessObjectsBI -Connection $sapbusinessobjectsbi -Query 'SELECT * FROM MyCustomReport WHERE State = @State' -Params @{'@State'='CA'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for SAP BusinessObjects BI\lib\System.Data.CData.SAPBusinessObjectsBI.dll")
Connect to SAP BusinessObjects BI:
$conn= New-Object System.Data.CData.SAPBusinessObjectsBI.SAPBusinessObjectsBIConnection("User=username;Password=password;Url=http://myinstance:6405/biprws")
$conn.Open()
Instantiate the SAPBusinessObjectsBIDataAdapter, execute an SQL query, and output the results:
$sql="SELECT StoreName, TotalRevenue from MyCustomReport"
$da= New-Object System.Data.CData.SAPBusinessObjectsBI.SAPBusinessObjectsBIDataAdapter($sql, $conn)
$dt= New-Object System.Data.DataTable
$da.Fill($dt)
$dt.Rows | foreach {
Write-Host $_.storename $_.totalrevenue
}
Download a free trial of the SAP BusinessObjects BI Data Provider to get started:
Download NowLearn more:
👁 SAP BusinessObjects BI IconRapidly create and deploy powerful .NET applications that integrate with SAP BusinessObjects BI.