cancel
Showing results for 
Search instead for 
Did you mean: 

Changing Dataproviders for a Webi Report using RESTful Web Services SAP BI 4.1 SP08

Former Member
0 Kudos

Hi All,

I have followed the blog to change the data provider(universe) of a webi report, I was able to change the data provider(universe) of a webi report which do not have any prompt in it.

Same code is also working for a FHSQL reports and I was able to update/change the FHSQL data provider.

When I tried to change the universe of a webi report which has prompts, it did not work for me.

It has given me output as 200 OK and a message as "Data provider has been updated successfully."

But when I checked the report through CMC->Check relationships, it was still pointing to old universe.

I have tried following workflow to get it working for a webi report with prompts:

- Generate the login token.

- Get the list of data providers for the webi report.

- Get the mappings for the data providers.

- Change the data providers.

- Refresh the report with and without parameters.

- Save the report.

Output 1 for a webi report without any prompt:

==================================================================== // Authored By swapnil.yavalkar@hotmail.com // ====================================================================Initiating CMS Connection.....

Report ID: 20971

Data provider : {"dataSourceId":20994,"name":"Trial Balance","id":"DP15","dataSourceType":"unx"}

Response For updating data provider:

{protocol=http/1.1, code=200, message=OK, url=http://10.1.10.183:6405/biprws/raylight/v1/documents/20971/dataproviders/mappings?originDataproviderIds=DP15⌖DatasourceId=43914}

Parameters Refreshed:

{protocol=http/1.1, code=200, message=OK, url=http://10.1.10.183:6405/biprws/raylight/v1/documents/20971/parameters}

Document is Saved:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <success> <message>The resource of type "Document" with identifier "20971" has been successfully updated.</message> <id>20971</id> </success>

Output 2 for a webi report with a prompt:

Report ID: 20971

Data Provider: {"dataSourceId":20994,"name":"Carrier Code","id":"DP16","dataSourceType":"unx"}

Response For updating data provider:

{protocol=http/1.1, code=200, message=OK, url=http://10.1.10.183:6405/biprws/raylight/v1/documents/20971/dataproviders/mappings?originDataproviderIds=DP16⌖DatasourceId=43914}

Parameters Refreshed:

{protocol=http/1.1, code=200, message=OK, url=http://10.1.10.183:6405/biprws/raylight/v1/documents/20971/parameters}

Document is Saved:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <success> <message>The resource of type "Document" with identifier "20971" has been successfully updated.</message> <id>20971</id> </success>

Output 2 is successful and but the report is still pointing to old universe.

I have tried all possible ways to get this working for a webi report with parameter, however it did not work. Please let me know if I am missing anything here and how to get it working.

Many thanks in advance.

Regards,

Swapnil Yavalkar

Accepted Solutions (0)

Answers (1)

Answers (1)

daniel_paulsen
Active Contributor

Hi Swapnil,

From the workflow you have described, you are modifying the document, but you are not saving it back to the CMS repository.
The changes are only kept in the cached copy of the document.

To save the changes back to the CMS, use:

PUT /raylight/v1/documents/<docId> with no body This will update the document in the CMS and keep the cached copy open in memory.

if you use a body with the PUT similar to:

<document><state>Unused</state></document>

this will save the document to the CMS and unload the document from memory (Close it on the processing server)

for details on saving the document, have a look at the lifecycle APIs in section: "8.1.9 Updating the State of a Document" of the following help file: https://help.sap.com/http.svc/rc/1eeee826c0154c62a5cbd29359ecbc18/4.2.5/en-US/sbo42sp5_webi_restws_d...


Dan

Former Member
0 Kudos

Hi Dan,

Thank you for looking into this.

I have tried with your suggestions but still the issue persists. When I am checking the state of the document after running my program, it still shows it as Original, it is actually not changing the state if after specifying Unused.

I had a discussion about this SAP Support team and they also confirmed that the state of the document is not taking any effect after specifying as Unused.

Please let me know if you are aware of any such issue. Many thanks in advance.

Regards,

Swapnil Y

daniel_paulsen
Active Contributor

after changing the datasource and getting a response saying it was updated, try retrieving the dataprovider ID to verify the new dataprovider is being used:
GET /raylight/v1/documents/20971/dataproviders


If the new ID is there then that part worked. Now check the State of the document. is it original?

GET /raylight/v1/documents/20971

Former Member
0 Kudos

Hi Dan,

I have tested the data providers of report every time using CMC and Postman tool, however I have found that my code has updated the only data provider which does not have any prompt in it and the report was saved with this change only. It has not updated the second data provider which has prompts in it.

Document state was changed from original to unused. This was not working when I used PUT but now its working using POST.

Please suggest next steps. I have also provided my complete code to SAP, now awaiting a response from them regarding this.

Thanks in advance.

Swapnil Yavalkar

daniel_paulsen
Active Contributor
0 Kudos

My next steps would be to download and use Fiddler to collect the REST calls and their responses so the whole workflow could be seen and followed by SAP support. If you don't see the rest calls in fiddler, then just add a proxy to your app that uses localhost:8888 (Fiddler's listening port)
The following example shows how to do that in the "If(enableFiddler){...}" of: https://blogs.sap.com/2013/09/13/export-webi-report-using-the-restful-sdk/

Dan