Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem with pdf as email attachment

Hi All,

when i am opening the pdf file(email attachment), getting the error "file type not support or content conversion....."

the peice of code is as followed...

IF p_email = 'X'.

CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'

EXPORTING

rqident = mi_rqident (spool number)

TABLES

buffer = l_contents.

IF l_contents IS NOT INITIAL.

CALL FUNCTION 'SO_SOLITAB_TO_SOLIXTAB'

EXPORTING

ip_solitab = l_contents

IMPORTING

ep_solixtab = contents_hex.

  • Create the send request

TRY.

l_send_request = cl_bcs=>create_persistent( ).

  • Create the main document

l_doc = cl_document_bcs=>create_document(

i_type = 'RAW'

i_text = l_text

i_subject = p_sub ).

  • Add attachment to document

l_doc->add_attachment( i_attachment_type = 'PDF'

i_attachment_subject = p_doc

  • i_att_content_text = contents_text ).

i_att_content_hex = contents_hex ).

  • Add document to send request

l_send_request->set_document( l_doc ).

  • Add recipients to send request

l_recipient = cl_cam_address_bcs=>create_internet_address(

p_email1-low ).

l_send_request->add_recipient( i_recipient = l_recipient ).

  • Send email

l_sent_all = l_send_request->send( ).

and other way also i tried, please let me know the solution.

thanks in advance

Tags:
Not what you were looking for? View more on this topic or Ask a question