Ready to get started?

Download a free trial of the SAP Ariba Procurement Data Provider to get started:

 Download Now

Learn more:

SAP Ariba Procurement Icon SAP Ariba Procurement ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with SAP Ariba Procurement.

Connect to SAP Ariba Procurement Data from PowerBuilder



This article demonstrates how to access SAP Ariba Procurement data from Appeon PowerBuilder using the CData ADO.NET Provider for SAP Ariba Procurement.

This article demonstrates using the CData ADO.NET Provider for SAP Ariba Procurement in PowerBuilder, showcasing the ease of use and compatibility of these standards-based controls across various platforms and development technologies that support Microsoft .NET, including Appeon PowerBuilder.

This article shows how to create a basic PowerBuilder application that uses the CData ADO.NET Provider for SAP Ariba Procurement to retrieve data.

  1. In a new WPF Window Application solution, add all the Visual Controls needed for the connection properties. Below is a typical connection string:

    ANID=AN02000000280;API=PurchaseOrdersBuyerAPI-V1;APIKey=wWVLn7WTAXrIRMAzZ6VnuEj7Ekot5jnU;AuthScheme=OAuthClient;InitiateOAuth=GETANDREFRESH

    In order to connect with SAP Ariba Procurement, set the following:

    • ANID: Your Ariba Network ID.
    • ANID: Specify which API you would like the provider to retrieve SAP Ariba data from. Select the Buyer or Supplier API based on your business role (possible values are PurchaseOrdersBuyerAPIV1 or PurchaseOrdersSupplierAPIV1).
    • Environment: Indicate whether you are connecting to a test or production environment (possible values are TEST or PRODUCTION).

    Authenticating with OAuth

    After setting connection properties, you need to configure OAuth connectivity to authenticate.

    • Set AuthScheme to OAuthClient.
    • Register an application with the service to obtain the APIKey, OAuthClientId and OAuthClientSecret.

      For more information on creating an OAuth application, refer to the Help documentation.

    Automatic OAuth

    After setting the following, you are ready to connect:

      APIKey: The Application key in your app settings. OAuthClientId: The OAuth Client Id in your app settings. OAuthClientSecret: The OAuth Secret in your app settings.

    When you connect, the provider automatically completes the OAuth process:

    1. The provider obtains an access token from SAP Ariba and uses it to request data.
    2. The provider refreshes the access token automatically when it expires.
    3. The OAuth values are saved in memory relative to the location specified in OAuthSettingsLocation.

  2. Add the DataGrid control from the .NET controls.
  3. Configure the columns of the DataGrid control. Below are several columns from the Account table: <DataGrid AutoGenerateColumns="False" Margin="13,249,12,14" Name="datagrid1" TabIndex="70" ItemsSource="{Binding}"> <DataGrid.Columns> <DataGridTextColumn x:Name="idColumn" Binding="{Binding Path=Id}" Header="Id" Width="SizeToHeader" /> <DataGridTextColumn x:Name="nameColumn" Binding="{Binding Path=DocumentNumber}" Header="DocumentNumber" Width="SizeToHeader" /> ... </DataGrid.Columns> </DataGrid>
  4. Add a reference to the CData ADO.NET Provider for SAP Ariba Procurement assembly.

Connect the DataGrid

Once the visual elements have been configured, you can use standard ADO.NET objects like Connection, Command, and DataAdapter to populate a DataTable with the results of an SQL query:

System.Data.CData.SAPAribaProcurement.SAPAribaProcurementConnection conn conn = create System.Data.CData.SAPAribaProcurement.SAPAribaProcurementConnection(connectionString) System.Data.CData.SAPAribaProcurement.SAPAribaProcurementCommand comm comm = create System.Data.CData.SAPAribaProcurement.SAPAribaProcurementCommand(command, conn) System.Data.DataTable table table = create System.Data.DataTable System.Data.CData.SAPAribaProcurement.SAPAribaProcurementDataAdapter dataAdapter dataAdapter = create System.Data.CData.SAPAribaProcurement.SAPAribaProcurementDataAdapter(comm) dataAdapter.Fill(table) datagrid1.ItemsSource=table.DefaultView

The code above can be used to bind data from the specified query to the DataGrid.