Sitemap

Amicuk Programming Answers

Save binary object via API 2

-0001-11-30   Views:0

Advertisement

How do I save a file via the API 2? Any exsample will help me alot! I'm trying to save a object to the table Binary_Objects, but I get the error: "com.sap.mdm.internal.protocol.manual.ServerException: Server error (0xffaab000)"I assume you are t

How do I save a file via the API 2?
Any exsample will help me alot!
I'm trying to save a object to the table Binary_Objects, but I get the error: "com.sap.mdm.internal.protocol.manual.ServerException: Server error (0xffaab000)"

The replay answer
Advertisement
I assume you are trying to create a BinaryBlobRecord in the Binary_Object Table.
Here is some code that works:
BinaryBlobRecord record = RecordFactory.createEmptyBinaryObjectRecord(tableId);
record.setBinary(new BinaryValue(bytes));
record.setDataSize(new IntegerValue(size));
record.setHasOriginal(new BooleanValue(true));
record.setDataGroupId(node.getId()); // get the node using RetrieveGroupTreeCommand command.
record.setSource(new LookupValue(new RecordId(1))); // see below
record.setCode(name); // The code has to be unique, so you can add a random number to the name.
record.setName(new StringValue(name))
CreateRecordCommand createRecordCommand = new CreateRecordCommand(connection);
createRecordCommand.setSession(authenticatedUserSession);
createRecordCommand.setRecord(record);
createRecordCommand.execute();
If you don't set the source properly , you will get that error. For setSource method, you need to set a Location ID. With API 5.5 SP5, most likely there is no way to create a new location ID and we have to use one of the existing Location IDs. Just to make the code work, I used "new LookupValue(new RecordId(1)) ", which requires having at least one file uploaded to the table via MDM Data manager and use the first part of its location ID.
For setDataGroupID, first create the group node in the MDM Data Manager and find the node in the GroupTree with API. To get the GroupTree, use RetrieveGroupTreeCommand.

Go to See the other 3 answers

Save binary object via API 2

Category:DefaultRelease time:-0001-11-30Views:130

How do I save a file via the API 2? Any exsample will help me alot! I'm trying to save a object to the table Binary_Objects, but I get the error: "com.sap.mdm.internal.protocol.manual.ServerException: Server error (0xffaab000)"I assume you are t[More]

AddRecord error when adding binary object

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, I am getting  a2i.core.StringException: AddRecord error when trying to add binary object in the repository using Java API. The code used is as below:    //Adding values in binary table    byte[] fileBuf = file;    A2iFields fields = new A2iFi[More]

Save different Objects in one file by two different streams

Category:DefaultRelease time:2015-10-11Views:130

Hi all, I have a issue to read two Objects from one file if I write those in two different streams. I open the ObjectOutputStream and save an Object to the file. Then I close this stream and file. Then I open the new ObjectOutputStream and save the s[More]

Script throwing error" Object required: 'API'

Category:DefaultRelease time:2015-10-11Views:130

Hi All, We need help in one issue. We have following script which is running fine when we ran it from script editor, but when use this as expression in import format is throwing error Error: An error occurred importing the file. Detail: Object requir[More]

How to extract a field from Binary object

Category:DefaultRelease time:2015-10-11Views:130

Hi Guys, I have a Binary object in custom aggregator and I would like to extract a field from the Binary object without de-serializing the Binary object. I know this can be done but figure out how.. Appreciate your help. Have tried this PofValue valu[More]

How to save an "Object" in a selected file ?

Category:DefaultRelease time:2015-10-11Views:130

Hi, I would like to save an object with for example a PlanarImage object type in a selected file from JFileChooser Do you know how to do it ? I tried this but it didn't work : File fChoosen = chooser.getSelectedFile(); ObjectOutputStream os = new Obj[More]

Unable to update rating (rating column) on host document using JavaScript Object Model API inside sharepoint hosted apps

Category:DefaultRelease time:-0001-11-30Views:130

Hi Everyone, We are developing SharePoint hosted apps for Office 365, for that we are going to implement document rating functionality inside Sharepoint app. The host web contain document library (“Documents”) and from apps we need to rate each docum[More]

How can I save an object Image in a file with .jpg or .gif format?

Category:DefaultRelease time:-0001-11-30Views:130

Greetings I'm programming a Ray Tracer but now I need to know like save an object Image in a file with .jpg or .gif format. Could anyone help me, please? It's very important to me do this as soon as possible. Thanks.In 1.4 you have ImageIO available[More]

How can I use Diagnostics Object Model APIs?

Category:DefaultRelease time:-0001-11-30Views:130

Hi. In the Internet Explorer DevCenter page I could reach a very interesting section about developer APIs. In particular there is a section devoted to the Diagnostics Object Model API. This is something very cool I think but the problem is that I cou[More]

Air Javascript Save Binary File

Category:DefaultRelease time:-0001-11-30Views:130

I'm trying to download and save binary file to the local disk. I've spent all morning trying to get this to work bu am stumped             function saveFile(outData) {                     try    {                         stream = new air.FileStream()[More]

DEFECT: Locks up on save of object being used elsewhere

Category:DefaultRelease time:-0001-11-30Views:130

When I try to save an object (such as a package body), Oracle (quite rightly) will not let me replace the object's code if some other process is using that object. However, SQL Developer handles this situation in a very, very unpleasant manner. Basic[More]

Hot
The first time i turn on my personal hotspot, i chosen usb only, how can i re-enable wifi hotspot?Yeah, I just noticed it   So does this mean I can't wake my S10 thru LAN right?  Anyway, do you have any suggestions?  I'm looking for a Docking Station [More]
Since I updated to iOS 6.0.2, I've experienced problems with some apps that can't seem to remember password credentials after each reload. I have to RE-ENTER the login credentials repeatedly. What a pain! iOS just can't seem to remember Twitter passw [More]
Oracle Database 9i, Application Server 9iAS, Operating System SUSE Linux 7.2 CPU - Athlon 1400 Ram - 1GB There is a modification for the http server that aims to eliminate a problem on unix that causes the database to create too many sessions. The sc [More]
hello experts, I have bookings on an ODS with each booking recording the number of days between date of booking and date of departure (e.g. 78 days or 5 days). Now I want to display a diagram with y-axis = number of bookings and x-axis = days between [More]
Can anyone explain me "What is the use of Revision level in Quality Info Record" Thank USince Material New Revision can affect the vendor quality R/3 forces the Q-info record which is revision specific.Read other 2 answers [More]
Whem creating a new project with a AJA secuence my program crashes. I recently discovered a driver upgrade for my AJA and tryed to use it wuth Premiere with crashing results. Has anybody experience this? What can I do?Adobe/Jive have a BAD title for [More]
I inherited a site created on Dreamweaver several years ago.  I have recently purchased Dreamweaver CC to try to help with editing this site.  I can't open the Remote on DW, but I can open the Remote on FileZilla.  Suggestions?  I contacted my host s [More]
Hi, I have a Pavilion t640.it running Windows XP SP3. Windows drivers are updated (I downloaded them from the HP site) and I also tried to update the BIOS after I experienced the following problem, but with no success. I often need to connect smartph [More]
Hi, My HH3 has been installed for a while now, over 4 months, and no software upgrade has ever occurred on it. Currently the Software version is 4.7.5.1.83.8.57 (Type A). The hub works fine and I am getting a speed out of it that is fine for the exch [More]
4 year old iMac/20" 10.5.6 suddenly the machine will just quit, as tho I had pulled the plug. Starts up normally when I reboot. No recently installations, apart from 10.5.6. three weeks ago Anyone having this problem?? Thanks EllisSounds very much li [More]