cancel
Showing results for 
Search instead for 
Did you mean: 

Sending SAP Script output as a PDF attachment through mail

Former Member
0 Kudos

Dear Guru,

I am using SAP 4.0B version, DATABASE Oracle 8i, OS is sun solaris 7.5.

I want to send SAP script output as a

PDF attachement through mail.Please suggest a solution.

Regards,

Rajesh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Rajesh,

In your print program, while calling OPEN_FORM, pass options-TDGETOTF = 'X'. This is used for returning print output in OTF format.

Then in CLOSE_FORM, get the table OTFDATA returned from the function module. for example


DATA: OTF_DATA LIKE ITCOO OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'CLOSE_FORM'
      IMPORTING
        RESULT  = RESULT
      TABLES
        OTFDATA = OTF_DATA.

now you can convert this OTF data to PDF using function module CONVERT_OTF

Then send this data as attachment to a mail using function module SO_NEW_DOCUMENT_ATT_SEND_API1

Regards,

Komal.

Former Member
0 Kudos

Refer to the code in the following link:

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

Regards

Kiran Sure