on 03-29-2013 7:30 PM
Customer need to submit a picture file content from iPhone to SAP CRM.
They created a BAPI that has a XString input parameter.Input
parameters:
filename(string), file extention(string), objectid of
the
Complain(string
), and image content XString
When they generate the
MBO code they cannot use Database methods like create
or
update, they see only
findall and load
With BAPIs they only know one way is to call it: link the
load parameter
with synchronization parameter and assign needed synchronization params
in the code, the problem is I cannot create the
synchronization
parameter
as BIGBINARY , only BINARY with limit of 32KB
max
Basically the question can be summarize like this:
Why if I add a create() operation on MBO WhateverMBO, I cannot see it
in
WhateverMBO.h header file
Hi Fiston,
Its a little difficult to deal with BigBinary as an input to a MBO.
Creating a Synchronization Key of the type Binary and mapping it to the Argument of the MBO allows posting binary data having max size 32KB to the back end.
As a workaround you can try minimizing the resolution/size of the image below 32KB in the iOS Native Code, set the Synchronization Key and post it to the back end. It works.
If reducing the size is not feasible then you can try creating it as an operation on a MBO instead of a seperate MBO. In this case SUP streams the BigBinary data/image (no matter what the size is, also greater than 32KB) smoothly to the back end. This thing also works.
In your case regarding the missing .h header file, please check whether the Generate Code is happening properly. You can just delete the content below src folder under Generated Code node in your Workspace and regenerate. Check for problems in Error Logs as well.
Regards,
Dharmaraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dharmaj thanks for the comment. Could you please check the below code and see if it will work:
I basically created MBO addPicture out of BAPI, which has 4 parameters one of
it is
BIG BINARY,
Added FILE_NAME, FILE_EXT, FILE_CONTENT, OBJECTID attributes to MBO
and mapped Load parameters to them. BIG BINARY FILE_CONTENT maps
to
IV_FILECONTENT load parameter, which is also BIG BINARY
I created a
create1() custom method that
has same mapping MBO parameters - load
parameters
Cash policy for the method is Invalidate Cash
My plan
is:
FIaddPicture *newPicture = [[FIaddPicture alloc]
init];
newPicture.FILE_NAME=@"image01";
newPicture.FILE_EXT=@"jpeg";
newPicture.OBJECT_ID=self.ComplaintID;
NSData
camerafile;
[newPicture.FILE_CONTENT openForWrite :
camerafile.length];
[newPicture.FILE_CONTENT
write:camerafile];
[newPicture.FILE_CONTENT.flush];
[newPicture.FILE_CONTENT.close];
[newPicture
create1]; //create1 is a custom defined create() method
[newPicture
submitPending];
[FIFIDB synchronize:
@"FIaddPictureGroup"];
QUESTION: Will the code work if I call it
every time user submits a
picture?
How can I go without create()
method if I cannot use synchronization
parameter or maybe I can mix
FILE_NAME, FILE_EXT, OBJECTID as
synchronization parameters mapped to load
parameters and FILE_CONTENT
parameter is assigned as MBO parameter and I can
every time call findAll() meth
od instead of create()?
Hi Fiston,
Let me make it simple and clear.
Solution 1: (As a MBO)
Solution 2: (As an operation)
Solution 3:
If you find any better solution please also let me know.
Regards,
Dharmaraj
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.