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'
document_id = l_doc_id
* FILTER = 'X '
* DOCUMENT_DATA =
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
* 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.