cancel
Showing results for 
Search instead for 
Did you mean: 

solution to upload images by creating mime repository

Former Member
0 Kudos

Hi

We need to implement a solution in retail where and enduser will upload the images of different retail items which needs to be accessed by buyers.

We need to understand the best possible way on following

1. How do we create repository where an image can be uploaded without creating transport requests.

2. How can webdynpro application access the image if the archiving is done.

Thank you

Barin

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Actually I would just suggest storing the images in a normal database table like any other piece of data. Images can be stored in a table that has a column of data type XSTRING (RAW STRING). You just use normal SQL commands to read and write the data. This is generally easier than interacting with the MIME repository - although the MIME Repository does have APIs if you absolutely must go that route.

To me MIME repository is good for objects directly part of a development object, but if you have images that are part of your application data, they should be treated as such and stored in the database.

If you want an example of this, we created such a thing for the mentors' hands on workshop:

http://code.google.com/p/sdn-mentor-handson-2008/downloads/list

We created a custom table to hold images and created a custom ICM handler to make it easy to access them via URL. We could then use these images in our Web Dynpro and Flex coding.

yesrajkumar
Active Participant
0 Kudos

Hi,

I am just putting one of my posted replies to you.

1)You can use the program BSP_UPDATE_MIMEREPOS to upload the photos in the mime repository.

2)Use the following code to get the content from your mime and set the content to your interactive UI element as Xstring format.

data:

mime_repository type ref to if_mr_api,

content type xstring,

url type string value '/SAP/BC/BSP/SAP/myBSPapplication/rajkumar.jpg' .

mime_repository = cl_mime_repository_api=>get_api( ).

call method mime_repository->get

exporting

i_url = url

importing

e_content = content.

wd_context->set_attribute( name = 'DATAS' value = content ).

Thanks,

Rajkumar.S