Skip to Content

Upload a picture to SAP System

Hi everybody,

I try to create an application which should be able to take a picture and afterwards upload it to a SAP System. I can already make a picture and safe it in my application. The path to the image is always something like this:

file:///storage/sdcard0/Android/data/MYPACKAGE/cache/1390895377066.jpg

My application has a simple synchronize button and everytime when you press this button all the changed data (including my picture) should go to the SAP System. Just for your information: Im developing with Cordova on an Android Device. The picture is made through the following code:

navigator.camera.getPicture(onPhotoSuccess, onPhotoError, {

            quality: 50,

            destinationType: Camera.DestinationType.FILE_URI,

            sourceType: Camera.PictureSourceType.Camera

});

Does anybody know how it is possible to take the picture and deliver it to the system? Looking forward to your answers!

Greetings

Stef

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Feb 13, 2014 at 09:50 AM

    Hi everybody,

    in case you haven't noticed. I wrote a blog post for solving this issue 😊

    Here is the link to it: How to store a mobile made picture in SAPoffice

    Don't hesitate to ask if you have any problems

    Kind regards

    Stef

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 28, 2014 at 01:27 PM

    Hi again,

    I read something about building a RFC which takes a xString as an import parameter. This xString should include the Base64 Code of the image afterwards.

    It's no problem for me to get that Base64 Code. There is a special function for that which does it for me. The question that I have is how to call the RFC. Where does the RFC store the image? Really hope that you can help me solving this problem.

    Greetings

    Stef

    Add comment
    10|10000 characters needed characters exceeded

    • Well I understand that but the only thing what I want to do is to send the base64 code + the other data to the sap system. save the base64 code as img in the mime repository and create an entry in a database. oData only delivers me data doesn't it? If no, how would you make this oData service calll???

      Looking forward to your answer

      Greetings

  • Jan 30, 2014 at 03:50 PM

    Hi again,

    I have a small news update for you. I was able to send the base64 code to the SAP system.   What I want to achieve now is to save the image as an attachement for a special notification. SAP allows to save images and other attachement as a "Service for Object". I know that notifications etc. are saved in the table "QMEL". Is there now a special association? How am I able to save it as a "Service for Object"? Has anybody of you done this before? Looking forward to your answers. Greetings!

    Add comment
    10|10000 characters needed characters exceeded