Skip to Content

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

spool to pdf to email

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

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