View Templates for the Analytical Reporting API

Reporting view templates are used to specify the filters that determine what data will be returned in response to an API request using the Analytical reporting API. A reporting view template specifies the type of records to report on, the reporting fields to be included in the API response, and selection filters to select relevant records for inclusion.

For example, a view template for invoices could specify filters like updatedDateFrom > 2017-10-01T00:00:00Z to report on invoices updated after October 1, 2017 or Status = Approved to report on invoices in Approved status. The response to an analytical reporting API call would include the fields specified in the view template from approved invoice transactions updated after October 1, 2017.

Identifying Analytical Reporting API View Templates

View templates are used in all three SAP Ariba reporting APIs, but each API uses its own set of system view templates. If you try to use a system view template intended for the Operational reporting API for Sourcing to retrieve data with the Analytical reporting API you will get an error message.

For the Analytical reporting API, there is a system view for each fact and dimension, so you can identify system view templates intended for use with the Analytical reporting API by their names. All system view templates for the Analytical reporting API have names that include either DimSystemView (for dimensions) or FactSystemView (for facts). See System View Templates for the Analytical Reporting API for more details.

You can use the GET /viewTemplates endpoint of the Analytical Reporting - View Management API to retrieve a list of system view templates supported for use with the Analytical reporting API. For a sample query, see the next section of this topic.

Possible View Template Actions

  • List the names and details of reporting view templates currently in the system for a particular document type using the GET /viewTemplates endpoint of the Analytical Reporting - View Management API. You can specify the desired document type and status in the URL using the optional documentType and status parameters.

    GET {{runtime_url}}/viewTemplates?realm={realm}&documentType={documentType}&status={status}&product=analytics
  • Create a custom reporting view template using the POST /viewTemplates/{viewTemplateName} endpoint of the Analytical Reporting - View Management API. Name the custom view template in the URL and provide field and filter data in the request body. For a detailed example, see Sample API Request to Create a Custom View Template.

    POST {{runtime_url}}/viewTemplates/{viewTemplateName}?realm={realm}
  • View the fields and filters associated with an existing view template, using the GET /viewTemplates{viewTemplateName} endpoint of the Analytical Reporting - View Management API.

    GET {{runtime_url}}/viewTemplates/{viewTemplateName}?realm={realm}
  • Modify an existing custom view template using the /viewTemplates/{viewTemplateName}/patch Analytical Reporting - View Management API. Provide the name of the custom view template to be modified in the URL, and provide fields and filter modifications in the request body.

    POST {{runtime_url}}/viewTemplates/{viewTemplateName}/patch?realm={realm}

    To change the status of a custom reporting view template using this endpoint, pass the status parameter in the request body.

    POST {{runtime_url}}/viewTemplates/{template_name}/patch?realm={realm}
    Request body
    {
    	"status":"deactivated"
    }
    				
  • View the details of a particular reporting view template using the GET /viewTemplates/{viewtTemplateName} endpoint of the Analytical Reporting - View Management API.

    GET {{runtime_url}}/viewTemplates/{viewTemplateName}?realm={realm}