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

Hot
I've researched this extensively, but I haven't been able to solve my problem yet. It started completely out of the blue with a kernel panic, where my screen seemed to malfunction and I got the kernel panic message (but I could hardly read it because [More]
Hi EveryOne , I m getting error in Migo_gr that : "  Field Bus. Area is a required field for G/L account DMRC 141004 " . The bus arear is not visible in Migo_gr . thanksHi, Check business area is mandatory for your G/L 141004 (FS00) by checking [More]
Hi All, We are facing a socket exception in Admin Server log. PFB for the exception logs: [2011-12-26T00:36:21.793-06:00] [AdminServer] [WARNING] [] [oracle.adfinternal.view.faces.renderkit.rich.TreeRendererUtils] [tid: [ACTIVE].ExecuteThread: '44' f [More]
I note that there are several questions with zero replies. Does this mean that Apples does NOT populate this board? Isn't this supposed to be part of their tech support strategy? Why aren't there more answers here? BethThanks Zevoneer, That answers m [More]
Hi Peeps, 2.0.1 update went on cleanly with no problems at all. On the whole seems to be a good update - back up times are still really painfully slow and seem to be linked directly to how many apps you have installed. I removed them all and the back [More]
Sorry for the inconvenience to you all. Could somebody help me converting An InDesign 5.5 file in InDesign CS5 if a place it in my dropbox? I get the missing plg-ins pop up window. It is very important. Thank you so much. FokionMillion thanks. The li [More]
I regularly do several different complex filtering and sorting on large tables. I did not find a way to save them for later one-click reuse. So I always have to do it again, which is time-consuming and error-prone. Hoped to get a solution by AppleScr [More]
Hello! Can anyone tell me where I can find update for iSync to support Nokia 5000? Nova Media didn't release it yet. Thank's everyone*THANK YOU VERY MUCH!* Worked like a charm! I only had to discover the exact gmm, so I put <string>Nokia+Nokia 5000d [More]
Has anyone solved this issue: (http://discussions.apple.com/thread.jspa?threadID=1859003&tstart=0) I have tried the suggested techniques. I can get QT events working in FireFox, Safari, and even Chrome. But nothing I do makes IE work. I am going to h [More]
I bound a selectboolean_checkbox Tag to a UISelectBoolean component. The instance was set to the value "false", but the attribute in the tag was set to "true". The outcome is a NOT SELECTED checkbox. Can one generally say, that binding [More]