cancel
Showing results for 
Search instead for 
Did you mean: 

displayin document in Smartform

gautam_totekar
Active Participant
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

vinothkumar_g
Advisor
Advisor
0 Kudos

Hi Gautam,

My requirement is of similar type .. using call function Gui_downoad i downloaded the attachments to desktop. but the file is not opening properly. it opens in some other format..

can you help me in this regard..

thanks.

vinoth