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: 

How to display an image in container saved in xstring format in custom table?

Former Member
0 Kudos

I have uploaded an image from wda application and saved in custom table using 3 fields-

Filename/Filedata(xstring)/Mimetype-

Same file i am able to download in wda application using--

wdr_task=>client_window->client->attach_file_to_response( i_filename = lv_name
i_content = ls_file_upload-file
i_mime_type = lv_mime ).

How can i display/download this xstring in container- Report/Mod. Pool?

Its easy to get this done via MIME object (saving data) or uploading in se78 but i want to pickk up dynamic image saved through wda app?

10 REPLIES 10

kasralikarpratik
Explorer

Use class CL_GUI_PICTURE and declare reference for your custom container.

Create URL for your XSTRING using FM DP_CREATE_URL.

and call method for your custom container LOAD_PICTURE_FROM_URL using URL generated from first step.

0 Kudos

(BMP, JPG, GIF are the only accepted formats)

0 Kudos

I have tried it but no image is coming, container i sblank-

CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'JPG'
TABLES
data = lt_data
CHANGING
url = lv_url.

lo_picture->load_picture_from_url_async( lv_url ).

Please suggest

0 Kudos

I am having xstring saved in ztable not in Mime.

So fetching this string and using it to create URL but no image is coming.

I have tried it but no image is coming, container i sblank-

CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'JPG'
TABLES
data = lt_data
CHANGING
url = lv_url.

lo_picture->load_picture_from_url_async( lv_url ).

Please suggest

0 Kudos

As told in the answer, use LOAD_PICTURE_FROM_URL, not the one ASYNC.

Your LT_DATA is probably not initialized well.

See demo program RSDEMO_PICTURE_CONTROL.

0 Kudos

use LOAD_PICTURE_FROM_URL method

Sandra_Rossi
Active Contributor
0 Kudos

Also the CL_GUI_HTML_VIEWER control (web browser wrapper).

horst_keller
Product and Topic Expert
Product and Topic Expert

0 Kudos

I am having xstring saved in ztable not in Mime.

So fetching this string and using it to create URL but no image is coming.

0 Kudos

Please stop adding new "answers". An "answer" is intended to provide a solution to the original question. Instead, add "comments" to the answers. A "comment" is a reply to a given solution. You have a menu to convert your "answers" into "comments".