Sending a PDF attachment by mail

Hello Experts,
I need to write down a report in which you can generate an e-mail attaching automatically one or more PDF already downloaded on my PC (generated by a previous report) i.e. c:\test.pdf
For info, this is the last part of a report that generates PDF from a standard report result:
- I call RFZALI20 for a specific set of parameters (LAUFD, LAUFI, LIFNR)
- I generate a spool with the results (customer wants exactly the "screenshots" of report result) and then convert it in pdf with a submit to RSTXPDF4
- Now I have to send it by mail to the vendor...how can I do that??
thanks in advance
Chiara

hi
Store all your texts like dear sir , please find the attachment in text elements example text-001 contains please find the attachments and text-002 contains thank you and so on.
Once you do this the place where you call your pdf palce them there and concat them.
example:
data: wa_msg type solisti1,
i_msg type standard table of solisti1.
wa_msg-line = text-001.
append wa_msg to i_msg.
then you fill the receivers and call the FM for sending pdf mail
regards
Sachin Sharma

Similar Messages

  • 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

  • Error during sending a PDF attachment of a mail

    Hi everebody,
                      I'm using a custom program [ see below ] ( in which there is the call to the std function SO_DOCUMENT_SEND_API1) to send a PDF attachment to an user's SAPOFFICE: in release 4.6C it works correctly but the same programm in ECC6 it doesn't work correctly.  I mean: the mail is sent correctly with the attachment, but when I try to open the attachment this one doesn't open correctly showing a PDF error message.
    Any help?
                gino bonfiglioli
    *& Report  Z_UT_CONVERT_SPOOL_PDF
    REPORT  z_ut_convert_spool_pdf.
    TABLES: tsp01.
    variabili globali
    *data: fm_name            type rs38l_fnam,
         output_options     type ssfcompop,
         control_parameters type ssfctrlop,
         job_output_info    type ssfcrescl,
         job_output_options type ssfcresop,
    DATA: spoolno            LIKE tsp01-rqident,
          dir_pdf            LIKE rlgrap-filename,
          numbytes           TYPE i,
          pagecount          TYPE i,
          w_cnt              TYPE i,
          wk_subrc           LIKE sy-subrc,
          pdfspoolid         LIKE tsp01-rqident,
          gd_buffer          TYPE string,
          pdf                LIKE tline OCCURS 100 WITH HEADER LINE,
          stampante          LIKE usr01-spld,
          tot_line   TYPE sy-tabix,
          tot_line2  TYPE sy-tabix,
          start_line TYPE sy-tabix.
    tabelle interne per 1a mail
    DATA: BEGIN OF it_email OCCURS 100.
            INCLUDE STRUCTURE solisti1.
    DATA: END OF it_email.
    DATA: BEGIN OF email_data.
            INCLUDE STRUCTURE sodocchgi1.
    DATA: END OF email_data.
    DATA: BEGIN OF email_send OCCURS 10.
            INCLUDE STRUCTURE somlreci1.
    DATA: END OF email_send.
    DATA: packing_list TYPE STANDARD TABLE OF sopcklsti1 WITH HEADER LINE,
          it_mess_att  LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          receivers    TYPE STANDARD TABLE OF somlreci1 WITH HEADER LINE.
    fine tabelle interne per 1a mail
    PARAMETER: p_spool LIKE tsp01-rqident.
    START-OF-SELECTION.
      PERFORM conversione_spool_pdf USING wk_subrc.
      IF wk_subrc EQ 0.
        PERFORM invio_mail.
      ENDIF.
    *&      Form  CONVERSIONE_SPOOL_PDF
          text
         -->P_P_SUBRC  text
    FORM conversione_spool_pdf  USING    p_subrc.
    **- Conversione in PDF
      CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
          EXPORTING
            src_spoolid                    = p_spool
            no_dialog                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
          IMPORTING
            pdf_bytecount                  = numbytes
            pdf_spoolid                    = pdfspoolid
            otf_pagecount                  = pagecount
           btc_jobname                    = jobname
           btc_jobcount                   = jobcount
          TABLES
            pdf                            = pdf
          EXCEPTIONS
            err_no_otf_spooljob            = 1
            err_no_spooljob                = 2
            err_no_permission              = 3
            err_conv_not_possible          = 4
            err_bad_dstdevice              = 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.
      p_subrc = sy-subrc.
    ENDFORM.                    " CONVERSIONE_SPOOL_PDF
    *&      Form  invio_mail
          text
    -->  p1        text
    <--  p2        text
    FORM invio_mail .
    Transfer the 132-long strings to 255-long strings
      LOOP AT pdf.
        TRANSLATE pdf USING ' ~'.
        CONCATENATE gd_buffer pdf 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.
    Testo della mail
      CLEAR it_email. REFRESH it_email.
      it_email-line = 'Testo della mail'.
      APPEND it_email.
    Creazione messaggio
      email_data-obj_name      = 'MESSAGE'.
      email_data-obj_descr     = 'Conversione spool n.'.
      email_data-obj_descr+26  = p_spool.
      email_data-obj_langu     = 'I'.
      email_data-sensitivty    = 'F'.
      READ TABLE it_mess_att INDEX w_cnt.
      email_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_mess_att ).
      start_line = 1.
      DESCRIBE TABLE it_email LINES tot_line.
      packing_list-transf_bin = ' '.
      packing_list-doc_type   = 'RAW'.
      packing_list-head_start = 1.
      packing_list-head_num   = 0.
      packing_list-body_start = 1.
      packing_list-body_num   = tot_line.
      packing_list-obj_langu  = sy-langu.
      APPEND packing_list.
      APPEND LINES OF it_mess_att TO it_email.
      CLEAR packing_list.
    Riga iniziale = ultima riga messaggio precedente + 1
      start_line = tot_line + 1.
      DESCRIBE TABLE it_mess_att LINES tot_line.
      packing_list-transf_bin = 'X'.
      packing_list-head_start = 1.
      packing_list-head_num   = 1.
      packing_list-body_start = 1.
      DESCRIBE TABLE it_mess_att LINES packing_list-body_num.
      packing_list-doc_type   = 'PDF'.
      packing_list-obj_descr  = 'Allegato PDF.'.
      packing_list-doc_size   =  packing_list-body_num * 255.
      packing_list-obj_langu  = sy-langu.
      APPEND packing_list.
    destinatario interno a SAP
      receivers-receiver = sy-uname.
      receivers-rec_type = 'B'.
      receivers-express = 'X'.
      APPEND receivers.
    destinatario esterno a SAP: deve essere un idirizzo email:
    receivers-receiver = '[email protected]'.
    receivers-rec_type = 'U'.
    APPEND receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
      EXPORTING
        document_data                    = email_data
        put_in_outbox                    = 'X'
       SENDER_ADDRESS                   = SY-UNAME
        sender_address_type              = 'B'
       COMMIT_WORK                      = 'X'
    IMPORTING
      SENT_TO_ALL                      =
      NEW_OBJECT_ID                    =
      SENDER_ID                        =
      TABLES
        packing_list                   = packing_list
        contents_bin                   = it_mess_att
        contents_txt                   = it_email
        receivers                      = 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.
      IF sy-subrc <> 0.
    errore invio mail
      ENDIF.

    Hi,
    Try to use fm 'SO_NEW_DOCUMENT_ATT_SEND_API1' instead of SO_DOCUMENT_SEND_API1.
    Please check documentation of fm SO_DOCUMENT_SEND_API1 in ECC 6.

  • PDF attachment in mail

    Hi All,
    I am able to send the PDF file in mail attachment, but the problem is the logo is not getting displayed correctly. Pls find my code below
    REPORT  ztestmail.
    DATA: objpack LIKE sopcklsti1 OCCURS  2 WITH HEADER LINE.
    DATA: objhead LIKE solisti1   OCCURS  1 WITH HEADER LINE.
    DATA: objbin  LIKE solisti1   OCCURS 45 WITH HEADER LINE.
    DATA: objtxt  LIKE solisti1   OCCURS 10 WITH HEADER LINE.
    DATA: reclist LIKE somlreci1  OCCURS  5 WITH HEADER LINE.
    DATA: doc_chng LIKE sodocchgi1.
    DATA: tab_lines LIKE sy-tabix.
    DATA : it_lines TYPE STANDARD TABLE OF tline,
           it_line TYPE tline.
    Creating the document to be sent
    doc_chng-obj_name = 'Invoice'.
    doc_chng-obj_descr = 'Invoice'.
    objtxt = 'Invoice as Attachment'.
    APPEND objtxt.
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    Creating the entry for the compressed document
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num   = 0.
    objpack-body_start = 1.
    objpack-body_num   = tab_lines.
    objpack-doc_type   = 'RAW'.
    APPEND objpack.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = 'U:\PDF\2.PDF'
        filetype                      = 'BIN'
      TABLES
        data_tab                      = it_lines
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    DATA : gd_buffer TYPE string.
    LOOP AT it_lines INTO it_line.
      TRANSLATE it_line USING ' ~'.
      CONCATENATE gd_buffer it_line INTO gd_buffer.
    ENDLOOP.
    TRANSLATE gd_buffer USING '~ '.
    DO.
      objbin = gd_buffer.
      APPEND objbin.
      SHIFT gd_buffer LEFT BY 255 PLACES.
      IF gd_buffer IS INITIAL.
        EXIT.
      ENDIF.
    ENDDO.
    objhead = 'Invoice.PDF'. APPEND objhead.
    Creating the entry for the compressed attachment
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num   = 1.
    objpack-body_start = 1.
    DESCRIBE TABLE objbin LINES tab_lines.
    READ TABLE objbin INDEX tab_lines.
    objpack-doc_size   = tab_lines * 255.
    objpack-body_num   = tab_lines.
    objpack-doc_type   = 'EXT'.
    objpack-obj_name   = 'ATTACHMENT'.
    objpack-obj_descr = 'Reproduction object 138'.
    APPEND objpack..
    Entering names in the distribution list
    reclist-receiver = 'mail address'.
    reclist-rec_type = 'U'.
    APPEND reclist.
    * sending the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data              = doc_chng
        put_in_outbox              = 'X'
        commit_work                = 'X'
      TABLES
        packing_list               = objpack
        object_header              = objhead
        contents_bin               = objbin
        contents_txt               = objtxt
        receivers                  = reclist
      EXCEPTIONS
        too_many_receivers         = 1
        document_not_sent          = 2
        operation_no_authorization = 4
        OTHERS                     = 99.
    Thanks,
    Raju

    Hi Raj008,
    When you create post or reply, on right hand side all the markups are given...how to format text and all,
    for code to be seen in readable format,
    simply type the lines between  
    <open brace bracket > <the word 'code'> <closing brace bracket>
    program lines
    <open brace bracket > <the word 'code'> <closing brace bracket>
    hope that helps you
    sorry cant actually type the bracket, as it shows in code format
    Please try replying again to 1 of the replies and check on right hand side of the editor.
    Regards,
    Radhika

  • How To send a PDF file to mail

    Hi Friends,
    I am  having a file (D:\file.pdf) in ' D ' directory . Now I want to send this pdf  to perticular mail id ([email protected]). I tried so many examples but i am not able to solve this problem so please help to solve this one.
    I tried SO_NEW_DOCUMENT_SEND_API1 function modules and all but i am not getting please send small sample code .
    Thanks and Regards,
    Phani.

    go through this report=>
    : Report ZSAPTALK :
    : Author SAPdev.co.uk :
    : Description : :
    : Send mail message to SAP mail inbox. :
    : Please visit www.sapdev.co.uk for further info :
    REPORT ZSAPMAIL NO STANDARD PAGE HEADING.
    TABLES: DRAD,
    QINF,
    DRAW,
    SOUC,
    SOFD,
    DRAP.
    DATA: P_RETURN_CODE LIKE SY-SUBRC.
    data: d_username LIKE DRAP-PRNAM.
    mail declarations
    DATA : BEGIN OF NEW_OBJECT_ID. " the newly created email object
    INCLUDE STRUCTURE SOODK.
    DATA : END OF NEW_OBJECT_ID.
    DATA : BEGIN OF FOLDER_ID. " the folder id of the outbox
    INCLUDE STRUCTURE SOODK.
    DATA : END OF FOLDER_ID.
    DATA : BEGIN OF REC_TAB OCCURS 5. " the table which will contain the
    INCLUDE STRUCTURE SOOS1. " information on the destination
    DATA : END OF REC_TAB.
    DATA : BEGIN OF OBJECT_HD_CHANGE. " the table which contains the
    INCLUDE STRUCTURE SOOD1. " info for the object we will be
    DATA : END OF OBJECT_HD_CHANGE. " creating
    DATA : OBJECT_TYPE LIKE SOOD-OBJTP. " the type of object
    DATA : BEGIN OF OBJHEAD OCCURS 5. " the header of the object
    INCLUDE STRUCTURE SOLI.
    DATA : END OF OBJHEAD.
    DATA : BEGIN OF OBJCONT OCCURS 0. " the contents of the object
    INCLUDE STRUCTURE SOLI. " i.e. the text etc
    DATA : END OF OBJCONT.
    DATA : BEGIN OF OBJPARA OCCURS 5. " formatting options
    INCLUDE STRUCTURE SELC.
    DATA : END OF OBJPARA.
    DATA : BEGIN OF OBJPARB OCCURS 5. " formatting options
    INCLUDE STRUCTURE SOOP1.
    DATA : END OF OBJPARB.
    DATA : BEGIN OF T_MAIL_TEXT OCCURS 0, "Message table for messages to
    STRING(255), "user via mailbox
    END OF T_MAIL_TEXT.
    Parameter: p_uname like sy-uname.
    **START-OF-SELECTION
    START-OF-SELECTION.
    d_username = p_uname.
    PERFORM POPULATE_EMAIL_TEXT.
    PERFORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
    PERFORM CREATE_AND_SEND_MAIL_OBJECT.
    FORM POPULATE_EMAIL_TEXT *
    Inserts text for email message *
    FORM POPULATE_EMAIL_TEXT.
    CLEAR T_MAIL_TEXT-STRING. "puts a blank line in
    APPEND T_MAIL_TEXT.
    APPEND T_MAIL_TEXT.
    adds failed list on to end of success list.
    T_MAIL_TEXT-STRING = 'Test email message line 1'.
    APPEND T_MAIL_TEXT.
    T_MAIL_TEXT-STRING = 'Test email message line 1'.
    APPEND T_MAIL_TEXT.
    CLEAR T_MAIL_TEXT-STRING. "puts a blank line in
    APPEND T_MAIL_TEXT.
    T_MAIL_TEXT-STRING = 'Header1 Header2 Header3'.
    APPEND T_MAIL_TEXT.
    T_MAIL_TEXT-STRING = '----
    APPEND T_MAIL_TEXT.
    ENDFORM.
    *& Form SETUP_TRX_&_RTX_MAILBOXES
    Ensure that the mailboxes of the sender (INTMGR) are set up OK
    FORM SETUP_TRX_AND_RTX_MAILBOXES USING P_RETURN_CODE.
    get the user no of the sender in order to add the mail to the
    user name's outbox for future reference
    SELECT SINGLE * FROM SOUC
    WHERE SAPNAM = SY-UNAME. "SAP name of a SAPoffice user
    IF SY-SUBRC NE 0.
    "Error finding the SAPoffice user info for the user
    MESSAGE E064(ZR53) WITH SY-UNAME.
    P_RETURN_CODE = 1.
    EXIT.
    ENDIF.
    *Get the outbox No for the sender from the user No where the folder
    " type is an outbox
    SELECT * FROM SOFD WHERE OWNTP = SOUC-USRTP "Owner type from ID
    AND OWNYR = SOUC-USRYR "Owner year from the ID
    AND OWNNO = SOUC-USRNO "Owner number from the I
    AND FOLRG = 'O'."Output box
    ENDSELECT.
    IF SY-SUBRC NE 0.
    " Error getting folder information for the user
    MESSAGE E065(ZR53) WITH SY-UNAME.
    P_RETURN_CODE = 1.
    EXIT.
    ENDIF.
    ENDFORM. " SETUP_TRX_&_RTX_MAILBOXES
    *& Form CREATE_AND_SEND_MAIL_OBJECT
    FORM CREATE_AND_SEND_MAIL_OBJECT.
    FOLDER_ID-OBJTP = SOFD-FOLTP. " the folder type ( usually FOL )
    FOLDER_ID-OBJYR = SOFD-FOLYR. " the folder year ( usually 22 )
    FOLDER_ID-OBJNO = SOFD-FOLNO. " the folder no.
    OBJECT_TYPE = 'RAW'. " the type of object being added
    build up the object information for creating the object
    OBJECT_HD_CHANGE-OBJLA = SY-LANGU. " the language of the email
    OBJECT_HD_CHANGE-OBJNAM = 'PS to DM Interface'. " the object name
    mail subject 'Mass Linking of QA, pass/fail'
    MOVE TEXT-002 TO OBJECT_HD_CHANGE-OBJDES.
    OBJECT_HD_CHANGE-DLDAT = SY-DATUM. " the date of the email
    OBJECT_HD_CHANGE-DLTIM = SY-UZEIT. " the time of the email
    OBJECT_HD_CHANGE-OBJPRI = '1'. " the priority ( highest )
    OBJECT_HD_CHANGE-OBJSNS = 'F'. " the object sensitivity
    F is functional, C - company sensitive
    object_hd_change-skips = ' '. " Skip first screen
    object_hd_change-acnam = 'SM35'. " Batch imput transaction
    object_hd_change-vmtyp = 'T'. " Transaction type
    add the text lines into the contents of the email
    CLEAR OBJCONT.
    REFRESH OBJCONT.
    free objcont. " added this to delete the mail contents records
    LOOP AT T_MAIL_TEXT.
    OBJCONT-LINE = T_MAIL_TEXT-STRING.
    APPEND OBJCONT.
    ENDLOOP.
    CLEAR OBJCONT.
    build up the table of receivers for the email
    REC_TAB-RCDAT = SY-DATUM. " the date to send the email
    REC_TAB-RCTIM = SY-UZEIT. " the time to send the email
    the SAP username of the person who will receive the email
    REC_TAB-RECNAM = D_USERNAME.
    the user type of the person who will send the email ( USR )
    REC_TAB-SNDTP = SOUC-USRTP.
    the user year of the person who will send the email ( 22 )
    REC_TAB-SNDYR = SOUC-USRYR.
    the user number of the person who will send the email
    REC_TAB-SNDNO = SOUC-USRNO.
    the sap username of the person who will send the email
    REC_TAB-SNDNAM = SY-UNAME.
    get the user info for the receiver of the document
    SELECT SINGLE * FROM SOUC WHERE SAPNAM = D_USERNAME.
    IF SY-SUBRC NE 0.
    WRITE : / TEXT-001, D_USERNAME. "usnam.
    EXIT.
    ENDIF.
    the user number of the person who will receive the email ( USR )
    REC_TAB-RECNO = SOUC-USRNO.
    the user type of the person who will receive the email ( USR )
    REC_TAB-RECTP = SOUC-USRTP.
    the user year of the person who will receive the email ( USR )
    REC_TAB-RECYR = SOUC-USRYR.
    the priority of the email ( highest )
    REC_TAB-SNDPRI = '1'.
    check for delivery on the email
    REC_TAB-DELIVER = 'X'.
    send express so recipient knows there is a problem
    REC_TAB-SNDEX = 'X'.
    check for a return receipt
    REC_TAB-READ = 'X'.
    the sap username of the person receiving the email
    REC_TAB-ADR_NAME = D_USERNAME. "usnam.
    add this receiver to the internal table
    APPEND REC_TAB.
    CLEAR REC_TAB.
    call the function to create the object in the outbox of the sender
    CALL FUNCTION 'SO_OBJECT_INSERT'
    EXPORTING
    FOLDER_ID = FOLDER_ID
    OBJECT_HD_CHANGE = OBJECT_HD_CHANGE
    OBJECT_TYPE = OBJECT_TYPE
    OWNER = SY-UNAME
    IMPORTING
    OBJECT_ID = NEW_OBJECT_ID
    TABLES
    OBJCONT = OBJCONT
    OBJHEAD = OBJHEAD
    OBJPARA = OBJPARA
    OBJPARB = OBJPARB
    EXCEPTIONS
    ACTIVE_USER_NOT_EXIST = 1
    COMMUNICATION_FAILURE = 2
    COMPONENT_NOT_AVAILABLE = 3
    DL_NAME_EXIST = 4
    FOLDER_NOT_EXIST = 5
    FOLDER_NO_AUTHORIZATION = 6
    OBJECT_TYPE_NOT_EXIST = 7
    OPERATION_NO_AUTHORIZATION = 8
    OWNER_NOT_EXIST = 9
    PARAMETER_ERROR = 10
    SUBSTITUTE_NOT_ACTIVE = 11
    SUBSTITUTE_NOT_DEFINED = 12
    SYSTEM_FAILURE = 13
    X_ERROR = 14
    OTHERS = 15.
    IF SY-SUBRC NE 0.
    MESSAGE A063(ZR53) WITH SY-SUBRC.
    EXIT.
    ENDIF.
    call the function to send the already created email to the receivers
    CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
    FOLDER_ID = FOLDER_ID
    OBJECT_ID = NEW_OBJECT_ID
    OUTBOX_FLAG = 'X'
    OWNER = SY-UNAME
    TABLES
    RECEIVERS = REC_TAB
    EXCEPTIONS
    ACTIVE_USER_NOT_EXIST = 1
    COMMUNICATION_FAILURE = 2
    COMPONENT_NOT_AVAILABLE = 3
    FOLDER_NOT_EXIST = 4
    FOLDER_NO_AUTHORIZATION = 5
    FORWARDER_NOT_EXIST = 6
    NOTE_NOT_EXIST = 7
    OBJECT_NOT_EXIST = 8
    OBJECT_NOT_SENT = 9
    OBJECT_NO_AUTHORIZATION = 10
    OBJECT_TYPE_NOT_EXIST = 11
    OPERATION_NO_AUTHORIZATION = 12
    OWNER_NOT_EXIST = 13
    PARAMETER_ERROR = 14
    SUBSTITUTE_NOT_ACTIVE = 15
    SUBSTITUTE_NOT_DEFINED = 16
    SYSTEM_FAILURE = 17
    TOO_MUCH_RECEIVERS = 18
    USER_NOT_EXIST = 19
    X_ERROR = 20
    OTHERS = 21.
    IF SY-SUBRC EQ 0.
    MESSAGE I035(ZR53) WITH NEW_OBJECT_ID D_USERNAME. "usnam.
    ELSE.
    MESSAGE I036(ZR53) WITH D_USERNAME." sy-subrc.
    ENDIF.
    ENDFORM. " CREATE_AND_SEND_MAIL_OBJECT
    Also, check links....
    http://help.sap.com/saphelp_nw04s/helpdata/en/38/71f865c2c9a94ab1dce95792187c16/content.htm
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
    http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
    http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm

  • I am unable to open my PDF attachment in mail.

    I cannot open my PDF attachment in mail. I am able to on all of my other apple products but not my air. Is there a setting that i might have wrong?

    If it is your own pdf and you are unsure of your password, you are out of luck. You will need to create a new file from the original documents. I suggest using password managers, if you need to create many different documents with different passwords.

  • Pdf attachment from mail to ibooks?

    hmm, how do you 'import' pdf attachment from mail into ibooks 1.1? i hit downloaded on iphone mail, it loaded with img, not even a pdf. flip back to ibooks, hit pdf tab, its not there. am i missing something here?
    thanks guys
    Message was edited by: Tran Hoang Long

    I have the latest version of iTunes with iBooks, and it doesn't have anywhere to drag PDF files into iTunes. Where are you seeing this? I tried every imaginable PDF, include a text document, I printed to PDF from textedit, then dragging it into the pane of grayed out books in iTunes.
    What gives?
    Here's a screenshot:
    http://drp.ly/1eMh5M

  • 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

  • Sending PDF attachment in mail

    My requirement is to send PDF as attachment in mail. Also require to password protect it. I've searced a lot in the forums and found many threads, but no solid solution... Has anyone worked on it lately, and found any solution? Thanks in advance.

    Hi,
    use this FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'. and pass the required values.
    z_send_email_fax_global
    FUNCTION-POOL z_gfaian_mail_fax. "MESSAGE-ID ..
    WORK TABLE AREAS
    TABLES: tsp01.
    INTERNAL TABLES
    DATA: lt_rec_tab LIKE STANDARD TABLE OF soos1 WITH HEADER LINE,
    lt_note_text LIKE STANDARD TABLE OF soli WITH HEADER LINE,
    lt_attachments LIKE STANDARD TABLE OF sood5 WITH HEADER LINE.
    DATA: lt_objcont LIKE STANDARD TABLE OF soli WITH HEADER LINE,
    lt_objhead LIKE STANDARD TABLE OF soli WITH HEADER LINE.
    DATA: pdf_format LIKE STANDARD TABLE OF tline WITH HEADER LINE.
    TYPES: BEGIN OF y_files,
    file(60) TYPE c,
    END OF y_files.
    DATA: lt_files TYPE STANDARD TABLE OF y_files WITH HEADER LINE.
    DATA: l_objcont LIKE soli OCCURS 0 WITH HEADER LINE.
    DATA: l_objhead LIKE soli OCCURS 0 WITH HEADER LINE.
    STRUCTURES
    DATA: folder_id LIKE soodk,
    object_id LIKE soodk,
    link_folder_id LIKE soodk,
    g_document LIKE sood4,
    g_header_data LIKE sood2,
    g_folmem_data LIKE sofm2,
    g_header_data LIKE sood2,
    g_receive_data LIKE soos6,
    g_ref_document LIKE sood4,
    g_new_parent LIKE soodk,
    l_folder_id LIKE sofdk,
    v_email(50).
    DATA: hd_dat like sood1.
    VARIABLES
    DATA: client LIKE tst01-dclient,
    name LIKE tst01-dname,
    objtype LIKE rststype-type,
    type LIKE rststype-type.
    DATA: numbytes TYPE i,
    arc_idx LIKE toa_dara,
    pdfspoolid LIKE tsp01-rqident,
    jobname LIKE tbtcjob-jobname,
    jobcount LIKE tbtcjob-jobcount,
    is_otf.
    DATA: outbox_flag LIKE sonv-flag VALUE 'X',
    store_flag LIKE sonv-flag,
    delete_flag LIKE sonv-flag,
    owner LIKE soud-usrnam,
    on LIKE sonv-flag VALUE 'X',
    sent_to_all LIKE sonv-flag,
    g_authority LIKE sofa-usracc,
    w_objdes LIKE sood4-objdes.
    DATA: c_file LIKE rlgrap-filename,
    n_spool(6) TYPE n.
    DATA: cancel.
    DATA: desired_type LIKE sood-objtp,
    real_type LIKE sood-objtp,
    attach_type LIKE sood-objtp,
    otf LIKE sood-objtp VALUE 'OTF', " SAPscript Ausgabeformat
    ali LIKE sood-objtp VALUE 'ALI'. " ABAP lists
    CONSTANTS
    CONSTANTS: ou_fol LIKE sofh-folrg VALUE 'O',
    c_objtp LIKE g_document-objtp VALUE 'RAW',
    c_file_ext LIKE g_document-file_ext VALUE 'TXT'.
    =================================================================================
    z_send_email_fax2
    FUNCTION z_faian_mail_fax2.
    ""Interface local:
    *" IMPORTING
    *" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
    *" REFERENCE(FAX_MAIL_NUMBER) TYPE SO_NAME
    *" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
    *" REFERENCE(OBJECT_TYPE) TYPE SO_ESCAPE
    *" TABLES
    *" LT_BODY_EMAIL STRUCTURE SOLI
    *" EXCEPTIONS
    *" ERR_NO_ABAP_SPOOLJOB
    Fist part: Verify if the spool really exists
    SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
    IF sy-subrc NE 0.
    RAISE err_no_abap_spooljob. "doesn't exist
    ELSE.
    client = tsp01-rqclient.
    name = tsp01-rqo1name.
    CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
    authority = 'SP01'
    client = client
    name = name
    part = 1
    IMPORTING
    type = type
    objtype = objtype
    EXCEPTIONS
    fb_error = 1
    fb_rsts_other = 2
    no_object = 3
    no_permission = 4
    OTHERS = 5.
    IF objtype(3) = 'OTF'.
    desired_type = otf.
    ELSE.
    desired_type = ali.
    ENDIF.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
    EXPORTING
    rqident = src_spoolid
    desired_type = desired_type
    IMPORTING
    real_type = real_type
    TABLES
    buffer = l_objcont
    EXCEPTIONS
    no_such_job = 14
    type_no_match = 94
    job_contains_no_data = 54
    no_permission = 21
    can_not_access = 21
    read_error = 54.
    IF sy-subrc EQ 0.
    attach_type = real_type.
    ENDIF.
    CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
    EXPORTING
    owner = sy-uname
    region = ou_fol
    IMPORTING
    folder_id = l_folder_id
    EXCEPTIONS
    OTHERS = 5.
    fill out informations about the header of the email
    CLEAR: g_document.
    g_document-foltp = l_folder_id-foltp.
    g_document-folyr = l_folder_id-folyr.
    g_document-folno = l_folder_id-folno.
    g_document-objtp = c_objtp.
    g_document-objdes = header_mail.
    g_document-file_ext = c_file_ext.
    g_header_data-objdes = header_mail.
    CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
    EXPORTING
    method = 'SAVE'
    office_user = sy-uname
    IMPORTING
    authority = g_authority
    TABLES
    objcont = lt_body_email
    attachments = lt_attachments
    CHANGING
    document = g_document
    header_data = g_header_data
    EXCEPTIONS
    OTHERS = 1.
    folder_id-objtp = l_folder_id-foltp.
    folder_id-objyr = l_folder_id-folyr.
    folder_id-objno = l_folder_id-folno.
    object_id-objtp = c_objtp.
    object_id-objyr = g_document-objyr.
    object_id-objno = g_document-objno.
    link_folder_id-objtp = l_folder_id-foltp.
    link_folder_id-objyr = l_folder_id-folyr.
    link_folder_id-objno = l_folder_id-folno.
    REFRESH lt_rec_tab.
    CLEAR lt_rec_tab.
    lt_rec_tab-sel = 'X'.
    lt_rec_tab-recesc = object_type. "This field for FAX/MAIL
    lt_rec_tab-recnam = 'U-'.
    lt_rec_tab-deliver = 'X'.
    lt_rec_tab-not_deli = 'X'.
    lt_rec_tab-read = 'X'.
    lt_rec_tab-mailstatus = 'E'.
    lt_rec_tab-adr_name = fax_mail_number.
    lt_rec_tab-sortfield = fax_mail_number.
    lt_rec_tab-recextnam = fax_mail_number.
    lt_rec_tab-sortclass = '5'.
    APPEND lt_rec_tab.
    lt_rec_tab-recextnam = fax_mail_number.
    lt_rec_tab-recesc = object_type.
    lt_rec_tab-sndart = 'INT'.
    lt_rec_tab-sndpri = 1.
    APPEND lt_rec_tab.
    lt_files-file = c_file.
    APPEND lt_files.
    begin of insertion by faianf01
    hd_dat-objdes = header_mail.
    CALL FUNCTION 'SO_ATTACHMENT_INSERT'
    EXPORTING
    object_id = object_id
    attach_type = attach_type
    object_hd_change = hd_dat
    owner = sy-uname
    TABLES
    objcont = l_objcont
    objhead = l_objhead
    EXCEPTIONS
    active_user_not_exist = 35
    communication_failure = 71
    object_type_not_exist = 17
    operation_no_authorization = 21
    owner_not_exist = 22
    parameter_error = 23
    substitute_not_active = 31
    substitute_not_defined = 32
    system_failure = 72
    x_error = 1000.
    IF sy-subrc > 0.
    ENDIF.
    end of insertion by faianf01
    send email from SAPOFFICE
    CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
    folder_id = folder_id
    object_id = object_id
    outbox_flag = outbox_flag
    link_folder_id = link_folder_id
    owner = sy-uname
    check_send_authority = 'X'
    TABLES
    receivers = lt_rec_tab
    note_text = lt_note_text
    EXCEPTIONS
    active_user_not_exist = 35
    communication_failure = 71
    component_not_available = 1
    folder_no_authorization = 5
    folder_not_exist = 6
    forwarder_not_exist = 8
    object_no_authorization = 13
    object_not_exist = 14
    object_not_sent = 15
    operation_no_authorization = 21
    owner_not_exist = 22
    parameter_error = 23
    substitute_not_active = 31
    substitute_not_defined = 32
    system_failure = 72
    too_much_receivers = 73
    user_not_exist = 35.
    ENDIF.
    ENDFUNCTION.
    =================================================================================
    z_send_email_fax
    FUNCTION ZCBFS_SEND_MAIL.
    ""Interface local:
    *" IMPORTING
    *" REFERENCE(SRC_SPOOLID) LIKE TSP01-RQIDENT
    *" REFERENCE(HEADER_MAIL) TYPE SO_OBJ_DES
    *" TABLES
    *" LIST_FAX_MAIL_NUMBER STRUCTURE SOLI
    *" EXCEPTIONS
    *" ERR_NO_ABAP_SPOOLJOB
    DATA: vg_achou(1) TYPE n.
    Fist part: Verify if the spool really exists
    vg_achou = 1.
    DO 60 TIMES.
    SELECT SINGLE * FROM tsp01 WHERE rqident = src_spoolid.
    IF sy-subrc IS INITIAL.
    CLEAR vg_achou.
    EXIT.
    ELSE.
    WAIT UP TO 1 SECONDS.
    ENDIF.
    ENDDO.
    IF vg_achou = 1.
    RAISE err_no_abap_spooljob. "doesn't exist
    ENDIF.
    client = tsp01-rqclient.
    name = tsp01-rqo1name.
    CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
    authority = 'SP01'
    client = client
    name = name
    part = 1
    IMPORTING
    type = type
    objtype = objtype
    EXCEPTIONS
    fb_error = 1
    fb_rsts_other = 2
    no_object = 3
    no_permission = 4
    OTHERS = 5.
    IF objtype(3) = 'OTF'.
    desired_type = otf.
    ELSE.
    desired_type = ali.
    ENDIF.
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'
    EXPORTING
    rqident = src_spoolid
    desired_type = desired_type
    IMPORTING
    real_type = real_type
    TABLES
    buffer = l_objcont
    EXCEPTIONS
    no_such_job = 14
    type_no_match = 94
    job_contains_no_data = 54
    no_permission = 21
    can_not_access = 21
    read_error = 54.
    IF sy-subrc EQ 0.
    attach_type = real_type.
    ENDIF.
    CALL FUNCTION 'SO_FOLDER_ROOT_ID_GET'
    EXPORTING
    owner = sy-uname
    region = ou_fol
    IMPORTING
    folder_id = l_folder_id
    EXCEPTIONS
    OTHERS = 5.
    fill out informations about the header of the email
    CLEAR: g_document.
    g_document-foltp = l_folder_id-foltp.
    g_document-folyr = l_folder_id-folyr.
    g_document-folno = l_folder_id-folno.
    g_document-objtp = c_objtp.
    g_document-objdes = header_mail.
    g_document-file_ext = c_file_ext.
    g_header_data-objdes = header_mail.
    CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
    EXPORTING
    method = 'SAVE'
    office_user = sy-uname
    IMPORTING
    authority = g_authority
    TABLES
    attachments = lt_attachments
    CHANGING
    document = g_document
    header_data = g_header_data
    EXCEPTIONS
    OTHERS = 1.
    folder_id-objtp = l_folder_id-foltp.
    folder_id-objyr = l_folder_id-folyr.
    folder_id-objno = l_folder_id-folno.
    object_id-objtp = c_objtp.
    object_id-objyr = g_document-objyr.
    object_id-objno = g_document-objno.
    link_folder_id-objtp = l_folder_id-foltp.
    link_folder_id-objyr = l_folder_id-folyr.
    link_folder_id-objno = l_folder_id-folno.
    REFRESH lt_rec_tab.
    LOOP AT LIST_FAX_MAIL_NUMBER.
    lt_rec_tab-recextnam = LIST_FAX_MAIL_NUMBER-LINE.
    lt_rec_tab-recesc = 'U'.
    lt_rec_tab-sndart = 'INT'.
    lt_rec_tab-sndpri = 1.
    APPEND lt_rec_tab.
    ENDLOOP.
    lt_files-file = c_file.
    APPEND lt_files.
    hd_dat-objdes = header_mail.
    CALL FUNCTION 'SO_ATTACHMENT_INSERT'
    EXPORTING
    object_id = object_id
    attach_type = attach_type
    object_hd_change = hd_dat
    owner = sy-uname
    TABLES
    objcont = l_objcont
    objhead = l_objhead
    EXCEPTIONS
    active_user_not_exist = 35
    communication_failure = 71
    object_type_not_exist = 17
    operation_no_authorization = 21
    owner_not_exist = 22
    parameter_error = 23
    substitute_not_active = 31
    substitute_not_defined = 32
    system_failure = 72
    x_error = 1000.
    IF sy-subrc > 0.
    ENDIF.
    send email from SAPOFFICE
    CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
    folder_id = folder_id
    object_id = object_id
    outbox_flag = outbox_flag
    link_folder_id = link_folder_id
    owner = sy-uname
    TABLES
    receivers = lt_rec_tab
    note_text = lt_note_text
    EXCEPTIONS
    active_user_not_exist = 35
    communication_failure = 71
    component_not_available = 1
    folder_no_authorization = 5
    folder_not_exist = 6
    forwarder_not_exist = 8
    object_no_authorization = 13
    object_not_exist = 14
    object_not_sent = 15
    operation_no_authorization = 21
    owner_not_exist = 22
    parameter_error = 23
    substitute_not_active = 31
    substitute_not_defined = 32
    system_failure = 72
    too_much_receivers = 73
    user_not_exist = 35.
    ENDFUNCTION.
    Edited by: katigiri linganna on Jul 31, 2009 8:56 AM

  • Sending smartform as pdf attachment through mail

    Dear All,
    Can anyone suggest me sample code of how an sap smartform output is sent as pdf attachment to a receipients email address?
    Thanks
    M A

    hi,
    chk this sample code.
    * Internal Table declarations
    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
          i_tline TYPE TABLE OF tline WITH HEADER LINE,
          i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
          i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    * Objects to send mail.
          i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
          i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    * Work Area declarations
          wa_objhead TYPE soli_tab,
          w_ctrlop TYPE ssfctrlop,
          w_compop TYPE ssfcompop,
          w_return TYPE ssfcrescl,
          wa_doc_chng typE sodocchgi1,
          w_data TYPE sodocchgi1,
          wa_buffer TYPE string,"To convert from 132 to 255
    * Variables declarations
          v_form_name TYPE rs38l_fnam,
          v_len_in LIKE sood-objlen,
          v_len_out LIKE sood-objlen,
          v_len_outn TYPE i,
          v_lines_txt TYPE i,
          v_lines_bin TYPE i.
    call function 'SSF_FUNCTION_MODULE_NAME'
         exporting
              formname           = 'ZZZ_TEST1'
         importing
              fm_name            = v_form_name
         exceptions
              no_form            = 1
              no_function_module = 2
              others             = 3.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    w_ctrlop-getotf = 'X'.
    w_ctrlop-no_dialog = 'X'.
    w_compop-tdnoprev = 'X'.
    CALL FUNCTION v_form_name
         EXPORTING
              control_parameters = w_ctrlop
              output_options     = w_compop
              user_settings      = 'X'
         IMPORTING
              job_output_info    = w_return
         EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    i_otf[] = w_return-otfdata[].
    call function 'CONVERT_OTF'
           EXPORTING
                format                = 'PDF'
                max_linewidth         = 132
           IMPORTING
                bin_filesize          = v_len_in
           TABLES
                otf                   = i_otf
                lines                 = i_tline
           EXCEPTIONS
                err_max_linewidth     = 1
                err_format            = 2
                err_conv_not_possible = 3
                others                = 4.
    *   Fehlerhandling
      if sy-subrc <> 0.
      endif.
      loop at i_tline.
        translate i_tline using '~'.
        concatenate wa_buffer i_tline into wa_buffer.
      endloop.
      translate wa_buffer using '~'.
      do.
        i_record = wa_buffer.
        append i_record.
        shift wa_buffer left by 255 places.
        if wa_buffer is initial.
          exit.
        endif.
      enddo.
    * Attachment
      refresh:
        i_reclist,
        i_objtxt,
        i_objbin,
        i_objpack.
      clear wa_objhead.
      i_objbin[] = i_record[].
    ******* Create Message Body
    **** Title and Description
      i_objtxt = 'test with pdf-Attachment!'.
      append i_objtxt.
      describe table i_objtxt lines v_lines_txt.
      read table i_objtxt index v_lines_txt.
      wa_doc_chng-obj_name = 'smartform'.
      wa_doc_chng-expiry_dat = sy-datum + 10.
      wa_doc_chng-obj_descr = 'smartform'.
      wa_doc_chng-sensitivty = 'F'.
      wa_doc_chng-doc_size = v_lines_txt * 255.
    **** Main Text
    *  wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
      clear i_objpack-transf_bin.
      i_objpack-head_start = 1.
      i_objpack-head_num = 0.
      i_objpack-body_start = 1.
      i_objpack-body_num = v_lines_txt.
      i_objpack-doc_type = 'RAW'.
      append i_objpack.
    **** Attachment
    * (pdf-Attachment)
      i_objpack-transf_bin = 'X'.
      i_objpack-head_start = 1.
      i_objpack-head_num = 0.
      i_objpack-body_start = 1.
    * Länge des Attachment ermitteln
      describe table i_objbin lines v_lines_bin.
      read table i_objbin index v_lines_bin.
      i_objpack-doc_size =  v_lines_bin * 255 .
      i_objpack-body_num = v_lines_bin.
      i_objpack-doc_type = 'PDF'.
      i_objpack-obj_name = 'smart'.
      i_objpack-obj_descr = 'test'.
      append i_objpack.
      clear i_reclist.
      i_reclist-receiver = '[email protected]'.
      i_reclist-rec_type = 'U'.
      append i_reclist.
        call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
             EXPORTING
                  document_data              = wa_doc_chng
                  put_in_outbox              = 'X'
             TABLES
                  packing_list               = i_objpack
                  object_header              = wa_objhead
                  CONTENTS_BIN               = i_objbin
                  contents_txt               = i_objtxt
                  receivers                  = i_reclist
             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.
    Regards
    Anver

  • Send PDF  attachment through mail

    i have one PDF document on my desktop, i want to sent that PDF as attachment to mail through SAP.
    can anybody have idea how to get?

    i also had the same requirement... the following code is to attach a pdf file from PC. 'PDF' has been hard coded. to attach a text file change it to 'TXT'.
    *& Report  Y_FILE_FROM_PC
    REPORT  y_file_from_pc.
    * This program will allowed you to send email with attachment.
    First, specify the attachment file from your local hardisk and execute.
    Next, specify the sender email address and click the send button.
    DATA: method1 LIKE sy-ucomm,
    g_user LIKE soudnamei1,
    g_user_data LIKE soudatai1,
    g_owner LIKE soud-usrnam,
    g_receipients LIKE soos1 OCCURS 0 WITH HEADER LINE,
    g_document LIKE sood4 ,
    g_header LIKE sood2,
    g_folmam LIKE sofm2,
    g_objcnt LIKE soli OCCURS 0 WITH HEADER LINE,
    g_objhead LIKE soli OCCURS 0 WITH HEADER LINE,
    g_objpara LIKE selc OCCURS 0 WITH HEADER LINE,
    g_objparb LIKE soop1 OCCURS 0 WITH HEADER LINE,
    g_attachments LIKE sood5 OCCURS 0 WITH HEADER LINE,
    g_references LIKE soxrl OCCURS 0 WITH HEADER LINE,
    g_authority LIKE sofa-usracc,
    g_ref_document LIKE sood4,
    g_new_parent LIKE soodk.
    DATA: BEGIN OF g_files OCCURS 10 ,
    text(4096) TYPE c,
    END OF g_files.
    DATA : fold_number(12) TYPE c,
    fold_yr(2) TYPE c, fold_type(3) TYPE c.
    PARAMETERS ws_file(4096) TYPE c DEFAULT 'c:\debugger.PDF'.
    can me any file fromyour pc ....either xls or word or ppt etc ...
    g_user-sapname = sy-uname.
    CALL FUNCTION 'SO_USER_READ_API1'
    EXPORTING user = g_user
    prepare_for_folder_access = ' '
    IMPORTING
    user_data = g_user_data
    *EXCEPTIONS
    user_not_exist = 1
    parameter_error = 2
    x_error = 3
    OTHERS = 4
    IF sy-subrc NE 0.
    message id sy-msgid type sy-msgty number sy-msgno
    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    fold_type = g_user_data-outboxfol+0(3).
    fold_yr = g_user_data-outboxfol+3(2).
    fold_number = g_user_data-outboxfol+5(12).
    CLEAR g_files.
    REFRESH : g_objcnt, g_objhead, g_objpara, g_objparb, g_receipients, g_attachments, g_references, g_files.
    method1 = 'SAVE'.
    g_document-foltp = fold_type.
    g_document-folyr = fold_yr.
    g_document-folno = fold_number.
    g_document-objtp = g_user_data-object_typ.
    *g_document-objyr = '27'.
    *g_document-objno = '000000002365'.
    *g_document-objnam = 'MESSAGE'.
    g_document-objdes = 'attach file from pc'.
    g_document-folrg = 'O'.
    *g_document-okcode = 'CHNG'.
    g_document-objlen = '0'.
    g_document-file_ext = 'PDF'.
    g_header-objdes = 'attach file from pc'.
    g_header-file_ext = 'PDF'.
    CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
    EXPORTING method = method1
    office_user = sy-uname
    ref_document = g_ref_document
    new_parent = g_new_parent
    IMPORTING
    authority = g_authority
    TABLES
    objcont = g_objcnt
    objhead = g_objhead
    objpara = g_objpara
    objparb = g_objparb
    recipients = g_receipients
    attachments = g_attachments
    references = g_references
    files = g_files
    CHANGING
    document = g_document
    header_data = g_header
    folmem_data =
    receive_data =
    file from the pc to send..
    method1 = 'ATTCREATEFROMPC'.
    g_files-text = ws_file.
    APPEND g_files.
    CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
      EXPORTING
        method       = method1
        office_user  = g_owner
        ref_document = g_ref_document
        new_parent   = g_new_parent
      IMPORTING
        authority    = g_authority
      TABLES
        objcont      = g_objcnt
        objhead      = g_objhead
        objpara      = g_objpara
        objparb      = g_objparb
        recipients   = g_receipients
        attachments  = g_attachments
        references   = g_references
        files        = g_files
      CHANGING
        document     = g_document
        header_data  = g_header.
    method1 = 'SEND'.
    g_receipients-recnam = 'ABAP'.
    g_receipients-recesc = 'B'.
    g_receipients-sndex = 'X'.
    APPEND g_receipients.
    CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
      EXPORTING
        method       = method1
        office_user  = g_owner
        ref_document = g_ref_document
        new_parent   = g_new_parent
      IMPORTING
        authority    = g_authority
      TABLES
        objcont      = g_objcnt
        objhead      = g_objhead
        objpara      = g_objpara
        objparb      = g_objparb
        recipients   = g_receipients
        attachments  = g_attachments
        references   = g_references
        files        = g_files
      CHANGING
        document     = g_document
        header_data  = g_header.
    hope this helps!

  • Naming of the PDF attachment when mailing from Bursting engine

    Hi,
    We have a xml publisher report for which we have implemented Bursting Engine to archive the and burst the PDF output.
    We have a requirement now to send the PDF output as attachment to external email ids(to suppliers).I am trying to test using e the below control file to send the PDFs as attachments but the name of the PDF attachment in the mail is numeric '3','6','9' etc...
    I would like to know how do we name the PDF output attachment of the bursting engine.
    -------------------------Burst Control File------------------------------------------
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
    <xapi:globalData location="stream">
    </xapi:globalData >
    <xapi:request select="/XXX_XMLPUB_ARINV/LIST_G_INVOICES/G_INVOICES">
    <xapi:delivery>
    <xapi:email server="127.0.0.1"
    port="25"
    from="[email protected]"
    reply-to="[email protected]"
    >
    <xapi:message id="123"
    to="${PURCHASE_ORDER_NUM}"
    bcc=""[email protected]""
    attachment="true"
    subject="${TRX_NUMBER}"
    >
    <html><body>test</body></html>
    </xapi:message>
    </xapi:email>
    </xapi:delivery>
    <xapi:document output-type="pdf" delivery="123">
    <xapi:template type="rtf" location="${XMLPUB_RTF_TEMPLATE}" filter=".//G_INVOICES[PRINTING_COUNT='0']">
    </xapi:template>
    </xapi:document>
    </xapi:request>
    </xapi:requestset>
    Thanks,
    Krishnan
    Edited by: Krishnan-Apps on Dec 23, 2009 2:30 AM

    Hi,
    I seriously doubt your control file is a working one. Can you upload your working/correctly formatted file?
    Or check this working sample below. Hope this helps.
    <?xml version="1.0" encoding="UTF-8"?>
    <xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi">
    <xapi:request select="/">
         <xapi:delivery>
           <xapi:email server="xxmail.mail.com" port="25" from="[email protected]" reply-to ="[email protected]">
             <xapi:message id="${TRX_NUMBER}" to="[email protected]" cc="" bcc=""
              attachment="true" content-type="text/html" subject="${TRX_TYPE_NAME} Number ${TRX_NUMBER}">
           </xapi:message>
           </xapi:email>
         </xapi:delivery>
         <xapi:document output="Invoice_Number_${TRX_NUMBER}" output-type="pdf" delivery="${TRX_NUMBER}">
           <xapi:template type="rtf" location="xdo://AR.XXRAXINV_SEL.en.US/?getSource=true" filter="">
           </xapi:template>
         </xapi:document>
    </xapi:request>
    </xapi:requestset>regards,
    Rownald

  • PDF attachment in mail adapter

    Hi
    I am reading mailbox using mail adapter. But i cannot read the PDF attachment in that mail. I use "PayloadSwapBean" in the module, but it is packing the mailbody to the text file, but they is no sign of PDF attachment. How to read the attachment.
    Regards
    Andy

    Hi Anandan,
    You can use Java/ABAP proxies to do this job for you..
    Java Proxy >> will read the mail(with the attachments) with the help of Java APIs and send the message into XI ABAP Proxy >> for this you will have to first convert the attachment into a message and then you can proceed in the regular fashion.
    Not all adapters can process attachments, I'm not sure why you are having trouble with using module processor in the mail adapter. Just check if the service pack that you are using supports this feature.
    If you are on WAS 6.10 and above you can achieve this and there is an excellent weblog by Thomas Jung on this topic at
    /people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher

