Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

pdf through email

Former Member
0 Kudos

hi,

i am sending an adobeform as pdf in an email body to an external address.ie. i need an output in my outlook account as : an email with PDF document as the body of the Email.

Problem --> I am getting the PDF as an attachment always.

here is my code

TRY.

send_request = cl_bcs=>create_persistent( ).

lp_pdf_size = XSTRLEN( ls_formoutput-pdf ).

pdf_content = cl_document_bcs=>xstring_to_solix(

ip_xstring = ls_formoutput-pdf ).

document = cl_document_bcs=>create_document(

i_type = 'PDF'

i_hex = pdf_content

i_length = lp_pdf_size

i_subject = 'test created by BCS_EXAMPLE_6' ). "#EC NOTEXT

send_request->set_document( document ).

recipient = cl_cam_address_bcs=>create_internet_address(

i_address_string = p_email ).

send_request->add_recipient( i_recipient = recipient ).

sent_to_all = send_request->send(

i_with_error_screen = 'X' ).

can someone help here

Thanks

2 REPLIES 2

Former Member
0 Kudos

Hi,

check the link , i think u will get a solution

link :

https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/convertSmartformtoPDFformat

Reards ,

Sachhi

Former Member
0 Kudos

TRy this FM, CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

Regards,

Joan