on 03-22-2012 7:58 AM
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.
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 ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.