FAQ KB0399829
Email
OpenAPI: How do I add fields to the Reporting API Custom viewTemplate?
Symptom

How do I add fields on Reporting API Custom viewTemplate?


Resolution

Follow these steps:

  1. Create a custom viewTemplate.
  2. Patch the custom viewTemplate by calling this API endpoint:

    POST /procurement-reporting-view/v2/prod/viewTemplates/nameofCustomViewTemplate/patch?realm=RealmName

    On the body part, specify: (note the real field example mixed in the code)

    {
    "selectAttributes": [
    "Attributes1",
    "Attributes2",
    "Attributes3",
    "cus_Attributes1",
    "cus_Attributes2",
    "StartDate",
    "UniqueId"
    ],
    "filterExpressions": [
    {
    "name": "FilterName",
    "field": "filterExpression1",
    "op": ">=",
    "defaultValue": "YYYY-MM-DDTHH:MI:SSZ"
    },
    {
    "name": "createdDateTo",
    "field": "TimeCreated",
    "op": "<=",
    "defaultValue": "2019-05-31T00:00:00Z"
    },
    {
    "name": "StatusInList",
    "field": "StatusString",
    "op": "IN",
    "defaultValue": [
    "Submitted"
    ]
    }
    ]
    }
Additional Information:
  1. Only the custom viewTemplate can be modified/patched. The system viewTemplate cannot be modified.
  2. Invoke the GET /metadata API end point to bring back the available Select Fields and Filter Expressions.
  3. Notice that on custom view, duplicate fields are not allowed.


Applies To

Core Procurement > Procurement REST APIs > Operational Reporting API
SAP Ariba Analysis Reporting > Analytical Reporting - REST API
Strategic Sourcing > Strategic Sourcing - REST API > Strategic Sourcing - Operational Reporting API

Terms of Use  |  Copyright  |  Security Disclosure  |  Privacy