I am using the following code to read an attachment .
At the end of this code i'm using GUI_DOWNLOAD to download the data read from attachment into my system as a word document say filename C:\ XYZ.doc .This is working fine giving the right output
But My requirement is to display that document in the main window of smartform output.
what should i do after reading to display the attachment in smartform ? Is it required to Use GUI_DOWNLOAD and then read again and display in smartform?
CALL METHOD CL_BINARY_RELATION=>READ_LINKS_OF_BINRELS
IS_OBJECT = wa_met
IT_RELATION_OPTIONS = I_RANGE
IP_NO_BUFFER = SPACE
ET_LINKS = lt_old_links1
ET_ROLES = lt_roletypes1.
READ TABLE lt_roletypes1 into wa_role INDEX 2.
V_DOC = WA_ROLE-INSTID.
CALL FUNCTION 'SO_DOCUMENT_READ_API1'
DOCUMENT_ID = V_DOC
FILTER = 'X '
DOCUMENT_DATA = v_data
OBJECT_CONTENT = I_CON
CONTENTS_HEX = I_HEX
DOCUMENT_ID_NOT_EXIST = 1
OPERATION_NO_AUTHORIZATION = 2
X_ERROR = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.