0

I'm trying to change a data source of a data provider using the following RESTful API functionality.

Changing the Data Objects of a Data Provider (old link)

I get the proposed mappings and then post a request to change the data source. I get back a message that the document was successfully updated, but the actual data source of the data provider is not changed.

I wonder if I'm missing anything or need to do something else to get the data source updated.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
IgorShch
  • 149
  • 1
  • 4
  • 21

1 Answers1

3

I think you still need to save the changes made to the document. This is described here.

After the data source change, your document will have its state changed from Unused or Original to Modified. By issuing a PUT request to <webiURL>/documents/{documentId}, you would save the changes back to the repository.

DocZerø
  • 8,037
  • 11
  • 38
  • 66
  • Have you ever had a problem with the reports after you updated then using a PUT request? I'm changing the datasource for the whole report and then use PUT request as you suggested to save the changes and it all works fine. Although if I try to change the data source on the same report again, I get a "404" error when I try to get the proposed mappings. – IgorShch Jan 27 '15 at 15:30
  • Actually, if anyone gets the same problem, I think the problem caused by the fact that data providers change their ID after the change on the data source. So DP01 turns into DP02 and so on. – IgorShch Jan 27 '15 at 15:47
  • do you have any idea why update of the data source would come back with success saying that the resource is updated, but then when I try to save the changes using the PUT request (just like you described in your answer) I get back a success message saying that the document has NOT been modified? It happens for some reports, not for all. – IgorShch Feb 02 '15 at 13:45
  • 1
    Check the document's state after modifying the data provider (`GET /documents/{documentId}`). This should say `Modified`. The document's details are described [here](http://help.sap.com/saphelpiis_sbo41sp5wi-sdk/frameset.htm?ec5627ba6fdb101497906a7cb0e91070.html) and the lifecycle [here](http://help.sap.com/saphelpiis_sbo41sp5wi-sdk/frameset.htm?5f32f787be7140498239940b89453cc5.html). – DocZerø Feb 03 '15 at 15:24