Attach PDF in mail

Hello,
I have a requirement to attach a pdf file and send it as an attachement to the recipients in the mailing list,
I have got the internal table holding the pdf data using CALL FUNCTION 'ZCONVERT_ABAPSPOOLJOB_2_PDF which is i_pdf,
Now i have not been able to figure out how do i use this table and pass it to the fm
CALL FUNCTION 'SO_DOCUMENT_SEND_API1' . kindly advise.
Thanks in anticipation!

Hello,
check the below one it may help u .
Its for report
data : t_packing_list like sopcklsti1 occurs 0 with header line,
         t_packing_list like sopcklsti1 occurs 0 with header line,
         it_message type standard table of solisti1 initial size 0 with header line,
         t_receivers like somlreci1 occurs 0 with header line,
         w_doc_data like sodocchgi1,
         ld_sender_address like soextreci1-receiver,
         ld_sender_address_type like soextreci1-adr_typ,
         w_sent_all(1) type c,
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.
For smartforms check this link
http://wiki.sdn.sap.com/wiki/display/Snippets/Smartform%2boutput%2bto%2bPDF%2bformat
Thanks & reagrads,
santhosh
Edited by: santhosh kumar on Jan 7, 2010 10:57 AM

Similar Messages

  • Attaching PDFs to Mail Through Print Dialog

    When using the PDF pulldown in the print dialog to email a preview PDF, Microsoft Word names the file "Microsoft Word - xxx.pdf. Is there a way to change this name while in Mail? Otherwise I need to save the PDF to the desktop, attach, then throw away the PDF.
    Thanks

    I've never found a way to do it. AFAIK, plastering "Microsoft Word" to the front of your filename (when printing) is a "feature" you can't change. The Windows version of Office does this too (you see it when viewing documents in a Windows print queue), but most Windows PDF creation tools ignores it.
    MS Office for Mac is the only program I'm aware of that does this. Our OpenOffice.org users don't have this problem.
    Sorry,
    - WG
    PowerMac G5   Mac OS X (10.4.8)  

  • Missing attachment size in mail 4.3

    Hi, when I attach a jpeg to an email, I can see the size of the attachment at the bottom of the window but when I attach a pdf, the 'message size' and 'image size' are both missing. Please does anybody know if this is standard or do I have a problem?

    Stuart,
    The problem in the earlier version of Mail was that if the Image Size button were used with PDF, to anything other than Actual Size, the PDF was converted to a JPEG and havoc resulted. It was very purposefully removed in later versions of Mail unless true image files that could be downsized as JPEG files were what were attached. I know this because I was one who pointed out the error that could result. The resizing was prevented in the final Version of Mail 2.x, but the Message size Report and Image Size button were not removed when attaching PDF until Mail 3.x and later.
    The current behavior is not a bug, and the Message Size was only meant to appear when Image Size button could be used to reduce the size of the files, and thus the entire message.
    Ernie
    Message was edited by: Ernie Stamper

  • Facing problem with logo in the PDF attachment when sending mail...

    hi friends,
    i'm facing problem with logo in the PDF attachment to the mail.
    my requirement:
    1. enter spool number and mail id in the selection screen.
    process:
    1. now the program will fetch the spool data and converts it to PDF.
    2. but when i'm trying to send mail with this PDF as attachment.
    when i open the PDF file from the mail, logo is not coming properly (looks disturbed).
    can anyone help me how to resolve this issue...
    thanks in advance, murashali.

    hi dinakar, thanks for your mail...
    logo looks good in spool/script/smartform.
    even it look good when i download this spool to pdf and to the presentation server as pdf file.
    i'm using CONVERT_OTFSPOOLJOB_2_PDF.
    when i used CONVERT_ABAPSPOOLJOB_2_PDF, is gives a msg - 'spool number not found'.
    here i'm using folloing code to pass pdf to the function module: SO_NEW_DOCUMENT_ATT_SEND_API1.
    code:
    Transfer the 132-long strings to 255-long strings
      lt_mtab_pdf[] = pdf[].
      LOOP AT lt_mtab_pdf INTO lwa_mtab_pdf.
        TRANSLATE lwa_mtab_pdf USING ' ~'.
        CONCATENATE lv_gd_buffer lwa_mtab_pdf INTO lv_gd_buffer.
        CLEAR lwa_mtab_pdf.
      ENDLOOP.
      TRANSLATE lv_gd_buffer USING '~ '.
      DO.
        lwa_mess_att = lv_gd_buffer.
        APPEND lwa_mess_att TO lt_mess_att.
        CLEAR lwa_mess_att.
        SHIFT lv_gd_buffer LEFT BY 255 PLACES.
        IF lv_gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    NOTE: problem i believe is with ''.  i'm getting this tilt symbol () in my pdf internal table.  here in the above code the line   TRANSLATE lv_gd_buffer USING '~ ' is changing the existing tilt to space.  so my logo is getting disturbed.
    even i tried with REPLACE this tilt with other char, but it doent work.
    can you give any idea...

  • How do I email an attached pdf file to stationary templates in mail.

    How do I email an attach PDF file using the stationary templates in mail on lion.
    I attached the PDF but when try to send it I get back a dialog box that sez:
    "This message cannot be sent because it uses stationery and contains attachments that are not images. Messages with stationery cannot contain attachments that aren’t images. You can cancel and return to editing the message or remove the stationery in order to send." My choice is to cancel or remove stationary.
    Is there a third party solution? Any suggestion?

    No
    Envoyé depuis Molto pour iPad
    De: pwillener
    Envoyé: jeudi, février 12, 2015 07:14 AM
    À: René Allamelle
    Objet:  how do I compress a large pdf file to fit in an email?
    how do I compress a large pdf file to fit in an email?
    created by pwillener in Adobe Acrobat.com Services - View the full discussion
    But generally it is never a good idea to send e-documents as email attachments.  Better use a file sharing service (Acrobat.com, Dropbox, Google Drive, Microsoft OneDrive, ..), upload the document, then send the shared download link via email.
    If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7187079#7187079 and clicking ‘Correct’ below the answer
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7187079#7187079
    To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"
    Start a new discussion in Adobe Acrobat.com Services by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • PDF e-mail attachment will not open after FF update

    FF 31 and/or 32
    Outlook or GroupWise fat client
    PDF attachments
    After FF updated PDF's were re-associated with FF not the installed PDF program. Used Windows to re associate PDF's to PDF program. No problem, all PDF's open in PDF program UNLESS the PDF is an attachment in an e-mail.
    Open e-mail fat client (doesn't matter the client) try and open the PDF and user gets message stating there is no program associated with attachment. Yet, all PDF's still open with correct PDF program as long as they are not in the e-mail. Now here's the really weird part.....
    If there are two or more PDF's attachments in the same e-mail the first one will not open but the second, thirds, etc attached PDF's will open with the correct PDF program.
    The only temporary solution I have found is to uninstall FF, re-install it and for a 1/2 day the issue goes away. I have not figured out the trigger that resets the issue.
    FF is my go-to browser, but since v 31 this has been happening and if it keeps up, I'm switching to Chrome.
    Come on Tech Support, help us out with this issue.

    Sorry you're having this problem. I think it was previously reported only by Windows XP users.
    When you reinstall, were you making Firefox your default browser? Some users have reported that ''not'' making Firefox the default browser was an effective workaround.
    However, you may have success with this approach, suggested by a user in another thread, which appears to more thoroughly update the Windows registry:
    # Open Adobe Reader / Acrobat
    # Edit->Preferences
    # In the Categories column click 'General'
    # Near the bottom of the page click the button marked 'Select Default PDF Handler'
    # In the dialog, select 'Adobe Reader XI' (or Adobe Acrobat, as the case may be) and click 'Apply'
    # A Windows Configuration screen will appear. Allow it to do its stuff (takes a few minutes), then restart your computer when prompted.
    Does that resolve the issue for you?

  • How to open a pdf attachment in imac mail

    I am unable to open a PDF attachment in Mac Mail. There is not a PDF Icon in the email message. Is there a setting that should be checked?
    I have a new iMac (less than a month old) with Mountain Lion.
    Help would be greatly appreciated. Thanks

    It is an actual PDF that is an attachment to an email. There is not a link to click on to open the attachment.
    The attachment is a statement that I normally open, then print..
    What I am seeing on the monitor is the heading portion of the email with the statement image, all on one page..It prints exactly as seen on the screen.
    I have checked my Mail>Preferences>Viewing Tab."Display remote images in HTML" messages is checked..
    Thanks for the help.

  • How to create a pdf for the URL attached to an invoice and send it as an attachment in a mail

    HI,
    I have requirement where i need to get the URL attached to an invoice, create the pdf and send as an attachement in a mail.
    The URL attached to an invoice can be seen by following the path : VF03-> Billing document->system->Services for object ->Attachement list.
    On searching through existing forums, i found that there is a table 'SRGBTBREL' which stores relationships of GOS object. On giving the invoice number in field 'INSTID_A', i could find an entry in this table.
    To get the content, i used the class CL_FITV_GOS, method GET_CONTENT. To this method i passed following values:
    IV_ATTA_ID = FOL21000000000521URL39000000000012 (The value if field INSTID_B from table SRGBTBREL)
    IV_OBJTP   = 'URL'
    On execution, i get URL link but the content table is empty.
    Could anybody provide some input on how i get the content? Or may be how i can create pdf from the URL link and attach it to mail as an attachment?
    Thanks,

    Hi Amit,
    Solution provided by you is working when the link length is one line but it is not working for more than one line
    Eg: say link is https://......80 [80 characters long]
    I will give    <a href="https://...72            [in first line]
                     73..80">click here</a>         [in second line]
    I will get the output as 73...80">click here
    But i want only CLICK HERE in my output..
    Please suggest solution.
    Thanks,
    Kavya

  • Error while opening PDF attachment sent via mail

    Hi,
    I am attaching PDF file to PO in me22n and sending the same file as attachment in the mail to the vendor using class CL_BCS.
    The mail is sent to the vendor successfully and they are able to successfully open the PDF attachment. But in some cases the mail is successfully received but while opening the attachment it is giving the error as file is corrupted.
    Please help me to resolve this issue.
    Thanks and regards,
    Jayashree

    Hi,
    I would like to know what font type, you are using in the forms.
    Ideally it should be HELVETICA .
    If you are using any other font in your style/form,try changing it to HELVETICA & Test.
    Also Check the OTF data at the call of gen. FM,before converting it to PDF.
    Regds,
    AS
    Edited by: abheesawant on Oct 12, 2011 7:48 AM

  • Install 3rd party PDF iFilter for index PDF file as attachment in e-mail (msg)

    I have called Microsoft Permium Support, base on the reply, SharePoint 2013 does not support to index a PDF file attachment in E-mail (msg) except 3rd party iFilter installed. And they finally told me how to edit Windows Registry for install the Adobe iFilter.
    But, the Adobe iFilter is too weak to call large PDF files. So, I would like to install and try the Foxit PDF iFilter, but I cannot find an installation guide for this 3rd party ifilter with SharePoint 2013. 
    Does anyone here have the experience for Foxit PDF iFilter with SharePoint 2013 can help me?
    I am not sure it is bug or feature in SharePoint 2013, but in case I still have to install 3rd party iFilter for index PDF file. I have no idea what is the out of box pdf file indexing support for.

    You ca plan to use Foxit. 
    steps are nearly the same which we use in sharepoint 2013
    1. We need to update registry for pdf . Registry value is {987f8d1a-26e6-4554-b007-6b20e2680632}
    2. we need to install the foxit ifilter
    Here are steps for same
    http://support.microsoft.com/kb/2293357
    3. run below command:
    net stop spsearch4
    net start spsearch4
    net stop osearch14
    net start osearch14
    Check below:
    http://bjarnegram.wordpress.com/2011/07/13/installing-foxit-pdf-ifilter-on-sharepoint-server-2010/

  • How can I send a PDF via mail without it becoming an attached file?

    Hi All!
    I need to know how I am able to send a PDF file via mail, without it becoming an attached file. This means when the receiver opens the mail, he automatically sees the PDF without first having to read the normal mail text and scroll down to open the attached PDF file. Just like a spam newsletter
    Also I want to know - I want some illustrations in my portfolio to be a hyperlink to a website, is this possible on a picture (not on an URL) - and if so - How?
    Hope you can help me out here!
    ** I use Adobe Acrobat Reader Pro X 10.1.10 on a Macbook Pro 10.8.5**
    Thanks,
    Carlinsky

    Carlinsky wrote:
    Hi All!
    I need to know how I am able to send a PDF file via mail, without it becoming an attached file. This means when the receiver opens the mail, he automatically sees the PDF without first having to read the normal mail text and scroll down to open the attached PDF file. Just like a spam newsletter
    Not possible with Adobe Reader or Adobe Acrobat.

  • Reading an PDF Attachment  From Sender Mail Adapter

    Hi All,
                   i am able to get a mail  from my Mail Server, But my aim is need to Read an PDF attachment from the mail, in SXMB Moni i am getting the Payload with attachment, I have a created a module to convert that PDF to XML(Module is working fine in file to file sceneraio) .
    In adapter should i need to use Payload Swap Bean Module also , because in sap help said that i need  Select Keep Attachments. I want to know how that how to Push the PDF attachment to My Custom Module which is used to convert the PDF To XML.
    If Payload Swap Bean Module needs to be Used , please tell me the Key Names and Key Values to be used.(swap.keyName,swap.keyValues)
    Thanks and Regards,
    Kamal
    Note: Points will be awarded

    Kamal...
    See if this helps
    [Module Name]
      AF_Modules/PayloadSwapBean
    [Module Parameters]
    The following parameters are used for this module
      swap.keyName          the name of a supported attribute.
      swap.keyValue         the value of a partial string that is required
                            to appear.
    The supported attributes (swap.keyName) include the payload attributes
    such as payload-name, payload-description and any content attributes
    such as content-type, content-disposition, content-description, etc.
    Regards
    Ravi Raman

  • Problem in displaying smartform as pdf in mail attachment

    Hi Gurus,
    I have generated a Smartform, converted to PDF and sent as attachment to email, upto this everything working fine.
    Now the email is generated with the PDF attachment but Adobe Reader encounters an error when opening.
    Error display as below mentioned
    Adobe Reader could not open 'abc_X.PDF' because it is either not a supported file type or because the file has been damaged(for  example, it was sent as an email attachment and wasn't correctly decoded).
    The program cods as below mentioned
    TYPES:BEGIN OF ty_viqmel,
          qmnum TYPE viqmel-qmnum,
          qmart TYPE viqmel-qmart,
          objnr TYPE viqmel-objnr,
          qmtxt TYPE viqmel-qmtxt,
          erdat TYPE viqmel-erdat,
          erzeit TYPE viqmel-erzeit,
          aenam TYPE viqmel-aenam,
          aufnr TYPE viqmel-aufnr,
          qmdab TYPE viqmel-qmdab,
          swerk TYPE viqmel-swerk,
          END OF ty_viqmel.
    TYPES: BEGIN OF ty_t001w,
           werks TYPE werks,
           name1 TYPE name1,
           END OF ty_t001w.
    DATA:IT_VIQMEL TYPE TABLE OF TY_VIQMEL,
         WA_VIQMEL TYPE TY_VIQMEL,
         IT_T001W TYPE TABLE OF TY_T001W,
         WA_T001W TYPE TY_T001W,
         IT_FINAL TYPE TABLE OF ZPM_T_MAINTENACE,
         WA_FINAL TYPE ZPM_T_MAINTENACE.
    data: it_diff like it_viqmel,
            wa_diff like line of it_diff.
    Smartforms data declarations
    DATA: lv_fmname   TYPE rs38l_fnam, "value 'ZPM_F_MAINTENANCE_REQUEST'.
         w_cparam     TYPE ssfctrlop ," To display smart form in arabic.
          w_compop type ssfcompop,
          W_bin_filesize TYPE i, " Binary File Size
    w_FILE_NAME type string,
    w_File_path type string,
    w_FULL_PATH type string,
    WA_BUFFER TYPE STRING. "To convert from 132 to 255
    Internal table to hold the OTF data
    DATA:
    t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    Internal table to hold OTF data recd from the SMARTFORM
    t_otf_from_fm TYPE ssfcrescl,
    Internal table to hold the data from the FM CONVERT_OTF
    T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    Objects to send mail.
    data: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,
    I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    WA_OBJHEAD TYPE SOLI_TAB,
         WA_DOC_CHNG TYPE SODOCCHGI1.
    DATA: V_LEN_IN LIKE SOOD-OBJLEN,
    I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
    V_LEN_OUT LIKE SOOD-OBJLEN,
    V_LEN_OUTN TYPE I,
    V_LINES_TXT TYPE I,
    V_LINES_BIN TYPE I.
    START-OF-SELECTION.
    SELECT QMNUM
           QMART
           QMTXT
           ERDAT
           ERZEIT
           AENAM
           AUFNR
           QMDAB
           SWERK
           OBJNR
      FROM VIQMEL
      INTO CORRESPONDING FIELDS OF TABLE IT_VIQMEL
                   WHERE aufnr = SPACE
                   and qmdab = '00000000'
                   AND ( QMART EQ 'M1' OR QMART EQ 'M2' OR QMART EQ 'M3' ).
      IF SY-SUBRC = 0.
        sort it_viqmel by qmnum.
        ENDIF.
        loop at it_viqmel into wa_viqmel.
          perform 72hours.
    endloop.
    SELECT WERKS
           NAME1 FROM T001W INTO TABLE IT_T001W
                 FOR ALL ENTRIES IN IT_diff
                 WHERE WERKS = IT_diff-SWERK.
      IF SY-SUBRC = 0.
        LOOP AT IT_diff INTO WA_diff.
       READ TABLE IT_T001W INTO WA_T001W WITH KEY WERKS = WA_diff-SWERK.
       IF SY-SUBRC = 0.
         WA_FINAL-QMNUM = WA_diff-QMNUM.
          WA_FINAL-QMTXT = WA_diff-QMTXT.
          WA_FINAL-ERDAT = WA_diff-ERDAT.
            WA_FINAL-ERZEIT = WA_diff-ERZEIT.
             WA_FINAL-SWERK = WA_diff-SWERK.
              WA_FINAL-NAME1 = WA_T001W-NAME1.
               WA_FINAL-AENAM = WA_diff-AENAM.
               APPEND WA_FINAL TO IT_FINAL.
               CLEAR WA_FINAL.
               ENDIF.
               ENDLOOP.
               ENDIF.
    clear:w_cparam,w_compop.
    w_cparam-langu = 'AR'.
    w_cparam-getotf = 'X'.
    w_cparam-no_dialog = 'X'. " Suppressing the dialog box
    W_COMPOP-TDNOPREV = 'X'.
    w_compop-tddest = 'LP01'.
    W_COMPOP-TDPRINTER = 'PRINTER'.
                CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
                 EXPORTING
                   formname                 = 'ZPM_F_MAINTENANCE_REQUEST'
                 VARIANT                  = ' '
                 DIRECT_CALL              = ' '
                IMPORTING
                  FM_NAME                  = lv_fMNAME
                EXCEPTIONS
                  NO_FORM                  = 1
                  NO_FUNCTION_MODULE       = 2
                  OTHERS                   = 3
               IF sy-subrc <> 0.
    Implement suitable error handling here
               ENDIF.
    CALL FUNCTION lv_fmname
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = w_cparam
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS             =  w_compop
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = t_otf_from_fm
      JOB_OUTPUT_OPTIONS         =
      TABLES
        it_final                   = it_final
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5
    IF sy-subrc <> 0.
    Implement suitable error handling here
    ENDIF.
    t_otf[] = t_otf_from_fm-otfdata[].
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
       FORMAT                      = 'PDF'
       MAX_LINEWIDTH               = 132
      ARCHIVE_INDEX               = ' '
      COPYNUMBER                  = 0
      ASCII_BIDI_VIS2LOG          = ' '
      PDF_DELETE_OTFTAB           = ' '
      PDF_USERNAME                = ' '
    IMPORTING
       BIN_FILESIZE                = w_bin_FILESIZE
      BIN_FILE                    =
      TABLES
        otf                         = T_OTF
        lines                       = T_PDF_TAB
    EXCEPTIONS
       ERR_MAX_LINEWIDTH           = 1
       ERR_FORMAT                  = 2
       ERR_CONV_NOT_POSSIBLE       = 3
       ERR_BAD_OTF                 = 4
       OTHERS                      = 5
    IF sy-subrc <> 0.
    Implement suitable error handling here
    ENDIF.
    LOOP AT T_PDF_TAB.
    TRANSLATE T_PDF_TAB USING '~'.
    CONCATENATE WA_BUFFER T_PDF_TAB 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 = 'Maintenance Request'.
    APPEND I_OBJTXT.
    DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
    READ TABLE I_OBJTXT INDEX V_LINES_TXT.
    WA_DOC_CHNG-OBJ_NAME = 'ZPM_F_MAINTENANCE_REQUEST'.
    *WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
    WA_DOC_CHNG-OBJ_DESCR = 'Maintenance Request'.
    WA_DOC_CHNG-SENSITIVTY = 'F'.
    WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
    Main Text
    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.
    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 = 'ZPM_F_MAINTENANCE_REQUEST'.
    I_OBJPACK-OBJ_DESCR = 'Maintenance Request'.
    APPEND I_OBJPACK.
    CLEAR I_RECLIST.
    I_RECLIST-RECEIVER = '[email protected]'.
    I_RECLIST-REC_TYPE = 'U'.
    APPEND I_RECLIST.
    ENDLOOP.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
      EXPORTING
        document_data                    = WA_DOC_CHNG
       PUT_IN_OUTBOX                    = 'X'
      SENDER_ADDRESS                   = SY-UNAME
      SENDER_ADDRESS_TYPE              = 'B'
       COMMIT_WORK                      = 'X'
    IMPORTING
      SENT_TO_ALL                      = w_sent_all
      NEW_OBJECT_ID                    =
      SENDER_ID                        =
      tables
        packing_list                     = I_OBJPACK
       OBJECT_HEADER                    = WA_OBJHEAD
       CONTENTS_BIN                     = I_OBJBIN
       CONTENTS_TXT                     = I_OBJTXT
      CONTENTS_HEX                     =
      OBJECT_PARA                      =
      OBJECT_PARB                      =
        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
    IF sy-subrc <> 0.
    WRITE:/ 'Error When Sending the File', SY-SUBRC.
    ELSE.
    WRITE:/ 'Mail sent'.
    ENDIF.
    ENDIF.
    ENDIF.
    Please let me know what could be the problem.
    Thanks in advance.
    vs.sarvan.

    Hi Sarvan,
    Post the code in code format.Check on the right side for example.
    Sy-subrc  = 0
    Regards,
    Madhu.

  • Smartform - PDF attachment through E-mail issue

    Hi,
    A custom form and custom program was created to print the Purchase order information through ME21N, 22n and 23n.
    It also has E-mail option. when output medium 5(Simple mail) and 7(External send), email will be send to respective mail-id's with the PDF attachment.
    I have issue at the time of saving PO which processed with medium 5. when i save A popup appears "Express document update was terminated received from author". Brief message about it is
    "Error Info... 00 671: ABAP/4 processor: COMMIT_IN_POSTING"
    In Smartform driver program i am using below function modules to convert OTF into PDF and send through e-mail.
    Function Module: CONVERT_OTF.
    Function Module: SO_DOCUMENT_SEND_API1.
    I am not sure, what i missed out. Can you guys tell is this the correct way to send PDF attachment through E-mail or i missed out any function module for commit.
    Regards,
    Hemanth.
    Edited by: keerthipati hemanth on Jul 31, 2008 1:15 PM
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jul 31, 2008 3:14 PM

    Hi Hemant,
    Below is the code for the  downloading of the smartform into the PDF Format.
    * Program Name : ZPPREP_SHOPFLOOR_VIEWER_ZOOM
    REPORT zppeerep_shorepfloor_viewer_zoom.
    * T A B L E S    D E C L A R A T I O N
    *---Tables Used.
    TABLES: afpo,
            mara,
            marc,
            aufk,
            afko,
            itcoo,
            nast,                          "Messages
            *nast,                         "Messages
            tnapr,                         "Programs & Forms
            addr_key,
            arc_params,                    "Archive parameters
            toa_dara.                      "Archive parameters
    * I N T E R N A L    T A B L E S     D E C L A R A T I O N
    *--Internal Tables Used.
    * D A T A     D E C L A R A T I O N
    *--Global Variables Used.
    DATA: ws_matnr LIKE afpo-matnr,
          ws_werks LIKE aufk-werks,
          ws_mtart LIKE mara-mtart,
          ws_wrkst LIKE mara-wrkst,
          ws_fname TYPE rs38l_fnam,
          ws_ctrlp TYPE ssfctrlop,
          ws_optns TYPE ssfcompop,
          w_padest LIKE tsp03l-padest.                          "BMC01+
    DATA: da_message_printed(1) TYPE c,
          da_preview_processed(1) TYPE c,
          repeat(1) TYPE c,
          da_subrc LIKE sy-subrc.
    DATA: w_otfdata  TYPE ssfcrescl.
    DATA: BEGIN OF it_itcoo OCCURS 0.
            INCLUDE STRUCTURE itcoo.
    DATA: END OF it_itcoo.
    DATA: w_otf  TYPE itcoo.
    *--Data Declaration for Printing Layout
    DATA: ls_itcpo     TYPE itcpo.
    DATA: lf_repid     TYPE sy-repid.
    DATA: lf_device    TYPE tddevice.
    DATA: cf_retcode   TYPE sy-subrc.
    DATA: ls_recipient TYPE swotobjid.
    DATA: ls_sender    TYPE swotobjid.
    DATA: ls_control_param   TYPE ssfctrlop.
    DATA: ls_composer_param  TYPE ssfcompop.
    DATA: ls_addr_key        LIKE addr_key.
    DATA: w_screen(1) TYPE c.
    DATA: xscreen(1) TYPE c.
    DATA: da_mess LIKE vbfs OCCURS 0 WITH HEADER LINE.
    * C O N S T A N T S
    CONSTANTS: c_fas1(8)  TYPE c VALUE 'PRINTFAS',
               c_fas2(15) TYPE c VALUE 'PRINTFASDRAWING',
               c_wip1(8)  TYPE c VALUE 'PRINTWIP',
               c_wip2(15) TYPE c VALUE 'PRINTWIPDRAWING'.
    * S E L E C T I O N - S C R E E N.
    SELECTION-SCREEN BEGIN OF BLOCK bl1 WITH FRAME TITLE text-bl1.
    * Production order
    PARAMETERS: p_aufnr LIKE afpo-aufnr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK bl1.
    START-OF-SELECTION.
    *--Begin of Commenting                   "
    *--Get Partially processed orders
      MOVE: sy-mandt         TO nast-mandt,
            'V1'             TO nast-kappl,
            p_aufnr          TO nast-objky,
            p_aufnr          TO nast-parnr,
            sy-langu         TO nast-spras,
            sy-datum         TO nast-erdat,
            '1'              TO nast-nacha,
            '3'              TO nast-vsztp,
            'X'              TO nast-manue,
            sy-uname         TO nast-usnam,
            'DFLT'           TO nast-ldest,
            sy-langu         TO nast-tdspras,
            'Shop Floor Papers' TO nast-tdcovtitle,
            '1'              TO nast-tdarmod,
            'BUS2032'        TO nast-objtype.
    *--Printer settings
      CALL FUNCTION 'WFMC_PREPARE_SMART_FORM'
        EXPORTING
          pi_nast       = nast
          pi_repid      = sy-repid
        IMPORTING
          pe_returncode = cf_retcode
          pe_itcpo      = ls_itcpo
          pe_device     = lf_device
          pe_recipient  = ls_recipient
          pe_sender     = ls_sender.
      MOVE-CORRESPONDING ls_itcpo TO ls_composer_param.
      ls_control_param-device      = 'PRINTER'.
      ls_control_param-no_dialog   = 'X'.
      ls_control_param-preview     = 'X'.
      ls_control_param-getotf      = ls_itcpo-tdgetotf.
      ls_control_param-langu       = sy-langu.
    *--End   of Commenting                   "
    *--Start of Addition                     "
      CLEAR:   ws_werks.
      SELECT   SINGLE werks
               INTO   ws_werks
               FROM   aufk
               WHERE  aufnr = p_aufnr.
      CLEAR:   ws_matnr.
      SELECT   SINGLE plnbez
               INTO   ws_matnr
               FROM   afko
               WHERE  aufnr = p_aufnr.
      CLEAR:   marc.
      SELECT   SINGLE matgr
               INTO   marc-matgr
               FROM   marc
               WHERE  matnr = ws_matnr
               AND    werks = ws_werks.
    *--End   of Addition                     "
    *  CHECK NOT ws_matnr IS INITIAL.       
      IF NOT ws_matnr IS INITIAL.          
    *--Start of Addition                    
        SELECT   SINGLE matgr
                 INTO   marc-matgr
                 FROM   marc
                 WHERE  matnr = ws_matnr
                 AND    werks = ws_werks.
    *--Start of Addition BY Rapidigm01_01+
      ELSE.
        marc-matgr = c_wip1.
      ENDIF.
    *--End Of Addition BY Rapidigm01_01+
    *--End   of Addition                     "
    END-OF-SELECTION.
      PERFORM call_smartform.
    * F O R M    R O U T I N E S
    *&      Form  call_smartform
    *       text
    FORM call_smartform.
      CLEAR: ws_ctrlp, ws_optns, ws_fname.
    *--Start of Addition                                 "
      TRANSLATE marc-matgr TO UPPER CASE.
      IF marc-matgr = c_fas1 OR
         marc-matgr = c_fas2.
        PERFORM call_paper_a.
      ELSEIF marc-matgr = c_wip1 OR
             marc-matgr = c_wip2.
        PERFORM call_paper_b.
      ENDIF.
    *--End   of Addition                                 "
    ENDFORM.                    "call_smartform
    *&      Form  call_paper_a
    *       text
    FORM call_paper_a.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
    *>>BC SPARTA03    DATE: 19/05/2008
    *      formname           = 'ZPPSF_SHOP_FLOOR_PAPER_A'  "Rapidigm03_01-
          formname           = 'ZPPSF_SHOP_FLOOR_PAPER_C'  "Rapidigm03_01-
    *<<EC SPARTA03    DATE: 19/05/2008
    *       formname  = 'ZPPSF_SHOP_FLOOR_PAPER_A_2893'   "Rapidigm03_01+
        IMPORTING
          fm_name            = ws_fname
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      CHECK NOT ws_fname IS INITIAL.
      CLEAR w_otfdata.
      ls_control_param-getotf = 'X'.
      CALL FUNCTION ws_fname
        EXPORTING
          archive_index      = toa_dara
          archive_parameters = arc_params
          control_parameters = ls_control_param
          mail_recipient     = ls_recipient
          mail_sender        = ls_sender
          output_options     = ls_composer_param
          user_settings      = ' '
          is_nast            = nast
          aufnr              = p_aufnr
          flag_orig          = 'X'
        IMPORTING
          job_output_info    = w_otfdata
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
      LOOP AT w_otfdata-otfdata INTO w_otf.
        APPEND w_otf TO it_itcoo.
      ENDLOOP.
      CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'
        TABLES
          otf_table = it_itcoo.
    ENDFORM.                    "call_paper_a
    *&      Form  call_paper_b
    *       text
    FORM call_paper_b.
      DATA: ws_doknr TYPE draw-doknr,
            ws_dokvr TYPE draw-dokvr.
      CLEAR: ws_doknr, ws_dokvr.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZPPSF_SHOP_FLOOR_PAPER_B'
        IMPORTING
          fm_name            = ws_fname
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      CHECK NOT ws_fname IS INITIAL.
      CLEAR w_otfdata.
      ls_control_param-getotf = 'X'.
      CALL FUNCTION ws_fname
        EXPORTING
          archive_index      = toa_dara
          archive_parameters = arc_params
          control_parameters = ls_control_param
          mail_recipient     = ls_recipient
          mail_sender        = ls_sender
          output_options     = ls_composer_param
          user_settings      = ' '
          is_nast            = nast
          aufnr              = p_aufnr
          doknr              = ws_doknr
          dokvr              = ws_dokvr
          flag_orig          = 'X'
        IMPORTING
          job_output_info    = w_otfdata
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
      LOOP AT w_otfdata-otfdata INTO w_otf.
        APPEND w_otf TO it_itcoo.
      ENDLOOP.
      CALL FUNCTION 'HR_IT_DISPLAY_WITH_PDF'
        TABLES
          otf_table = it_itcoo.
    ENDFORM.                    "call_paper_b

  • Sending a file (.pdf) as an attachment via e-mail

    Hi,
    I have a selection screen with purchase order number as "select-options" and 2 radio buttons one for downloading and opening the SAP Script output to the local file and the other raido button would convert the SAP Script output into .pdf file and send that file as an attachment via e-mail to the receipent(only one).
    I'm through with the first operation. Now need to know about the e-mailing procedure and the function module(s) to be used and their import, export, etc. parameters.
    Thanks & Regards,
    Rajesh

    Re: Sending a PDF document as an attachment
    refer the above thread.
    the useful FMs in this regard are
    CONVERT_OTF
    SO_NEW_DOCUMENT_ATT_SEND_API1 to send mails with attachments:

Maybe you are looking for

  • Mail not working after trying to send videos. Spins trying to bring in new mail until I force quit.

    Yesterday I inserted some videos in an email. Wouldn't send: too big. I removed one at a time. Same message. No choice to delete the email, so I clicked try later. Evidently it tried 33 times, because there were 33 copies of it in "recovered files."

  • Help with this database performance

    we have a web app on weblogic and backend is db 11gR2. we have also batch jobs also running. people complain jobs running too long - in hrs. Could any one make comments on this AWR? Thank you very much               Snap Id      Snap Time      Sessio

  • Oracle Software not installed

    Hi! I tried to install SAP NetWeaver 7.1 with Oracle 10 under Windows Server 2003 64bit in english fully updated. But I ran into two problems which prevented the SAP installation to finish : first once all the oracles updates were installed, the orac

  • Custom swatches. Where do I put them?

    I recently downloaded some custom paper swatches from Neenah Paper to use with a letterhead design I'm creating. Where is the best place to save custom paper swatches on my Mac? Is there a common folder I can put them in that will allow me to share t

  • Batch File to invoke Oracle

    Greetings, I have a batch file that would invoke a SQL script. The bacth file is like, sqlplus user/passwd@db @sql_file.sql Now my requirement is that how do I handle the the exceptions if there is some problem in connecting. Thanx in Advance, Badhri