cancel
Showing results for 
Search instead for 
Did you mean: 

Display of Image in table

Former Member
0 Kudos

Hi,

I need to display Attachments(Image file) from material into table based on the material.

I have got the content of the image in hexadecimal form but now I am not able to show the image as image in table control.

Kindly help me on this.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,

store the image data as xstring in database.

while fetching convert the xstring data to url...

*************************************************************************************
*******CONVERTING XSTRING TO URL.

 
DATA: W_FILE TYPE XSTRING.

W_FILE = LS_IMAGE-IDATA."xstring data which is fetched frm database

DATA:URL TYPE STRING,
GUID TYPE GUID_32,
CACHED_RESPONSE TYPE REF TO IF_HTTP_RESPONSE.

CREATE OBJECT CACHED_RESPONSE
TYPE
CL_HTTP_RESPONSE
EXPORTING
ADD_C_MSG = 1.

* SET IMAGE TO MIME
CACHED_RESPONSE->SET_DATA( W_FILE ).
CACHED_RESPONSE->SET_HEADER_FIELD(
NAME = IF_HTTP_HEADER_FIELDS=>CONTENT_TYPE
VALUE = 'IMAGE/PJPEG' ).

CACHED_RESPONSE->SET_STATUS( CODE = 200 REASON = 'OK' ).
CACHED_RESPONSE->SERVER_CACHE_EXPIRE_REL( EXPIRES_REL =
180 ).

CALL FUNCTION 'GUID_CREATE'
IMPORTING
EV_GUID_32 = GUID.

CL_WD_UTILITIES=>CONSTRUCT_WD_URL( EXPORTING
APPLICATION_NAME = 'ZTEST1' "WEBDYNPRO APPLICATION NAME
IMPORTING OUT_LOCAL_URL = URL ).

CONCATENATE URL '/' GUID SY-UZEIT INTO URL.
CL_HTTP_SERVER=>SERVER_CACHE_UPLOAD(
URL = URL
RESPONSE = CACHED_RESPONSE ).


*******************************************************************************
***************SETTING THE NODE URL.
"set the node url of the image .
LO_EL_IMAGE->SET_ATTRIBUTE(
EXPORTING
NAME =  `URL`
VALUE = URL ).

Former Member
0 Kudos

Hi,

Refer this document

http://scn.sap.com/docs/DOC-2373

Former Member
0 Kudos

Hi Usha,

In this example they are getting image through MIME object, but how do we get Image dynamically in table.

former_member184578
Active Contributor
0 Kudos

Hi,

You can save the images in database. (field type RAWSTRING) and create an attribute of type XSTRING. Fetch the image from DB and set it to that attr..

Hope This helps u.,

Regards,

Kiran.