‎2010 Aug 04 1:13 AM
Hi,
I am calling the CL_BCS class to send the PDF mail.The below are the points i have coded.
1) From Script close_form get the OTF data and convert the Otf data to PDF using callfunction Convert_otf.
2) Then using the CALL METHOD cl_document_bcs=>xstring_to_solix converting xstring data to PDF.
/ Creates persistent send request
TRY.
l_send_request = cl_bcs=>create_persistent( ).
*/ Creating Document
concatenate VBRK-VKORG 'delivery note' VBRP-VGBEL '-XXX' into subject separated by space.
l_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_subject = subject
i_text = i_content[] ).
i_attach_pdf[] = lt_mess_att[].
*/ Get the Total Number of Lines.
DESCRIBE TABLE i_attach_pdf[] LINES l_lines.
*/ Size to multiplied by 2 for UNICODE enabled systems
l_size = l_lines * 2 * 255.
*/ Adding Attachment
*CALL METHOD l_document->add_attachment*
EXPORTING
i_attachment_type = 'PDF'
i_attachment_size = l_size
i_attachment_subject = 'OSCS Commercial Invc'
i_att_content_hex = i_attach_pdf[] ...
In the above method CALL METHOD l_document->add_attachment it is giving the exception,it has worked well before some patches are applied to the system Now it is throwing an exception.is there any SAP note is available for the same or is there any bug in my code.
Thanks
Kiran
‎2010 Aug 04 1:33 AM
Hi,
the PDF is in binary form so I don't understand why you multiply size by two. Have you tried with lines * 255. What exception do you get? You can debug that method to see what error is returned by FM SO_ATTACHMENT_INSERT_API1.
Cheers