Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reg: sending smartform output as PDF attachment

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

former_member181995
Active Contributor
0 Kudos

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|;

9 REPLIES 9

former_member181995
Active Contributor
0 Kudos

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|;

0 Kudos

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.

Former Member
0 Kudos

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

former_member223537
Active Contributor
0 Kudos
* 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.

0 Kudos

hello all,

I have done all that is requried, but my problem is that the receipient is unable to read the mail , after my initial checking i found that in TOSTD which is the check table for 'packing_list-doc_type'.

The type "RAW" is maintained but in my table "PDF" is not maintained, if this is the reason for which my receipient is unable to read the mail...can any one tell me how to rectify this problem,i.e how to maintain the doc_type PDF in the table 'TSOTD".

with regards,

sandeep akella.

Edited by: sandeep akella on Dec 15, 2008 6:15 AM

0 Kudos

0 Kudos

Hi Sandeep,

Check this setting in TCODE SCOT. Double click on connection SMTP , Click on Set against internet.

Check the output formats for SAP documents

SAPscript/Smart Forms - PDF

ABAP List - HTM

Business Object/Link - HTm

RAW Text - TXT

Is this OTF data from the spool ?

Regards

0 Kudos

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

Former Member
0 Kudos

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