Send Attachment via mail

Hi All,
My requirement is to send the contents of an internal table as an attachment via mail to an external mail address.
I am working in SAP version 3.1H.
Would anybody provide a sample code of how to do so?
regards,
Paul

Hi,
If you require small example you can also have look on the
following sample code which will post internal table data as attachment. Please not email address has to be customised in the <b>SAP usermaintaince.</b>
FORM send_mail.
  it_doc_chng-obj_name  = text-016.
  it_doc_chng-obj_descr = text-016.
  DESCRIBE TABLE it_objtxt LINES g_lines.
  READ TABLE it_objtxt INDEX g_lines.
  it_objpack-doc_size = ( g_lines - 1 ) * 255 + STRLEN( it_objtxt ).
  it_objpack-doc_type   = 'RAW'.
  APPEND it_objpack.
  it_objpack-head_start = 1.
  it_objpack-head_num   = 0.
  it_objpack-body_start = 1.
  it_objpack-transf_bin = 'X'.
  it_objpack-body_num   = g_lines.
  it_objpack-doc_type   = 'RAW'.
  it_objpack-obj_name   = 'ATTACHMENT'.
  it_objpack-obj_descr  = g_file.
  APPEND it_objpack.
completing the recipient list
  SORT it_vmail.
  DELETE ADJACENT DUPLICATES FROM it_vmail.
  IF l_client NE 'P'.
    it_reclist-receiver = p_email.
    it_reclist-express =  'X'.
    it_reclist-rec_type = 'U'.
    APPEND it_reclist.
  ELSE.
    LOOP AT it_vmail.
      it_reclist-receiver = it_vmail-smtp_addr.
      it_reclist-express =  'X'.
      it_reclist-rec_type = 'U'.
      APPEND it_reclist.
    ENDLOOP.
  ENDIF.
  it_rec_mail[] = it_reclist[].
  IF NOT p_copy IS INITIAL.
    it_reclist-receiver = p_copy.
    it_reclist-express =  'X'.
    it_reclist-copy =  'X'.
    it_reclist-rec_type = 'U'.
    APPEND it_reclist.
  ENDIF.
  CLEAR it_download[].
  it_download[] = it_objtxt[].
**********Sending the mail with attachment*****************
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_MAPI'
    EXPORTING
      document_data              = it_doc_chng
      put_in_outbox              = 'X'
      commit_work                = 'X'
    TABLES
      packing_list               = it_objpack
      contents_bin               = it_objtxt
      contents_txt               = it_objtxt
      receivers                  = it_reclist
    EXCEPTIONS
      too_many_receivers         = 1
      document_not_sent          = 2
      operation_no_authorization = 4
      OTHERS                     = 99.
  CASE sy-subrc.
    WHEN 0.
      IF p_update = 'X'.
        PERFORM reference_update.
      ENDIF.
     PERFORM down_load.
      WRITE:/01 text-019.
      SKIP.
      LOOP AT it_rec_mail.
        FORMAT COLOR 5 INTENSIFIED OFF.
        WRITE:/01 text-010,20 it_rec_mail-receiver.
      ENDLOOP.
      ULINE.
    WHEN 1.
      WRITE: / text-012.
    WHEN 2.
      WRITE: / text-013.
    WHEN 4.
      WRITE: / text-014.
    WHEN OTHERS.
      WRITE: / text-015.
  ENDCASE.
  REFRESH:it_objpack,
          it_objtxt,
          it_reclist,
          it_rec_mail.
  CLEAR:it_objpack,
        it_objtxt,
        it_reclist,
        g_lines,
        it_rec_mail.
ENDFORM.                    " send_mail
Regards
Suresh Babu Karanam

