2014 Nov 13 9:42 AM
Hello everyone,
I m trying to display image on screen with CL_GUI_PICTURE. Additionally, the image is stored in database as RAWSTRING.
I have tried using DP_CREATE_URL to create a published URL for image. Below is the code snippet which is not working. On the other hand, I am able to display image uploaded via SE78 so the container usage is fine.
TYPES: BEGIN OF ts_hex,
hex TYPE xstring,
END OF ts_hex.
data: lt_pic type table of ts_hex,
ls_pic type ts_hex.
select single * into ls_table_row from <images_table>.
ls_pic-hex = ls_table_row-image_hex.
append ls_pic to lt_pic.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = cndp_sap_tab_unknown
TABLES
data = lt_pic
CHANGING
url = lv_url.
CALL METHOD lo_picture->load_picture_from_url_async
EXPORTING
url = lv_url.
Hello everyone,
I m trying to display image on screen with CL_GUI_PICTURE. Additionally, the image is stored in database as RAWSTRING.
I have tried using DP_CREATE_URL to create a published URL for image. Below is the code snippet which is not working. On the other hand, I am able to display image uploaded via SE78 so the container usage is fine.
TYPES: BEGIN OF ts_hex,
hex TYPE xstring,
END OF ts_hex.
data: lt_pic type table of ts_hex,
ls_pic type ts_hex.
select single * into ls_table_row from <images_table>.
ls_pic-hex = ls_table_row-image_hex.
append ls_pic to lt_pic.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = cndp_sap_tab_unknown
TABLES
data = lt_pic
CHANGING
url = lv_url.
CALL METHOD lo_picture->load_picture_from_url_async
EXPORTING
url = lv_url.
2014 Nov 13 12:05 PM
Hi,
Provide graphic size also in below function module.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
TYPE = 'IMAGE'
SUBTYPE = 'X-UNKNOWN'
SIZE = GRAPHIC_SIZE
LIFETIME = 'T'
TABLES
DATA = GRAPHIC_TABLE
CHANGING
URL = URL.
Thanks,
Ashok.
2014 Nov 13 2:10 PM
Hi Ashok,
Thank you for your reply. Now program gives a short dump but I don't know what is going wrong.
Dump details:
Program SAPLOLEA
Include LOLEAU10
Row 371
Module Type (FUNCTION)
Module Name AC_FLUSH_CALL_INTERNAL
Actual code:
CREATE OBJECT lo_custom_container
EXPORTING
container_name = 'CUSTOM_CONTAINER'.
CREATE OBJECT lo_picture
EXPORTING
parent = lo_custom_container.
READ TABLE gt_pics INTO ls_image index 1.
ls_pic_data-text = ls_image-picture.
APPEND ls_pic_data TO lt_pic_data.
lv_size = xstrlen( ls_pic_data-text ).
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'X-UKNOWN'
size = lv_size
lifetime = 'T'
TABLES
data = lt_pic_data
CHANGING
url = lv_logo_url.
CALL METHOD lo_picture->load_picture_from_url
EXPORTING
url = lv_logo_url.
2014 Nov 13 3:45 PM
2014 Nov 14 4:56 AM
Yes, it is one image per row. The data is something like this (this is not the entire field value as there are limitations to SE16)
75AB5A8A66A07BF8E97A06DAB1EEB8FFD8FFE000104A46494600010100000100010000FFDB00
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |