Skip to Content

Reg: sending smartform output as PDF attachment

hii all,

i am using 'SX_OBJECT_CONVERT_OTF_PDF' func. module to convert my otf data to pdf and using the func. module 'SO_NEW_DOCUMENT_ATT_SEND_API1' for sending the mail with the PDF attachment. I am able to send the mail and i can see the mail attachment in my out box of business work place..i can open the attachment and read it. but after i sent the mail to other e-mail if i open the document..it is showing as the attachment file is corrupted and i am unable to read it.

can any one help me on this.

Edited by: sandeep akella on Dec 13, 2008 9:54 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    Posted on Dec 13, 2008 at 09:00 AM

    Refer:

    [Issue smart form output to Email as PDF attachment|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/8613] [original link is broken] [original link is broken] [original link is broken];

    [Email: PDF FIle is damaged|email-pdf-file-is-damaged;

    Add a comment
    10|10000 characters needed characters exceeded

    • hii all,

      I am able to send the mail but when iam opening the file in the email attachment iam unable to open it. i am using the func. modules which automatically give me the data in the 'SOLIX' line type.Also, i am able to read the pdf attachment in my outbox of 'business work place', but it is getting corrupted when i want to read it in the mail box of the receipent.

      with regards,

      sandeep akella.

  • Posted on Dec 13, 2008 at 12:41 PM

    hii all,

    When we fill the packing llist for sending the sending the smartform as mail we mention the parameter PACKING_LIST-DOC_TYPE as 'PDF' which as a value table in its domain . tabel name is 'TSOTD'(desc : Valid Object Types) .

    while creating the pack for mail text we define the doc_type as RAW whichis present in the check table, but while creating the pack for PDF attachment we give the parameter as "PDF' which is not there in the database table. do we need to maintain the object type "PDF" to send the smartform as PDF attachment.the error i am facing is that i am able to send mail but the receipient is unable to read it as the file is corrupted.

    also can any one tell me , if it is requried , where to maintian the DOC_TYPE .

    with regards,

    sandeep akella.

    Edited by: sandeep akella on Dec 15, 2008 4:49 AM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 15, 2008 at 04:25 AM
    * Transfer the 132-long strings to 255-long strings
        LOOP AT gt_pdf_output INTO wa_pdf_output.
          TRANSLATE wa_pdf_output USING '~'.
          CONCATENATE v_buffer wa_pdf_output INTO v_buffer.
        ENDLOOP.

    * TO CONVERT THE DATA INTO PDF FORMAT
        TRANSLATE v_buffer USING '~'.
    
        CLEAR : wa_messg_att,
                gt_messg_att.
    
        DO.
          wa_messg_att = v_buffer.
          APPEND wa_messg_att TO gt_messg_att.
          SHIFT v_buffer LEFT BY 255 PLACES.
          IF v_buffer IS INITIAL.
            EXIT.
          ENDIF.
          CLEAR wa_messg_att.
        ENDDO.

    For the body of the email message, pass doc type as RAW

    for the PDF attachment pass doc type as PDF

    So the internal table for Packing List

    * Describe the body of the message
      lwa_packing_list-transf_bin = space.
      lwa_packing_list-head_start = 1.
      lwa_packing_list-head_num   = 0.
      lwa_packing_list-body_start = 1.
      DESCRIBE TABLE gt_messg_body LINES lwa_packing_list-body_num.
      lwa_packing_list-doc_type = 'RAW'.
      APPEND lwa_packing_list TO lgt_packing_list.
      CLEAR lwa_packing_list.
    
    
    * Create attachment notification
      lwa_packing_list-transf_bin = 'X'.
      lwa_packing_list-head_start = 1.
      lwa_packing_list-head_num   = 1.
      lwa_packing_list-body_start = 1.
    
      DESCRIBE TABLE gt_messg_att LINES lwa_packing_list-body_num.
      lwa_packing_list-doc_type   =  'PDF'.
      lwa_packing_list-doc_size   =  lwa_packing_list-body_num * 255.
      APPEND lwa_packing_list TO lgt_packing_list.

    Add a comment
    10|10000 characters needed characters exceeded

    • hello all,

      yes the settings in the SCOT tr. are as follows in my system

      SAPscript/Smart Forms - PDF

      ABAP List -htm

      Business Object/Link - txt

      RAW Text -txt

      i am converting the output of a smartform to PDF using the function module "SX_OBJECT_CONVERT_OTF_PDF" which gives me the output in format "SOLIX_TAB" which is 255 char one taht is req. for mailing , from the changing parameter of the func. module "CONTENT_BIN" . i am passing this to the func.module "SO_NEW_DOCUMENT_ATT_SEND_API1" through tables parameter "contents_hex". I am abel to send the mail but , my receipient is unable to read the attached PDF file. But in the outbox of business work place i am able to read the mail(the PDF attachment).

      with regards,

      sandeep akella.

      Edited by: sandeep akella on Dec 15, 2008 7:14 AM

  • Posted on Dec 18, 2008 at 06:14 AM

    got the solution the func. module that i am using for conversion of otf data to PDF, i am having problem in using it.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.