Similar Messages

  • How to Send Appointment via mail adapter

    Hi Guys,
         I need to send the appointment and vTodo via mail adapter, any way i need to develop a mail adapter module. Till now i have finished this part,and i can send normal mail even normal mail with attachment. But i don't know how to send appointment via mail adapter.
    This is payload content of appointment which got from Exchange server to gmail:
    _=_NextPart_001_01C71EC0.97A011C6
    Content-Type: text/plain;
        charset="GB2312"
    Content-Transfer-Encoding: quoted-printable
    When: 2007=C4=EA6=D4=C227=C8=D5=D0=C7=C6=DA=C8=FD 3:30 =CF=C2=CE=E7-4:00 = =CF=C2=CE=E7 (GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi.
    Where: China
    ~*~*~**
    This is calendar content
    _=_NextPart_001_01C71EC0.97A011C6
    Content-class: urn:content-classes:calendarmessage
    Content-Type: text/calendar;
        method=REQUEST;
        name="meeting.ics"
    Content-Transfer-Encoding: 8bit
    BEGIN:VCALENDAR
    METHOD:REQUEST
    PRODID:Microsoft CDO for Microsoft Exchange
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:(GMT+01.00) Sarajevo/Warsaw/Zagreb
    X-MICROSOFT-CDO-TZID:21
    BEGIN:STANDARD
    DTSTART:20070112T140000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0100
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:20070112T140000
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTAMP:20061213T141132Z
    DTSTART;TZID="(GMT+01.00) Sarajevo/Warsaw/Zagreb":20070112T140000
    SUMMARY:This is calendar test
    UID:040000008200E00074C5B7101A82E0080000000030D51864C81EC701000000000000000
    010000000CA9F127EA8947844BC4DD47F269BDEA9
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xu, Rocky":MAILTO:rocky@***.com
    ORGANIZER;CN="Xu":MAILTO:rocky@**.com;roc*@gmail.com
    LOCATION:Shanghai
    DTEND;TZID="(GMT+01.00) Sarajevo/Warsaw/Zagreb":20070112T160000
    DESCRIPTION:This is calendar content\N
    SEQUENCE:0
    PRIORITY:5
    CLASS:
    CREATED:20061213T141132Z
    LAST-MODIFIED:20061213T141133Z
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    X-MICROSOFT-CDO-BUSYSTATUS:BUSY
    X-MICROSOFT-CDO-INSTTYPE:0
    X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
    X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
    X-MICROSOFT-CDO-IMPORTANCE:1
    X-MICROSOFT-CDO-OWNERAPPTID:367904726
    X-MICROSOFT-CDO-APPT-SEQUENCE:0
    X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20061213T141132Z
    X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20061213T141132Z
    END:VEVENT
    END:VCALENDAR
    _=_NextPart_001_01C71EC0.97A011C6--
    My question is
      1. How to generate this kind of payload in mail adapter module?
      2. It is possible to send appointment via mail adapter?
    Following i can get from other system, even using mail package check or not using mail package check.
    BEGIN:VCALENDAR
    METHOD:REQUEST
    PRODID:Microsoft CDO for Microsoft Exchange
    VERSION:2.0
    BEGIN:VTIMEZONE
    TZID:(GMT+08.00) Kuala Lumpur/Singapore
    X-MICROSOFT-CDO-TZID:21
    BEGIN:STANDARD
    DTSTART:16010101T000000
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0800
    END:STANDARD
    BEGIN:DAYLIGHT
    DTSTART:16010101T000000
    TZOFFSETFROM:+0800
    TZOFFSETTO:+0800
    END:DAYLIGHT
    END:VTIMEZONE
    BEGIN:VEVENT
    DTSTAMP:20070608T025852Z
    DTSTART;TZID="(GMT+08.00) Kuala Lumpur/Singapore":20070608T110000
    SUMMARY:This is meeting request with attachment
    UID:040000008200E00074C5B7101A82E0080000000000A9BD0BA7A9C701000000000000000
    010000000C5E16D144D1612498C0EF7E2115EFEC4
    ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="Xu, Rocky
    ":MAILTO:roc*@**
    ORGANIZER;CN="Xu,y":MAILTO:roc*@**
    LOCATION:India labs
    DTEND;TZID="(GMT+08.00) Kuala Lumpur/Singapore":20070608T113000
    DESCRIPTION:This is content!  &#60;&#60;shanghai.txt&#62;&#62; \N
    SEQUENCE:0
    PRIORITY:5
    CLASS:
    CREATED:20070608T025925Z
    LAST-MODIFIED:20070618T033505Z
    STATUS:CONFIRMED
    TRANSP:OPAQUE
    X-MICROSOFT-CDO-BUSYSTATUS:BUSY
    X-MICROSOFT-CDO-INSTTYPE:0
    X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
    X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
    X-MICROSOFT-CDO-IMPORTANCE:1
    ATTACH:CID:008501c7b159$a9d41d3b$_CDOEX
    X-MICROSOFT-CDO-OWNERAPPTID:1468557271
    X-MICROSOFT-CDO-APPT-SEQUENCE:0
    X-MICROSOFT-CDO-ATTENDEE-CRITICAL-CHANGE:20070608T025852Z
    X-MICROSOFT-CDO-OWNER-CRITICAL-CHANGE:20070608T025852Z
    END:VEVENT
    END:VCALENDAR
    Thanks & regards
    Rocky

    Hi
    have a look at this
    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
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816
    reading Pdf Through mail easly done with Java Proxy, which will read the mail(with the attachments) with Java APIs and send the message into XI and then map with the Target ABAP proxy structure .
    Thanks

  • I can't send emails via mail. I can receive but not send. I have set up gmail on mail. Any ideas?

    I can't send emails via mail. I can receive but not send. I have set up gmail on mail. Any ideas? No problems with the set up previously to this.

    Go to Mail Preferences- Accounts and confirm you are providing Gmail what they require to send and receive mail. And DON'T specify Secure Socket Layer. Some mail accts don't like SSL
    Good Luck to you.

  • Cannot receive/send emails via Mail on Mac using 10.6.8, keeps asking for password, very frustrating. Any ideas please? Regards

    Cannot receive/send emails via Mail on Mac using 10.6.8, keeps asking for password, very frustrating. Any ideas please? Regards

    One more time, iCloud mail accounts are .me, .mac and .icloud. New ones are only .icloud.
    iCloud mail is a standard Imap account that can be used with any mail client in existence. But You are talking about the ability to automatically setup an iCloud account in mail, which did not exist until 10.7.2.
    You can use password or token authentification with iCloud mail (in Mail) it is your choice.
    Set the account manually, set it as Imap, use imap.mail.me.com (no P number) for the incoming email and smtp.mail.me.com as the outgoing server.
    The full settings (ports and security) are here. Use them and it will work, regardless of domain (mac, me and icloud addresses all use the same settings.
    IMAP (Incoming Mail Server) information:
    Server name: imap.mail.me.com
    SSL Required: Yes
    Port: 993
    Username: [email protected] (use your @me.com address from your iCloud account)
    Password: Your iCloud password
    SMTP (outgoing mail server) information:
    Server name: smtp.mail.me.com
    SSL Required: Yes
    Port: 587
    SMTP Authentication Required: Yes
    Username: [email protected] (use your @me.com address from your iCloud account)
    Password: Your iCloud password
    Note: If you receive errors using SSL, try using TLS instead. SSL is required for both IMAP and SMTP connection with iCloud. POP is not supported by iCloud. 
    For more information on how to use this information with your email application, consult your application's documentation.

  • Send xml via mail (IPhone SDK)

    HI all,
    i have some problem sending xml via mail(mailto). When the amil program caming up il see the subjet but the xml tag there aren't???
    any one has an idea how do this??
    thanks in advanced
    Claudio

    Go into settings - mail - account - and then look for the outgoing server - click in there and there should be a place for you to enter your password - just as you would when you first set up your email account.

  • HT1414 I am new on the iPod 5th Gen, I have managed setting up ok, I can send emails via Mail but cannot seem to receive them ? help what am I doing wrong

    I am new on the iPod 5th Gen, I have managed setting up ok, I can send emails via Mail but cannot seem to receive them ? help what am I doing wrong

    Try this...
    Delete the affected email account from your device.
    Tap Settings > Mail, Contacts, Calendars.
    Choose the affected email account, then tap Delete Account.
    Add your account again.

  • Safari / Mail: No longer able to send webpages via Mail? HELP

    How can I restore my Safari / Mail settings to allow Safari to recognize Mail so I can resume sending webpages via Mail? It was working OK, then stopped giving me this message: <Safari couldn’t create an email message to send the link because it couldn’t locate an email application.You can use the Mail application included with Mac OS X to send email. To do so, you might need to install Mail using the Mac OS X installation CDs.> Did the installation of Firefox take over or change my settings?

    Go to Mail > Preferences > General and make sure Default Email Reader is set correctly.

  • Getting: Unable to send attachment with Mail Drop

    Mail Drop is not working for me, I always get error message while trying to send.
    Here is what happens:
    -I compose a message that includes a large attachment
    -I click send
    -I get the message "Unable to send attachment with Mail Drop" for a few seconds
    -My message is not sent and it goes into the Outbox folder.
    Configuration:
    OS X 10.10 Yosemite
    Mail -> Preferences -> Accounts -> Advanced. The option "Send large attachments with Mail Drop" is selected.

    I had the exact same problem.  I finally figured out what was wrong.  I believe you must have iCloud Drive turned on in System Preferences AND you also must allow mail to store document in iCloud Drive which you can check by clicking the "Options..." button in the preference pane of iCloud Drive. As you can see below.

  • Create newsletter with Pages and send out via mail (not attachement)?

    I have a question: I have created a newsletter in Iworks Pages. How can I send this out via mail as a newsletter ? So not as an attachment? I know Microsoft Publisher can do it with 1 click, but I don't want to move to MSFT. Please let me know, I also have Indesign etc. Createion of the newsletter is easy with my Apple, but then it stops....and gets worse the MSFT....

    KOENIG Yvan wrote:
    PeterBreis0807 wrote:
    +Menu > File > Print > PDF (button bottom left corner) > Mail PDF+
    As far as I know, only single page PDFs will appear directly in the mail and they will do only in some mail applications.
    No it is multipage. Can't test for all appliactions but it was both sent and received on my system/Mail as the 3 pages in the document.
    In other apps and always if the PDF contain several pages, it will be an attachment : what was rejected by the OP.
    When Helena Rubenstein arrived in Australia she first worked in David Jones, our version of Harrods.
    A woman approached another salesperson and asked "Do you have a brown cashmere top?"
    To which the salesperson replied "Sorry no madam"
    Helena stepped in and asked "Would madam like a blue or black one instead?" and made the sale to the lady who wanted a top. It seemed that was more important than none at all.
    There is a lesson to be learnt from this.
    Peter

  • Sending Attachment via oracle mail packages

    Hi,
    I am using utl_smtp and utl_tcp pacakges to send an e-mail. I would like to send an attachment through it, is this possible? and if yes how do i do it?
    Thanks.

    Jens,
    I am frequent visitor and contributor to this forum.
    About the link, I waned to try the same thing as I never tried this before and I am getting some hickups.
    May be you can help as you seem to be familiar with this subject,
    1. I down loaded the two java packages one for mail and one for activation from Java web site.
    2. Executed the down loads which provided me with mail.jar and activation.jar
    3. Zipped them again using Winzip as per Tom's suggestion(this may be where I may be doing some thing wrong).
    4. Transfered the mail.zip and activation.zip to my UNIX server and have our DBA try loading the files under SYS account. It is throwing error, following is the loading endeavor just for mail.zip, the other one just similar.
    $ loadjava -u sys/manager -o -r -v -f -noverify -synonym -g public mail.zip
    initialization complete
    loading  : mail.jar
    creating : mail.jar
    Error while creating resource mail.jar
        ORA-29547: Java system class not available: oracle/aurora/rdbms/Compiler
    resolver : 
    Error while turning off verifier
        ORA-06576: not a valid function or procedure name
    loadjava: 2 errorsAny ideas?
    I will appreciate any help in this regard.
    Thx,
    SriDHAR

  • Gmail taking ages to send email via mail app

    I bought a MacBook air yesterday and set up my gmail account on the mail app. Everything seemed to be working okay at first but now it's takkng at least five minutes to send a plain text email, one email I tried sending last night didn't send until this morning! I tried changing the SSL port to 25, 465 and 587 not only do they not work but then it stops my mail from moving into the folders or trash, they move and then go back to my inbox.
    Please help!

    Stephen Schulte2 wrote:
    When I am in a hotel out of town or overseas- or just anywhere where I don't have my home ISP - how can I not only RECEIVE but also SEND eMail via my Mail program?
    If your ISP is like mine, it authenticates you for outgoing e-mail by being able to determine that you're accessing the Internet from within their network. If your ISP is so configured, they'll offer the ability to authenticate to their SMTP server with a password. My ISP does not.
    However, MobileMe does provide its own authenticating SMTP server that you should be able to use from anywhere. Try an SMTP server of smtp.mac.com (smtp.me.com will probably also work) with settings of "Use default ports", "Use Secure Sockets Layer (SSL)", and "Authentication" by password, your "User Name" the part of your MobileMe ID before the "at" sign, and your password your MobileMe password.
    For non-MobileMe outgoing e-mail, you'll need to locate an SMTP server that you can use.
    Also: Anyway to attach more than 1 file (say photo) at a time using MobileMe and my mail account? For 22 small photos do I have to hit attach each time? I can't seem to select the folder they are in and get all 22 to attach...
    I haven't tried that, but I would expect to have to attach them one at a time.

  • N8 - Can't send picture via mail from Photo apps

    After setting up the default mail client on n8 (I used google mail and hotmail, they work fine), I can see the option "Send via mail" when I long-pressed any picture on Photos application. But after a while (I'm still figuring out what is the trigger), the options is gone, and the only way to make them appear is to delete the mail accounts and re-setup the accounts again.
    Has anyone experience this problem?

    Have you tried doing it the other way round, ie create an email and add an attachment from the email ?
    If I have helped at all, a click on the White Star is always appreciated :
    you can also help others by marking 'accept as solution' 

  • Sending attachment Via Email

    Hi All,
    I have a requirement where in i need to send an email from teh service ticket. The email will be triggered basedon status change to To be Approved. While the email is sent to approver, is it possible to pick the attachment linked to service ticket and add to email as an attachment. is this possible technically..any pointers on how to achive this would be of great help...
    thanq..
    Regards,
    Udaya..

    Udaya,
    I'm not going to give you all the coding details , but I have techically done this before for an activity and here is the recipe for your case:
    1) Create a new z-action profile for the transaciton type
    2) Copy the standard CL_DOC_PROCESSING_CRM_ORDER over to a z-version
    3) Copy the method from that class called CRM_SRVORDER_EXEC_SMART_FORM to a version called EMAIL_SRV_ORDER
    4) Copy the standard smartform used for the service profile to a zed version
    5) Configure a new smart forms mail action to send an e-mail using the new processing class
    6)  Now here is the fun part, you will actually re-code the method to excute the form, but not send out via e-mail.  You will capture the smartform output as OTF and then convert to ASCII to become the body of your e-mail.
    7) Next you will read the attachment for the e-mail message using he CL_CRM_DOCUMENTS class into memory
    8) Finally you will build an e-mail message via separate function module which will be called in a separate task(to avoid issuing  a commit work in the action), using CL_BCS message classes.
    Your end-result is your "action" will generate an e-mail with an attachment.  This isn't way too difficult and I estimate about one week to do. 
    Take care,
    Stephen

  • Sending Smartform via Mail as PDF

    Hi at all,
    how can I realize the sending of a smartform as a PDF file via Mail as attachment?
    This is the functiom module I call:
          IF p_mail EQ 'X' AND p_adress IS NOT INITIAL.
            CLEAR: wa_ssfcompop,
                   wa_ssfctrlop,
                   ls_tab_otf_data.
            wa_ssfcompop-tdprinter    = 'PDF1'.
            wa_ssfctrlop-langu        = 'D'.
            wa_ssfctrlop-no_dialog    = 'X'.       "KEIN DIALOG
            wa_ssfctrlop-preview      = 'X'.
            wa_ssfctrlop-getotf       = 'X'.          "NUR DAS OTF IST INTERESSANT
          ENDIF.
    CALL FUNCTION fm_name                                     "'/1BCDWB/SF00000033'
            EXPORTING
              output_options             = wa_ssfcompop
              control_parameters         = wa_ssfctrlop
              user_settings              = space
    *         im_redat_von               = so_redat-low
    *         im_redat_bis               = so_redat-high
              im_beleg_waers             = rb_beleg             "DV_M964
              im_sum                     = p_summe              "DV_M1464
              im_wert                    = p_ertrag             "DV_M1464
              im_stueck                  = p_stueck             "DV_M1464
              im_period                  = p_monat              "DV_M1464
            IMPORTING
    *         DOCUMENT_OUTPUT_INFO       =
              job_output_info            = ls_tab_otf_data      "DV_M1464
              job_output_options         = wa_ssfcompop2        "FE 20100429
            TABLES
              i_umsatz                   = it_umsatz_ergebnis
              i_faknr                    = it_faknr
            EXCEPTIONS
              formatting_error           = 1
              internal_error             = 2
              send_error                 = 3
              user_canceled              = 4
              OTHERS                     = 5
    After this I have a otf string that I convert with the following coding:
    lt_tab_otf_final[] = ls_tab_otf_data-otfdata[].
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = lv_filesize
          bin_file              = lv_file
        TABLES
          otf                   = lt_tab_otf_final
          lines                 = lt_pdf_tab
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          err_bad_otf           = 4
          OTHERS                = 5.
    But now I am stuck. How can I send this xString to the next function module? The other structures / tables are still filled, only the it_attachment has to be filled, but how?
    wa_receivers-receiver = p_adress.
      wa_receivers-rec_type = 'U'.
      APPEND wa_receivers TO it_receivers.
      CONCATENATE 'Umsatznachweis Druck' sy-datum sy-uzeit INTO wa_document_data-obj_descr SEPARATED BY space.
      wa_message = 'Dies ist ein Test'.
      APPEND wa_message TO it_message.
      wa_packing_list-transf_bin = space.
      wa_packing_list-head_start = 1.
      wa_packing_list-head_num   = 0.
      wa_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES wa_packing_list-body_num.
      wa_packing_list-doc_type = 'RAW'.
      APPEND wa_packing_list TO it_packing_list.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
        EXPORTING
          document_data                    = wa_document_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                     = it_packing_list
    *      OBJECT_HEADER                    =
    *      CONTENTS_BIN                     =
          contents_txt                     = it_message
          contents_hex                     = it_attachment
    *      OBJECT_PARA                      =
    *      OBJECT_PARB                      =
          receivers                        = it_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.

    Hi,
        After
              CALL FUNCTION 'CONVERT_OTF'
                EXPORTING
                  format                = 'PDF'
                  max_linewidth         = 132
                  archive_index         = ' '
                  copynumber            = 0
                  ascii_bidi_vis2log    = ' '
                  pdf_delete_otftab     = ' '
                IMPORTING
                  bin_filesize          = ls_bin_file
                  bin_file              = bin_file   <-- get this
    Convert this to string ...
      DATA : lv_strlen TYPE i.
      DATA : it_raw    TYPE STANDARD TABLE OF char255,
             ia_raw    TYPE char255.
      lv_strlen = STRLEN( bin_file ).
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          buffer                = bin_file
        APPEND_TO_TABLE       = ' '
       IMPORTING
         output_length         = lv_strlen
        TABLES
          binary_tab            = it_raw.
      CALL FUNCTION 'QCE1_CONVERT'
        TABLES
          t_source_tab = it_raw
          t_target_tab = lt_objbin.
    *call the FM ... to send mail ..
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data          = lv_doc_chng
       put_in_outbox          = 'X'
            commit_work            = 'X'
          TABLES
            packing_list           = lt_objpack
            object_header          = lv_objhead
            contents_txt           = lt_objtxt
            contents_bin           = lt_objbin
            receivers              = lt_reclist
          EXCEPTIONS
            document_not_sent      = 1
            OTHERS                 = 2.
    Regards,
    Srini.

  • Send Attachment via background job

    Hi,
    Is there any function module/program  in SAP where we can send attachment to external parties via scheduled background job?
    Thank you.

    Dear YEO WEI KOK,
    Please check the following link: 
    http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
    Hope this helps you.
    Do award points if you found them useful.
    Regards,
    Rakesh

