To send the Payload as PDF Attachment in mail in PI 7.1

Hi All,
I have to send a file as PDF attachment using a mail adapter. I gave the Content_Type as 'application.pdf'. I am receiving the mail, but I am unable to open the PDF. It says 'Could not open because the type is not supported or unable to decode'. How do I resolve this?
Thanks,
Geetha

Hi,
You need to perform the conversion usign the PayloadSwapBean in the  Module tab.
Please refer to the following link
/people/sravya.talanki2/blog/2006/11/28/e-mail-xml-messages-in-pdf-format-from-sap-xi
http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/cd/5af7c0c994e24fb0d0088443513de2/content.htm
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/57/0b2c4142aef623e10000000a155106/frameset.htm
hope this helps,
Regards,
Bhanu
Edited by: nanduri bhanu on May 21, 2009 5:21 AM

Similar Messages

  • Problem in sending the file as an attachment through mail

    Hi,
    I have developed a Zreport. The functionality is like on executing this report it should send an e-mail with an attachment of the data in the xcel format.
    So, while execting this report in background mode in ECC 5.0, it is able to send the mail as an attachment but the file doesn't contain the data in it But, the same report while trying to execute in back ground mode in ECC 6.0, it is able to send the mail with the attachment and the file also has the data.
    So, my question is like are there any patches that has to be installed in ECC 5.0 system to get this successfully done.
    Thanks in advance for your answers.
    Rohith

    Hello,
    Are you using the standad sap function module or using OLE objects to generate excel?
    First try creating the excel file in foreground and see if the data is being populated.
    Kind Regards,
    Niky.

  • Send RFQ as an PDF attachment through mail

    Hi All,
      I wanna send the quotation format to multiple vendors in PDF through mail.
    I have developed RFQ using smartforms.
    Please lemme know how to do this and wat r the steps to be taken.
    Regards,
    Priya

    Hello,
    you only need to convert your smartform into PDF and next send.
    The sending can be seen for example here:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c2567f2b-0b01-0010-b7b5-977cbf80665d
    or you can just search for the sending code, you will find something like this:
    http://monoceros85.blogspot.com/2009/04/send-email-in-abap-using-class-clbcs.html
    Email using cl_bcs
    Or direct example is here:
    Multiple PDF attachments using CL_BCS Class
    Regards, Otto
    p.s.: please search the next time first and ask later

  • Sending smartform output as PDF attachment, Error opening PDF attachment

    Hi Experts,
    I am using the code form the following link to send a smartform output as PDF attachment. I can able to see the message, but can not open PDF document.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/convertSmartformtoPDFformat&
    The information should be on my smartform are some text, company logo and a barcode.
    With all of these received error: "There was an error opening this document. The file is damaged and could not be repaired."
    I tried different ways like only text, text with company logo, text with barcode. I got the following errors:
    An unrecognized token 'Td0' was found
    There was problem reading this document(16).
    There was problem reading this document(111).
    Does anyone have idea of these ? Your help is greatly appreciated.
    Thank you,
    Surya

    please see this code  ...  for sending the  Email as  PDF attach file,
    *& Report  ZSPOOLTOPDF                                                 *
    *& Converts spool request into PDF document and emails it to           *
    *& recipicant.                                                         *
    *& Execution                                                           *
    *& This program must be run as a background job in-order for the write *
    *& commands to create a Spool request rather than be displayed on      *
    *& screen                                                              *
    REPORT  zspooltopdf.
    PARAMETER: p_email1 LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_sender LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_delspl  AS CHECKBOX.
    *DATA DECLARATION
    DATA: gd_recsize TYPE i.
    * Spool IDs
    TYPES: BEGIN OF t_tbtcp.
            INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
          wa_tbtcp TYPE t_tbtcp.
    * Job Runtime Parameters
    DATA: gd_eventid LIKE tbtcm-eventid,
          gd_eventparm LIKE tbtcm-eventparm,
          gd_external_program_active LIKE tbtcm-xpgactive,
          gd_jobcount LIKE tbtcm-jobcount,
          gd_jobname LIKE tbtcm-jobname,
          gd_stepcount LIKE tbtcm-stepcount,
          gd_error    TYPE sy-subrc,
          gd_reciever TYPE sy-subrc.
    DATA:  w_recsize TYPE i.
    DATA: gd_subject   LIKE sodocchgi1-obj_descr,
          it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_sender_type     LIKE soextreci1-adr_typ,
          gd_attachment_desc TYPE so_obj_nam,
          gd_attachment_name TYPE so_obj_des.
    * Spool to PDF conversions
    DATA: gd_spool_nr LIKE tsp01-rqident,
          gd_destination LIKE rlgrap-filename,
          gd_bytecount LIKE tst01-dsize,
          gd_buffer TYPE string.
    * Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
            INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
               c_no(1)     TYPE c   VALUE ' ',
               c_device(4) TYPE c   VALUE 'LOCL'.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * Write statement to represent report output. Spool request is created
    * if write statement is executed in background. This could also be an
    * ALV grid which would be converted to PDF without any extra effort
      WRITE 'Hello World'.
      new-page.
      commit work.
      new-page print off.
      IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
    *** Alternative way could be to submit another program and store spool
    *** id into memory, will be stored in sy-spono.
    *submit ZSPOOLTOPDF2
    *        to sap-spool
    *        spool parameters   %_print
    *        archive parameters %_print
    *        without spool dynpro
    *        and return.
    * Get spool id from program called above
    *  IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
        PERFORM convert_spool_to_pdf.
        PERFORM process_email.
        if p_delspl EQ 'X'.
          PERFORM delete_spool.
        endif.
        IF sy-sysid = c_dev.
          wait up to 5 seconds.
          SUBMIT rsconn01 WITH mode   = 'INT'
                          WITH output = 'X'
                          AND RETURN.
        ENDIF.
      ELSE.
        SKIP.
        WRITE:/ 'Program must be executed in background in-order for spool',
                'request to be created.'.
      ENDIF.
    *       FORM obtain_spool_id                                          *
    FORM obtain_spool_id.
      CHECK NOT ( gd_jobname IS INITIAL ).
      CHECK NOT ( gd_jobcount IS INITIAL ).
      SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                     AND        jobcount    = gd_jobcount
                     AND        stepcount   = gd_stepcount
                     AND        listident   <> '0000000000'
                     ORDER BY   jobname
                                jobcount
                                stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
      IF sy-subrc = 0.
        message s004(zdd) with gd_spool_nr.
        gd_spool_nr = wa_tbtcp-listident.
        MESSAGE s004(zdd) WITH gd_spool_nr.
      ELSE.
        MESSAGE s005(zdd).
      ENDIF.
    ENDFORM.
    *       FORM get_job_details                                          *
    FORM get_job_details.
    * Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    ENDFORM.
    *       FORM convert_spool_to_pdf                                     *
    FORM convert_spool_to_pdf.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    * Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
    *       FORM process_email                                            *
    FORM process_email.
      DESCRIBE TABLE it_mess_att LINES gd_recsize.
      CHECK gd_recsize > 0.
      PERFORM send_email USING p_email1.
    *  perform send_email using p_email2.
    ENDFORM.
    *       FORM send_email                                               *
    *  -->  p_email                                                       *
    FORM send_email USING p_email.
      CHECK NOT ( p_email IS INITIAL ).
      REFRESH it_mess_bod.
    * Default subject matter
      gd_subject         = 'Subject'.
      gd_attachment_desc = 'Attachname'.
    *  CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      it_mess_bod        = 'Message Body text, line 1'.
      APPEND it_mess_bod.
      it_mess_bod        = 'Message Body text, line 2...'.
      APPEND it_mess_bod.
    * If no sender specified - default blank
      IF p_sender EQ space.
        gd_sender_type  = space.
      ELSE.
        gd_sender_type  = 'INT'.
      ENDIF.
    * Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_mess_bod
                                          it_mess_att
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'PDF'
                                          gd_attachment_name
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 changing gd_error
                                          gd_reciever.
    ENDFORM.
    *       FORM delete_spool                                             *
    FORM delete_spool.
      DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
      ld_spool_nr = gd_spool_nr.
      CHECK p_delspl <> c_no.
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
           EXPORTING
                spoolid = ld_spool_nr.
    ENDFORM.
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    *       Send email
    FORM send_file_as_email_attachment tables it_message
                                              it_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
    data:   t_packing_list like sopcklsti1 occurs 0 with header line,
            t_contents like solisti1 occurs 0 with header line,
            t_receivers like somlreci1 occurs 0 with header line,
            t_attachment like solisti1 occurs 0 with header line,
            t_object_header like solisti1 occurs 0 with header line,
            w_cnt type i,
            w_sent_all(1) type c,
            w_doc_data like sodocchgi1.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    * Fill the document data.
      w_doc_data-doc_size = 1.
    * Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    * Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    * Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    * Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    * Populate zerror return code
      ld_error = sy-subrc.
    * Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    reward  points  if it is usefull ....
    Girish

  • Sending an email of the layout in PDF attachement

    Hello All,
    I have written a program to send the layout in PDF format to send in a mail to the customer.
    The email is going fne with the PDF attachement in the development box, but it is not working in Quality box.
    In the Quality box the email is going but the attachement is not opening.
    I have used CONVERT_OTF function module for converting OTF format to PDF format. As per my analysis it is returning the PDF format properly in Developement box but not the same in Quality. In Quality the the data returning in PDF format is not in proper manner. It is giving some junk data with symbols like traingle, rectange..etc..
    I am using FM SO_OBJECT_SEND for sending an email.
    Can you please suggest me what may be problem?
    Valuable answers will be rewarded.
    Thanks & Regards,
    Satish.

    Hi,
    you need to save the File in PDF format not in the text format.
    check whether the file is saved in pdf format or not.
    Regards,
    Raj.

  • Send pages document as pdf attachment without including the whole document in the message

    What I am trying to do is to write a document in pages then send it as a pdf attachment which shows as a mail icon in the mail message.  One then clicks on the icon and the attached file opens.  Seems I can do it if I send it as a word doc but every time I try and send it as a PDF the whole document shows up in the email body....
    Is there something I am not doing?
    Thanks
    Bryan

    Hi Gee,
    We also tried this:
    Wrote document in Pages and used "export" to save it as a PDF document.
    Fired up Mail, clicked on add attachment and as usual we got the document in the body
    Highlighted the document and right clicked.
    In drop down menu we selected "show as Icon" and it did just that
    We then sent it to our Tablet where, believe it or not it came up as an attachment NOT in the body of the mail.
    Just shaking our heads on this on but I do really think Jerry is absolutely right so will not take any more chances and add a second page if I have to send a pdf......
    Bryan

  • How to send an ouput as PDF attachment to email

    Hi,
    We have a 'Z' output for a delivery document. The output has the standard RLE_DELNOTE driver program and a Zsmart form assigned to it. We need to send the output as an attachment to email. Can some one please adivice how this can be achieved?
    Thanks in advance
    Kat

    Hi,
    Plz try following steps.
    1. Note the spool request No.
    2. In T/code SE38, Enter The programme and execute.
    3. In sub Object- Click Documentation and then do debuggung.
    4.Enter spool request no and desired location and execute.
    5. In ABAP Debugger- Use F8 key.
    6. Select the desired location and file name and save.
    View the desired output in PDF and can be sent through mail.
    Hope this helps.
    Regards,
    Jaiprakash.P.T

  • Sending Cheque as PDF attachment in Mail using F110.

    Hi all,
    We have a requirement to send the cheque as as PDF attachment in Mail while printing it through transaction F110.Mail has to be triggered when the payment run is done through F110.Is there any config setting to do this without doing any changes to Print program RFFOUS_C.
    Thanks and Regards
    Kiran

    Hi,
    check below link
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/email%2bfrom%2bsap 
    Regards,
    Madhu

  • Sending SAP Script output as a PDF attachment through mail

    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

    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.

  • How to send pdf attachment through mail using Webdynpro-Java

    How can i send the Adobe Interactive Form with data involved as a PDF attachment to mail? using Webdynpro-Java.
    Is there any Adobe API or jar file for generating pdf?
    Helpful answer is highly appreciable and rewarded with points.!

    Hi Sankar,
    try [Offline Interactive PDF Form Using E-Mail|/docs/DOC-8061#49]
    Michal

  • Issue in sending the email with XL attachment in ECC version

    Hi,
    I have an issue with sending the email with XL attachment. My program is sending a mail to the receiver with XLS as attachment. Recently we have migrated from 4.6B to ECC version. Same code was worked in 4.6B.But it is not working in ECC version.When i try to open the attachment, i get a Dialog Box with the following message
    "The file is not in a recognizable format.
    1. if you know the file is from another program whih is incompatible with Microsoft excel,click cancel,then open this file in its original application
    2.If you suspect the file is damaged, click help for more information about solving theproblem.
    3.if you still want to see what text is contained in the file, click OK.Then click the text import wizard. "
    when i click OK, the excel sheet is opening with all required data.
    Can anyone kindly tell me why this is happening.
    I am also attaching part of the coding related to this requirement.
    *&      Form  BUILD_XLS_DATA_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM build_xls_data_table.
      DATA: w_total(13),
      w_clabs(13),
      w_cinsm(13),
      w_ceinm(13),
      w_cretm(13),
      w_cspem(13),
      w_cumlm(13),
      w_exp_date(8),
      w_v_totalp(13),
      w_min_rem(8),
      w_ersda(10),
      w_hsdat(10),
      w_vfdat(10),
      w_ship_date(10),
      w_plnmg(13),
       w_mhdrz(4).
      CLEAR: w_total, w_clabs, w_cinsm, w_ceinm, w_cspem, w_exp_date,
      w_v_totalp, w_min_rem, w_ersda, w_hsdat, w_vfdat, w_ship_date,
      w_plnmg, w_mhdrz.
      w_total = it_batch1-total.
      w_clabs = it_batch1-clabs.
      w_cinsm = it_batch1-cinsm.
      w_ceinm = it_batch1-ceinm.
      w_cspem = it_batch1-cspem.
      w_cumlm = it_batch1-cumlm.
      w_cretm = it_batch1-cretm.
      w_exp_date = it_batch1-exp_date.
      w_v_totalp = it_batch1-v_totalp.
      w_min_rem = it_batch1-min_rem.
      w_plnmg = it_batch1-plnmg.
      w_mhdrz = it_batch1-mhdrz.
      CONCATENATE it_batch1-ersda6(2) it_batch1-ersda4(2)
                  it_batch1-ersda+0(4) INTO w_ersda SEPARATED BY '.'.
      CONCATENATE it_batch1-hsdat6(2) it_batch1-hsdat4(2)
                  it_batch1-hsdat+0(4) INTO w_hsdat SEPARATED BY '.'.
      CONCATENATE it_batch1-vfdat6(2) it_batch1-vfdat4(2)
                  it_batch1-vfdat+0(4) INTO w_vfdat SEPARATED BY '.'.
      CONCATENATE it_batch1-ship_date6(2) it_batch1-ship_date4(2)
                  it_batch1-ship_date+0(4) INTO w_ship_date SEPARATED BY '.'
      CONCATENATE
      it_batch1-werks it_batch1-mtart it_batch1-matnr it_batch1-maktg
    it_batch1-prdha it_batch1-prctr it_batch1-ktext  it_batch1-dispo
      it_batch1-charg it_batch1-lgort it_batch1-herkl w_clabs
      w_cinsm w_ceinm w_cretm w_cspem
      w_cumlm w_total  it_batch1-meins  it_batch1-v_spr_unit
      w_v_totalp it_batch1-waers w_plnmg  it_batch1-meins
      w_ersda w_hsdat w_vfdat  w_exp_date
       w_ship_date  w_mhdrz  w_min_rem it_batch1-zlifer
       it_batch1-doknr it_batch1-dokar it_batch1-doktl  it_batch1-dokvr
               INTO L_STRING SEPARATED BY CON_TAB.
                  INTO l_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
      WHILE l_string <> space.
        CALL FUNCTION 'TEXT_SPLIT'
          EXPORTING
            length       = 255
            text         = l_string
            as_character = 'X'
          IMPORTING
            line         = it_attach
            rest         = l_string.
        IF l_string = space.
       CONCATENATE IT_ATTACH CON_CRET INTO IT_ATTACH.
          CONCATENATE it_attach cl_abap_char_utilities=>cr_lf INTO it_attach.
          APPEND it_attach.
          CLEAR it_attach.
        ELSE.
          APPEND it_attach.
          CLEAR it_attach.
        ENDIF.
      ENDWHILE.
    move l_string to it_attach .
    CONCATENATE it_attach cl_abap_char_utilities=>cr_lf INTO it_attach.
    APPEND it_attach.
    CLEAR it_attach.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          text
    -->  p1        text
    <--  p2        text
    FORM send_file_as_email_attachment.
      DATA:w_length TYPE i.
      DATA:  w_cnt TYPE i,
              w_sent_all(1) TYPE c,
              w_doc_data LIKE sodocchgi1,
              gd_error    TYPE sy-subrc,
              gd_reciever TYPE sy-subrc,
              t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
    w_doc_data-obj_langu = sy-langu.
    w_doc_data-obj_name  = 'SAPRPT'.
    w_doc_data-obj_descr = text-034 .
    w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
    DESCRIBE TABLE it_attach LINES w_cnt.
      DESCRIBE TABLE it_message LINES w_cnt.
      READ TABLE it_message INDEX w_cnt.
    w_length = STRLEN( it_attach ).
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_message ).
      w_doc_data-obj_langu  = sy-langu.
    w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = text-034.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
    ***Start of changes by 501507008 on 29.01.2009
      t_packing_list-obj_descr  = 'MAIL BODY'.
    ***End of changes by 501507008 on 29.01.2009
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  'XLS'.
      t_packing_list-obj_descr  =  text-034.
      t_packing_list-obj_name   =  'filename'.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      LOOP AT it_adr6.
        t_receivers-receiver = it_adr6-smtp_addr.
        t_receivers-rec_type = 'U'.
        t_receivers-com_type = 'INT'.
        t_receivers-notif_del = 'X'.
        t_receivers-notif_ndel = 'X'.
        APPEND t_receivers.
      ENDLOOP.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
       EXPORTING
         document_data              = w_doc_data
         put_in_outbox              = 'X'
         sender_address             = ' '
         sender_address_type        = ' '
         commit_work                = 'X'
       IMPORTING
         sent_to_all                = w_sent_all
       TABLES
         packing_list               = t_packing_list
         contents_bin               = t_attachment
         contents_txt               = it_message
         receivers                  = t_receivers
       EXCEPTIONS
         too_many_receivers         = 1
         document_not_sent          = 2
         document_type_not_exist    = 3
         operation_no_authorization = 4
         parameter_error            = 5
         x_error                    = 6
         enqueue_error              = 7
         OTHERS                     = 8.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data                    = w_doc_data
         put_in_outbox                    = 'X'
      commit_work                      = ' '
    IMPORTING
      sent_to_all                      =
      new_object_id                    =
    tables
            packing_list               = t_packing_list
            contents_bin               = t_attachment
            contents_txt               = it_message
            receivers                  = t_receivers
      contents_hex                     =
      object_para                      =
      object_parb                      =
       exceptions
         too_many_receivers               = 1
         document_not_sent                = 2
         document_type_not_exist          = 3
         operation_no_authorization       = 4
       parameter_error                  = 5
       x_error                          = 6
       enqueue_error                    = 7
       OTHERS                           = 8.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.                    " SEND_FILE_AS_EMAIL_ATTACHMENT

    Hi,
    could you tell me which opeion should i select in SCOT under INT node. I have tried with diffrent options. but no luck.
    SAPscript/Smart Forms  - No Conversion
    ABAP List                     - No Conversion
    Business Object/Link     - No Conversion
    RAW Text                     - No Conversion

  • How to send the output to PDF format in reports 6i?

    Hi,
    How to send the output to PDF format in reports 6i? I given Mode = BITMAP.
    DESTYPE = File, DESFORMAT = PDF, DESNAME = C:\x.pdf.
    Report is running fine. But PDF file not generated. I don't know what i missed. Any one can help this?
    Thanks
    Kavitha

    Hello,
    Do you get this problem only for DESFORMAT=PDF ?
    Test with :
    DESFORMAT = RTF, DESNAME = C:\x.rtf
    or
    DESFORMAT = HTMLCSS, DESNAME = C:\x.html
    does it work ?
    Check if DESNAME is modified in the reports itself.
    Regards

  • How do I scan a photo to a file and then send the file as an attachment via email.

    How do I scan a photo to a file and then send the file as an attachment  via email.

    All of this depends largely on what printer /software you have, which Email client you use and to some extent which OS you are running.
    Most HP printers have HP Solution Center which is used to set up scanning,choosing where to save,etc. Once a file/photo is scanned and saved to the folder, open the folder.Select the file and at the top of the window should be the option to 'Email'.
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

  • Need to sent alv output as html or as pdf attachment in mail

    +Hello
    I want to send an ALV output as attachement in html or as pdf format. how to do that? line size is greater than 600(nearly 40 fields).
    +please help me in this query.
    Regards
    Guruvayurappan
    Moderator Message: Please search before posting your question. Thread locked.
    Edited by: Suhas Saha on Dec 29, 2011 4:57 PM

    Hi,
    For sending the ALV output as PDF attachment, you can create a spool (proper page size in print parameters) and convert the spool to PDF using the FM CONVERT_ABAPSPOOLJOB_2_PDF and then send the same as attachment in mail.
    For send the data as HTML attachment, try the below FMs
    WWW_ITAB_TO_HTML_HEADERS & WWW_ITAB_TO_HTML_LAYOUT to create the HTML layout
    WWW_ITAB_TO_HTML to create the HTML for the actual data.
    Hope this helps you.
    Regards,
    Sachinkumar Mehta

  • Send a text Doc as attachment to mail-id through sales order output type

    Hi,
    when i create a SD document and select an output type and external mode before i save the document, it generates a PDF document as an attachment and sents an email. I would like to send a text document as an attachment. Can anybody please tell me the procedure to convert or send the text document as attachment.
    Thanks,
    Ravi

    Hi Ravi sirigiri,
    Donot convert the data into PDF just pass the OTF data to the
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        DOCUMENT_DATA              = W_DOC_CHNG
        PUT_IN_OUTBOX              = 'X'
        commit_work                = 'X'
      TABLES
        PACKING_LIST               = I_OBJPACK
       CONTENTS_BIN                = I_OBJBIN
        OBJECT_HEADER              = W_OBJHEAD
        CONTENTS_TXT               = I_OBJTXT
            RECEIVERS                  = I_RECLIST
    Regards,
    Sravanthi

Maybe you are looking for

  • I can not open iPhoto.  I have many photos and have used the program many times. What is happening?

    iphoto installed, up to date and has been in use with no problems.  Now the icon still appears on the dock but I am unable to open the program. Nothing happens when I click the icon.  Help! 

  • How to email report to the users

    Hi, I have a few reports in 6i. I can preview them but cannot mail them to the users. When I click on the mail icon, it gives me this error : REP-4203: Error occurred while sending a mail message. Second option I did was to directly create a pdf repo

  • Password encrypted for PDF payslip

    Hi Experts, Currently I am having a request to encrypt password for PDF payslip, which standard SAP does not support. I observed that the encryption must be done in OS level (LINUX) after we execute the sending process in SAP and before the employee

  • # How to get the system AD Domain user login name in portal?

    when a system user use AD Domain method login the system. and then the user open the portal web application page, but not use AD Domain name login in portal page, that time ,I want to catch the user system login name show in portal page? I hava try t

  • How to update flash sites without flash installed

    Hi, aside from using ICE, is there a way for someone to update a flash site with pictures and text who doesn't have flsah installed on their computer? i.e., how can you add as well as replace additional text and image files without doing it in flash