on 05-24-2013 7:26 AM
Hi All,
I'am new to SAP Mobility, what I'm trying to do is Upload an Image captured from Android Phone Camera to SAP system.
I'm Using PhoneGap with Eclipse to Build the app, I have done till capturing the picture using camera and I dont know how to proceed, that is how to Send it to SAP system.
I have searched a lot on this topic and I found in infocenter.sybase.com that you can use "MBO from file" to send an Image to SAP system.
I'm using SUP 2.2 and I'm not able to find this option(MBO from file) can anyone please guide me on this. I'm really stuck and has been trying many things.
Any kind of help would be appreciated
Regards,
Pratheek
Hiii pratheek ,
You need to follow simple steps for storing data in SAP system
1) Create one Bapi with input parameter type XSTRING and create its MBO.
2) Once you android app capture image convert that bitmap image to BASE64 encoded string and send this string to MBO's (Xstring in MBO bigbinary) BigBinary parameter.
3) In your bapi write down logic for Decoding it into xstring ( Use FM SSFC_BASE64_DECODE or CL_HTTP_UTILITY class ) and than save it to rawstring format in database .
BR,
Ashish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ashish,
Thanks a Lot for your reply and your simple answer, now I created an MBO but what operation should i call?
How will I set the Importing Parameter of the BAPI in MBO to my Image? where should I set this value?
Please excuse my ignorance, I'm new to this Mobility Topic
Thanks again for your reply
Regards,
Pratheek
Hiii Pratheek,
use CREATE operation for your BApi and pass your image into that , when you create CREATE operation you will find your BApi import parameter is available in that that means you don't need to create personalization key and don't need to map them , once you generate code , see you generated class for you MBO you will find BApi import parameter as attribute of class just set value of image(base64 image ) and than call submit and synchronize.
and inside BApi as told you in my earlier replay follow steps , by this you can easily put your image inside Sap database or in your custom table.
Hi Ashish,
" once you generate code , see you generated class for you MBO you will find BApi import parameter as attribute"
1. In which .js file we can find input parameter MBO.
2. How to pass out image to this parameter
I did following
called customGetPictureDataFromCamera() in customBeforeMenuItemClick(screen, menuItem) of custom.js
in customGetPictureDataSuccess(fileName, imageData ) i want to set this imageData to MBO input paramete. how can i set....
Thanks
Suresh
Hi Pratheek,
I did the following.
function customGetPictureDataSuccess(fileName, imageData ){
var pictureDataValue = new MessageValue();
pictureDataValue.setKey("key21"); // Must be set by the user.
pictureDataValue.setValue(imageData);
pictureDataValue.setType(MessageValueType.TEXT);
var mvc = getWorkflowMessage().getValues();
if( mvc ) {
mvc.add( pictureDataValue.getKey(), pictureDataValue );
Thanks
Suresh
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.