Skip to Content
avatar image
Former Member

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

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 09, 2007 at 05:36 AM

    Hi,

    plz check the below link..

    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm

    reward if helpful.

    Regards,

    Nagaraj

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      hi nagraj

      I have implemented using function module that u have sent me,

      but i want the same one useing methods and classes.