BusinessObjects Board

Replace an existing file in the launchpad using java/VB sdk

Hi,
I’m trying to replace an excel file using java or vb sdk. I am able to upload a new file using the infoobject.files.add() method but I really need a replace method (so that the object ID remains unchanged).
SAP blogs suggested that the replace functionality was not available using REST API and could only be done with the java sdk. Anyone know how it can be done?

hi,
1st of all I don’t know,
but I doubt you can keep the object ID unchanged even using SDK.
I can imagine - you can replace the file directly in the repository - but this is an opening of Pandora’s box :slight_smile:
T.

1 Like

if the Excel-file is the source of a WebI-Report you can save the Excel to a network-location
and build your WebI with the Rich-Client based on this file.
so updating/replacing the Excel in network is possible.

Yes, this can be done with either the Java or the .NET SDK. Here’s the logic you’ll use:

  1. Create an IEnterpriseSession and log in to the CMS.
  2. Create an IInfoStore so that you can run CMS queries.
  3. Query for the InputFileRepositoryServer to get the path to the input file store where your file is saved.
  4. Create and run a query that will get the InfoObject for the file you want to replace.
  5. Get the SI_FILES information to determine the path and file name of the file you want to replace.
  6. Save your new file over the top of the existing one, using the path and file name from steps 3 and 5.
  7. Call .refresh() on the object from step 4, which you may have to cast as a Webi in order to make the call to .refresh(). This will update the InfoObject metadata for file date and file size so that they match the actual file.

-Dell

1 Like