cancel
Showing results for 
Search instead for 
Did you mean: 

Post/Upload Image to SAP using RFC/webservice

kjyothiraditya
Participant
0 Kudos
1,369

Hi Experts,

Can you please guide me on how to post/upload image/images to SAP either by using RFC or webservice.

Regards,

Aditya

Accepted Solutions (1)

Accepted Solutions (1)

Sandra_Rossi
Active Contributor

It's unclear what your question is:

  • Difficulty in creating the RFC/webservice?
  • Difficulty in storing in a table or in "SE78"?
  • Just asking for more solutions? (but no need of a precise question?)

The most easier solution is:

  • REST : create a class which implements IF_HTTP_EXTENSION and create an ICF service (SICF) and associate the class to it. Pass the image as a string of base64 characters. In the class, convert the base64 back to bytes and store them into a custom table... Basically that would take me 30 minutes to write the solution.

Now the only thing left to you is to search the web for details, or ask for more precise questions.

kjyothiraditya
Participant
0 Kudos

Hi Sandra,

Thanks for taking time to answer my queries.

First of all sorry for not being clear. Yes, I am having difficulty in creating RFC/Webservice for this.

The thing is that the images may be sent as attachments.Also, can we use rest for storing images/data as REST protocol may not support attachments in SAP ECC 6.0 version? We are using SAP PI as the middleware. Can we use SOAP for this with attachments. If yes please advise.

Regards,

Aditya

Sandra_Rossi
Active Contributor
0 Kudos

"as attachments" of what? Please tell us the whole story right now, because you are adding more complexity after each answer 🙂

You may also use SOAP if you prefer. HTTP, REST or SOAP are just carriers of any sort of data. You might even use OData, etc.

kjyothiraditya
Participant
0 Kudos

Thanks once again for your reply....

If possible, can u pls share pseudocode of how to implement the same using a webservice where in we store the image data in a custom table. If using ICF/REST proctocol, how should we send the data ? it will be in the body of the message or as attachment or in the form data ? How can we do the same using SOAP ?

Regarding using ODATA, we are on ECC 6 version and do not have the Gateway component yet in our system.

please help.

Regards

Aditya

Sandra_Rossi
Active Contributor

REST: for example https://yoursapsystem/yourpath?imagename=xxxxℑbase64=<base64>; or if you prefer in the body, whatever you want, with the ABAP http request handler, you can read the whole request... I think there is a blog post somewhere. You may at least start with creating a HTTP Request Handler https://help.sap.com/saphelp_nw70/helpdata/en/25/dda73e5b7a424de10000000a114084/frameset.htm

SOAP: well it's SOAP, you have to create the WSDL, create the proxy in SAP, etc. It's not so simple, get a training, read blog posts, etc.

Answers (1)

Answers (1)

kjyothiraditya
Participant
0 Kudos

Hi Simon,

Thanks for your reply. We would be getting images from another System(Non-SAP) and we have to store them in SAP and it would not be a manual upload from desktop. Yes storing either in table or in standard se78 would be fine.

Please find below the answers to the queries:

What did you try until now?

We are in requirement gathering phase and looking for all feasible solutions by which this can be achieved.

Which is the scenario you are working on?

We would be getting images from another System(Non-SAP) and we have to store them in SAP and it would not be a manual upload from desktop. Yes storing either in table or in standard se78 would be fine.

Which kind of images you want to handle (aka which file type)?

Images could be in JPG/PNG format, still to be confirmed.

Regards,

Aditya

SimoneMilesi
Active Contributor
0 Kudos

Then rely on HTTP / REST Class, get the image via http, you'll receive the blob you can store as raw string in your custom table.

If you click on the links i put in my original comment you'll find many threads on the topic.

kjyothiraditya
Participant
0 Kudos

Hi Simon,

I have gone through the links/blog posts as mentioned earlier, but they contain the logic to upload from frontend which is like kind of manual activity. But i need some help on implementing it in real time where we get the file/files in a request which in turn calls RFC/Proxy and we have to post those to a table/MIME repository. Could you please guide me to this ?

PS: Our ECC version is ECC6.

Regards,

Aditya