Skip to Content
1
Jan 21, 2016 at 12:42 PM

Read content from file using "SO_DOCUMENT_READ_API1"

1666 Views

Read content from file using "SO_DOCUMENT_READ_API1"

Gibes the junk chars

Sending mail invoice mail

We have the some Attachments In sales order .

we have some attachments(Service Ojects) in invoices (vf01) . hose files(PDF,DOC etc etc)

so FM SO_DOCUMENT_READ_API1 to get the document content PDF,DOC etc etc) contents coming in internal table are in unreadable form.


CALL FUNCTION 'SO_DOCUMENT_READ_API1'

EXPORTING

document_id = l_doc_id

* FILTER = 'X '

* IMPORTING

* DOCUMENT_DATA =

TABLES

object_header = lt_object_header

object_content = lt_object_content " ----->> PDF content in unreadable form(to be read)

* OBJECT_PARA =

* OBJECT_PARB =

* ATTACHMENT_LIST =

* RECEIVER_LIST =

contents_hex = lt_contents_hex

* EXCEPTIONS

* DOCUMENT_ID_NOT_EXIST = 1

* OPERATION_NO_AUTHORIZATION = 2

* X_ERROR = 3

* OTHERS = 4

Now gain I am sending this as attachment in the mail using the function module SO_DOCUMENT_SEND_API1 send this to contents_bin = it_ content as contents of aatched file but in mail I am getting the junk characters. While triggering the I am filling the file type also .

In packing_list = it_plist I am also sending the document type in the field DOC_TYPE.