Skip to Content
0
Dec 18, 2007 at 11:51 AM

displayin document in Smartform

16 Views

Hi everyone.

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

EXPORTING

IS_OBJECT = wa_met

  • IP_LOGSYS =

IT_RELATION_OPTIONS = I_RANGE

  • IP_ROLE =

  • IP_PROPNAM =

IP_NO_BUFFER = SPACE

IMPORTING

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'

EXPORTING

DOCUMENT_ID = V_DOC

  • FILTER = 'X '

IMPORTING

DOCUMENT_DATA = v_data

TABLES

  • OBJECT_HEADER =

OBJECT_CONTENT = I_CON

  • OBJECT_PARA =

  • OBJECT_PARB =

  • ATTACHMENT_LIST =

  • RECEIVER_LIST =

CONTENTS_HEX = I_HEX

EXCEPTIONS

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.

ENDIF.

call GUI_download.