Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
SAP BI retrieving PDF from Web Service
To retrieve a PDF document from SAP BI using Web Services, you can use the REST SDK which provides a straightforward approach to document retrieval and conversion. This method involves making several API calls in sequence to authenticate, handle parameters, and export the final PDF.
Step-by-Step Process
Follow these steps to retrieve and convert a document to PDF format ?
Step 1: Authentication
First, establish a session by logging into the BI platform ?
POST /biprws/logon/long
Content-Type: application/json
{
"userName": "your_username",
"password": "your_password",
"auth": "secEnterprise"
}
Step 2: Retrieve Document Parameters
Get the document's prompts or parameters if any exist ?
GET /biprws/raylight/v1/documents/5690743/parameters X-SAP-LogonToken: your_logon_token
Step 3: Set Parameter Values
Pass the correct values for any prompts and refresh the document ?
PUT /biprws/raylight/v1/documents/5690743/parameters
X-SAP-LogonToken: your_logon_token
Content-Type: application/json
{
"parameters": [
{
"name": "parameter_name",
"values": ["parameter_value"]
}
]
}
Step 4: Export as PDF
Finally, export the document as PDF by including the appropriate Accept header ?
GET /biprws/raylight/v1/documents/5690743 X-SAP-LogonToken: your_logon_token Accept: application/pdf
Important: The key to receiving the PDF format is passing Accept: application/pdf in the HTTP header. Without this header, the response will be in the default format rather than PDF.
Conclusion
Using the REST SDK provides an efficient method to programmatically retrieve PDF documents from SAP BI Web Services through a series of authenticated API calls with proper parameter handling.
