Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Ariba API to pull Requisition header data

nidhiagarwal17
Explorer
0 Kudos

Hi Team,

I am trying to build a report by extracting PReq header data. I used Operational Procurement API with fact table - Requisition_SAP_updatedRange but its not pulling all the header data. Also, does API pull custom data fields?

Please advise which API can be used for PReq header data information.

Thanks,

Nidhi

  • SAP Managed Tags:
4 REPLIES 4

yoswisnu
Explorer

nidhiagarwal17 - Not all fields are available from Operational Reporting API. To query for which fields are available, you have to use the metadata end point and specify the parameter: documentType: Requisition
Then, create a custom viewTemplate with the select fields and filter fields you need.
In order to bring back custom field metadata, use same call to metadata end point and add the parameter: includeCustomFields: true
then it will return the custom field name.
Add these custom field names as select field in the custom viewTemplate, it will then return those when the API call your custom viewTemplate.
Requisition_SAP_updatedRange you used is an OOTB viewTemplate which does not have all the fields and definitely have no custom field as each realm has different custom field.

Please visit the blog I posted on the structure of Reporting API to find out more on its structure. It is quite straightforward:

SAP Ariba Reporting Structure

Note: the blog I post is for Analytical Reporting API, but the structure for Operational Reporting for Procurement should be the same. just different url is being used and different Classes are being called. In this case, you would concentrate on Requisition documentType.

In short, the steps are:
1. Use metadata end point to gather available Select Fields (standard and custom) and Filter Fields from documentType: Requisition
2. Create viewTemplate with select fields and filter fields of Requisition documentType
3. Utilize the Synchronous or Asynchronous method to bring back data.

  • SAP Managed Tags:

Hi Yos,

Thank you very much for detailed explanation. It really helped and I was able to pull the required data.

Appreciate your help!!

Thanks,

Nidhi

  • SAP Managed Tags:

nidhiagarwal17
Explorer
0 Kudos

Hi Yos,

I have 1 more question. Its regarding the date format. The current date fields in Ariba API are in date and time combined. I tried to set the date datatype in PowerBI when I an trying to convert the JSON format to an excel format report. Its converting date into a hierarchical format with Day,month,quarter, year format and each of these fields are coming as separate columns in the report. Would you be able to help with how to set the data datatype for API during reporting?

Thanks,

Nidhi

  • SAP Managed Tags:

0 Kudos

Hi Nidhi, I didn't see your post until now. sorry.
There is no way to set datatype or formatting of a field from our APIs. The conversion method from PowerBI must be the one being setup to handle that.

  • SAP Managed Tags: