Skip to Content
-3

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

Feb 20 at 08:26 PM

195

avatar image
Former Member

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 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Pratik Kasralikar Feb 20 at 08:37 PM
1

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.

Show 5 Share
10 |10000 characters needed characters left characters exceeded

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

0
Former Member

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

use LOAD_PICTURE_FROM_URL method

0
Former Member

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

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
Sandra Rossi Feb 20 at 10:01 PM
0

Also the CL_GUI_HTML_VIEWER control (web browser wrapper).

Share
10 |10000 characters needed characters left characters exceeded
Horst Keller
Feb 21 at 08:09 PM
0
Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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

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".

0