‎2009 Jun 30 5:44 AM
Hi,
I'm sending email with pdf attachment using cl_document_bcs, the problem I'm having right now is I need change the layout of the PDF. I'm not able to find any parameter.
Thanks,
Mawi
‎2009 Jun 30 6:23 AM
Hi
Follow the following steps
1) * Converting data to PDF.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = u2018PDFu2019
IMPORTING
bin_filesize = lv_len_in ( which is a variable of type SOOD-OBJLEN )
TABLES
otf = t_otfdata
lines = lt_tline
2.Function Module: QCE1_CONVERT
Input the LT_LINE Table obtained from CONVERT_OTF FM.
This FM returns a table which contains the actual output in PDF
format(LT_OBJBIN).
CALL FUNCTION 'QCE1_CONVERT'
TABLES
t_source_tab = lt_tline
t_target_tab = lt_objbin
3) Call the FM to send the E-mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lw_doc_chng
put_in_outbox = u2018Xu2019
TABLES
packing_list = lt_objpack
object_header = lt_objhead
contents_bin = lt_objbin
contents_txt = lt_objtxt
receivers = lt_reclist
Go to Transaction : SBWP
Click on the Outbox to check if the mail is sent to the address mentioned
Internal table mention in FM fill as follows
lt_reclist-receiver = "Mail id
lt_reclist-rec_type = u2018Uu2019. "External Address
APPEND lt_reclist.
lt_objhead = "Name"u2019.(Name of the PDF attachment)
APPEND lt_objhead.
Hope it works!
Thanks
Shambhu