Maybe you are looking for

  • Black page when copying and scanning

    Hi, I have a HP Laserjet 1536dnf MFP, all was working fine until I changed the ink cartridge two days ago.  Printing is fine but when I go to copy or scan I get a solid black page printed.  I've checked the light goes across when copying and scanning

  • How to run our own jar files on Nokia 3100

    Hi, I am new to J2me. I have written an J2me application using CLDC1.1 and MIDP 2.0 it works well on emulator but when i tried to run it on device(Nokia 3100) it displays an error "Invalid File" please answer my question as soon as possible

  • CF variable in Javascript is "undefined"

    Hi everyone, can you please tell me why the output is "undefined"? this is the code: <cfset checkcolor="No"> <script language="JavaScript"> function check() x=document.checkcolor; alert(x); return false; <cfquery datasource="#DSN#" NAME="items"> sele

  • Skype offline

    Hi, I am using skype for internal chatting. But now a days skype is always in offline. Evethough it is connected with internet i am always in offline mode. any Thoughts? Solved! Go to Solution.

  • Printing watermarks on Officejet Pro 8610

    I did have an HP Officejet 4632 that had the capabilities of printing a watermark through the printer settings on .pdf documents. Since I upgraded to an HP Officejet Pro 8610, that option is no longer available. A watermark cannot be added to a .pdf