Application Development 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: 

Upload and display image

Former Member
0 Kudos

How can I upload a picture and save it in a customer table?

Is it possible to browse for the image and then after selecting it, display it on the screen?

2 REPLIES 2

former_member223537
Active Contributor
0 Kudos

Hi,

You can use transaction SMWO- binary data-> F8->Execute->New.

The object name should be stored in Table.

And you can retrieve the IMAGE through object name using this FM :

CHECK l_url IS INITIAL.

REFRESH query_table.

query_table-name = '_OBJECT_ID'.

query_table-value = l_illustno.

APPEND query_table.

CALL FUNCTION 'WWW_GET_MIME_OBJECT'

TABLES

query_string = query_table

html = html_table

mime = pic_data

CHANGING

return_code = return_code

content_type = content_type

content_length = content_length

EXCEPTIONS

object_not_found = 1

parameter_not_found = 2

OTHERS = 3.

IF sy-subrc = 0.

pic_size = content_length.

ENDIF.

CALL FUNCTION 'DP_CREATE_URL'

EXPORTING

type = 'image'

subtype = 'X-UNKNOWN'

size = pic_size

lifetime = 'T'

TABLES

data = pic_data

CHANGING

url = l_url

EXCEPTIONS

OTHERS = 1.

CHECK NOT l_url IS INITIAL.

CALL METHOD pict1->load_picture_from_url

EXPORTING

url = l_url

EXCEPTIONS

error = 1

OTHERS = 2.

Best regards,

Prashant

sbhutani1
Contributor
0 Kudos

Hi adrian,

You can use tcode DWDM and then select controls -> picture control -> screen display

here you will get all the picture related queries answered

Regards

Sumit Bhutani

Ps reward points if helpful