Maybe you are looking for

  • Read only column in tabular form

    There is a not null column ( say SEQ) in a tabular form that is getting an auto value from other process. 2 more columns need user input on each row.I need to make this column(SEQ) as read only. If I make this column (SEQ) as standard report column t

  • Excel Output appears in IE after submitting XDOREPPB from backend

    Hello, I have submitted the XML Report Publisher request with Output Format = EXCEL from Standard Request Submission and after completion clicked View Output, it asks me to save the file as EXCEL format. While doing the same exercise from backend, it

  • HP SimpleSave md1000h write protected! - can't initialize drive

    The drive does not show up under windows explorer. Under Disk Management, the drive shows up as Not Initialized and Unallocated. When I try to initialize the drive I get "The media is write protected" Restarted the PC and also the external hard drive

  • How to create a field catalogue dynamically?

    Hi guys,       I have to create a field catalogue dynamically. I am creating the internal table dynamcially. It is <fs_dyn_table>. I am passing this to the function module REUSE_ALV_FIELDCATALOG_MERGE. <fs_dyn_table> contains five fields kunnr, land1

  • OraCle 9i Version Confusion

    Friends, i Downloaded Oracle 9.2.0.1 from Oracle Site, On my PC i have installed Windows 2000 Proferssional with SP4 or Windows XP{ Professional With SP2 now my query  is that version install on my PC or not Thanks Adnan