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
I have been going at it with Apple now for over a month! I ordered a book and it came back with blank pages and with photos not scaled properly. (This was my second iPhoto book. The first one also had several minor printing flaws which we overlooked) [More]
I am having problems sending photos in email messages. Could my settings be off?Both i and my friend have the same cursor jump problem. I have put up with it a couple of years on pc icloud safari, ipad and iphone.  My friend gave up and switched to g [More]
hi there , I was trying to excute MDX with spcific month and it runs perfectly POV "CrossJoin({([month],[Year])}, but when i try to chnage it dynamic like adding subtitutinal variable , it dont work CrossJoin ({Uda([Month],[&variable])}, or Cross [More]
Hello, We have an issue related to Process Order confirmation using Tcode COR6N. When we enter all the inputs to confirm( Activity, yield and phase) and click on save it gives ABAP Programming Error (Exception condition "SEQ_NOT_FOUND" raised). [More]
Ok I have a weird one for you hopefully someone can help and if so TIA!!!. I have Lab Manager 4.0 running and I am trying to move all my Hosts and VM's out and over to Vcenter 4.0 so I can shut down and quit using LM and some of my hosts are having p [More]
Hello.  I just wanted to make another official complaint about Verizon Wireless customer service.   I have been using a phone that i received from Verizon as a warranty replacement that was suppose to be "Like New".  This was the last of many ph [More]
Problem with Final Cut X running unbelievably slow. I have a Mac Pro 2 x 2.8 Quad core Xeon and 12 gigs of memory. The graphic card is an ATI Radeon HD 5770 1024 MB. I am using Lion. I am doing a large project and at about the 80 minute mark each act [More]
I created program where i used images.Can i have any chance that images can be moved from one end of screen to the other end of screen??Yup. [http://catb.org/~esr/faqs/smart-questions.html] [http://mindprod.com/jgloss/sscce.html] Use code tags to pos [More]
I want to purchase DLC that is available as an in-app purchase for Civilization V. I have a ton of money in gift cards on the Mac App store. Would this money be used to buy the DLC, or would it be charged to the credit card?In-App purchases require t [More]
Hallo, ich verwende bei meiner Fuji S20Pro den o.g. RAW Converter und dies in Photoshop CS. Heute habe ich einige Bilder in einer Schneelandschaft gemacht und zwar im RAW Modus. Das Ergebnis in Photoshop war erschütternd http://home.arcor.de/Rauwolf/ [More]