Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Read image using url

Former Member
0 Likes
5,471

Hi All,

Can any body give some idea "how to read image using external url link" and display that image in Adobe/smartforms.

Thanks.

7 REPLIES 7
Read only

Former Member
0 Likes
3,015

Upload the image in SE78 in MIME directory/repository.

Determine the image details using below code and then pass it over to you adobe level

Form Context

Image Object at form context leve

Regards

Ansumesh

Read only

sivaganesh_krishnan
Contributor
0 Likes
3,015

Hi Kumar,

Hope this link Solves Ur problem.

https://scn.sap.com/thread/2113202

Regards,

Sivaganesh.K

Read only

0 Likes
3,015

Hi both,

thanks for reply.

The thing, we don't want to save the picture any where. Because those pictures are millions.

I just want to use the link and get the picture in byte string/hex string and convert to image and show in smartform/adobe reader.

Any help will be highly appreciated.

thanks.

Read only

Former Member
0 Likes
3,015

Hi,

Sorry but you can't use external images directly in the smartforms. You need to import it in the Document server in BMP format using transaction SE78 and then use it in your form.

regards,

Ashish Rawat

Read only

0 Likes
3,015

Hi,

In that case, I have requested image into HEX STRING (RAW format from .Net) and the file will be saved in the server. I am able to read file and save into desktop. But when I open desktop image, it is giving error. Attached is the Raw format file.

Any Idea?

Thanks.

Read only

0 Likes
3,015

Kumar,

You could create a custom folder in the Mime Repository (SE80-->Click on Mime Repository button on the top) under path /sap/public/bc instead of using SE78 etc.

Then upload the image file (.JPG for example) in that new folder in the Mime Repository. Make sure the Mime Type is set to image/jpeg (Right click then see Properties of the image file)

In the context of your form, define an image file of type Graphic Content. Set the Graphic content field to a variable (say var1) of type XSTRING and set the Mime Type to a constant (say co1) of type STRING value 'SAP/PUBLIC/BC/your_folder/your_image.jpg'

In the Code Initialization of the form interface, work with the SAP standard mime_repository object.

data:  lr_api    type ref to if_mr_api.

lr_api = cl_mime_repository_api=>get_api( ).

lr_api->get( exporting  i_url         = co1
                  importing e_content = var1 ).

Finally, in the form, don't forget to bind the image object of the form to the image/Graphic Content of the context.

Cheers,

Sougata.

Read only

0 Likes
3,015

The file data string should be BMP format....the string you have shown here is not in BMP format. Save the file in BMP format on your desktop.