10-09-2007 6:27 AM
hi gurus
I have used function module CONVERT_ABAPSPOOLJOB_2_PDF for converting spool to pdf format , now i need to send email using methods and class ( not with FM SO_DOCUMENT_SEND_API1 ) .
iam useing
TRY.
-------- create persistent send request ------------------------
send_request = cl_bcs=>create_persistent( ).
CALL METHOD document->add_attachment
EXPORTING i_attachment_type = 'RAW'
i_attachment_subject = 'My attachment'
<b> i_att_content_hex = gti_contents_hex.</b>
CALL METHOD send_request->set_document( document ).
sender = cl_sapuser_bcs=>create( sy-uname ).
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
recipient = cl_cam_address_bcs=>create_internet_address(
'sudheer.kumar@eds.com' ).
add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'.
CALL METHOD send_request->set_send_immediately( 'X' ).
---------- send document ---------------------------------------
CALL METHOD send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = sent_to_all ).
IF sent_to_all = 'X'.
WRITE text-003.
ENDIF.
COMMIT WORK.
CATCH cx_bcs INTO bcs_exception.
WRITE: 'Fehler aufgetreten.'(001).
WRITE: 'Fehlertyp:'(002), bcs_exception->error_type.
EXIT.
ENDTRY.
In the above code iam unable to convert pdf( out put of FM) out to gti_contents_hex.
rewarded with points
10-09-2007 6:36 AM
Hi,
plz check the below link..
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
reward if helpful.
Regards,
Nagaraj
10-09-2007 6:57 AM
hi nagraj
I have implemented using function module that u have sent me,
but i want the same one useing methods and classes.