Need to send two attachments in mail

Hi
I am using FM  to send attachments SO_DOCUMENT_SEND_API1
But i need to send two different attachments with different data and structure .how to do this
Please suggest

Hai,
Have a look at this code:
*Body XLS
  DOC_DATA-obj_name  = 'XLS_File'.
  DOC_DATA-obj_descr = ' Sent: 2. Juli 10:12 AM '.
  CTEXT = 'Attached XLS File'.
  APPEND CTEXT.
  DESCRIBE TABLE CTEXT LINES tab_lines.
  READ TABLE CTEXT INDEX tab_lines.
  DOC_DATA-doc_size = 800 . "( tab_lines - 1 ) * 255 + STRLEN( CTEXT ).
  DOC_DATA-NO_CHANGE = 'X'.
  CLEAR PLIST-transf_bin.
  PLIST-head_start = 1.
  PLIST-head_num = 0.
  PLIST-body_start = 1.
  PLIST-body_num = tab_lines.
  PLIST-doc_type = 'RAW'.
  APPEND PLIST.
*************************End of Body***********************************
*Attachment XLS
  n = 1.                                    "for sending 1st attachment
  DESCRIBE TABLE gt_9bku LINES tab_lines.
  DESCRIBE TABLE gt_txtedit LINES tlines.
  PLIST-doc_size = 3200 . "( tab_lines - 1 ) * 255 + STRLEN( tlines ).
  PLIST-transf_bin = 'X'.
  PLIST-head_start = 1.
  PLIST-head_num = 1.
  PLIST-body_start = 1.
  PLIST-body_num = 50.
  PLIST-doc_type = 'XLS'.
  DOC_DATA-obj_name = 'XLS1'.
  DOC_DATA-NO_CHANGE = 'X'.
  PLIST-obj_descr = 'Anhang1'.
  APPEND PLIST.
********************END OF XLS ATTACHMENT******************************
**Body DOC
  DOC_DATA-obj_name  = 'DOC_File'.
  DOC_DATA-obj_descr = ' Sent: 3. Juli 09:52 PM '.
  CTEXT = 'Attached DOC File'.
  APPEND CTEXT.
  DESCRIBE TABLE CTEXT LINES tab_lines.
  READ TABLE CTEXT INDEX tab_lines.
  DOC_DATA-doc_size = 5400 . "( tab_lines - 1 ) * 255 + STRLEN( CTEXT ).
  DOC_DATA-NO_CHANGE = 'X'.
  CLEAR PLIST-transf_bin.
  PLIST-head_start = 1.
  PLIST-head_num = 0.
  PLIST-body_start = 1.
  PLIST-body_num = tab_lines.
  PLIST-doc_type = 'RAW'.
  APPEND PLIST.
**End of Body***********************************************************
**Attachment DOC
  n = n + tab_lines.                                    "for sending 2nd attachment
  DESCRIBE TABLE gt_9bku LINES tab_lines.
  DESCRIBE TABLE gt_txtedit LINES tlines.
  PLIST-doc_size = 5400 . "( tab_lines - 1 ) * 255 + STRLEN( tlines ).
  PLIST-transf_bin = 'X'.
  PLIST-head_start = 1.
  PLIST-head_num = 1.
  PLIST-body_start = 1.
  PLIST-body_num = 50.
  PLIST-doc_type = 'DOC'.
  DOC_DATA-obj_name = 'DOC1'.
  DOC_DATA-NO_CHANGE = 'X'.
  PLIST-obj_descr = 'Anhang2'.
  APPEND PLIST.
*********************END OF DOC ATTACHMENT******************************
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
  EXPORTING
    DOCUMENT_DATA                   = DOC_DATA
*   PUT_IN_OUTBOX                    = 'X'
  IMPORTING
*   SENT_TO_ALL                      = 'X'
   NEW_OBJECT_ID                    = OBJECT_ID
  TABLES
    PACKING_LIST                     = PLIST
   CONTENTS_BIN                     = objbin_final
   CONTENTS_TXT                     = CTEXT
    RECEIVERS                        = RECEIVER.
Sorry that the code isn't properly alligned:(
Best Regards,
rama
Edited by: newtoAbap on Jul 22, 2009 9:34 AM
Edited by: newtoAbap on Jul 22, 2009 12:41 PM

Similar Messages

  • Sending photo attachments from Mail to Gmail

    I've been sending photo attachments via Mail for years and haven't had trouble until recently. Now I'm getting complaints from Gmail users that the attachments come through as embedded files. I guess on the Gmail end, they don't see it listed out as an attachment, but as part of the mail body. What's going on here?
    I attach files same as I always have - by clicking on "attach", then selecting the file(s) I want to attach. I always leave "send windows friendly attachments" selected (although in an experiment, I tried sending it without clicking that, and the images came over all stretched out and shrunken in a very strange way).
    I can't think of what would be happening, but I'm assuming it's something in either the way Mail or Gmail is treating the photos - and I'd like to have them come through as attachments, rather than embed files (I'm a photographer and have heard from some of my clients that the embed is a pain - they have to "save as" right click on each image rather than just select "save attachments" or something).
    Any ideas??

    Send to these recipients using only Plain Text, and all should be well. To test choose a message you previously sent from the Sent mailbox, open, click on Message in the menubar, choose Send Again, then click on Format and choose Make Plain Text.
    Rich Text as received by those using Outlook or Outlook Express, as two examples, will see the RTF as HTML, and the attachments will appear embedded -- although they are not.
    Ernie

  • Can we send two attachments in one Agent ?

    Dear All,
    Please help me, Can we create an agent which sends two attachments in single email where one attachment is PDF and other one is HTML link.
    Please help me if there is a work around .
    Thanks & Regards
    Srinivas

    hi
    my requirement behind this is dropping elements one below the other in one cell
    i got for adding one after the other but not able to do one below the other
    stuck in this not able to move further
    karthik.k

  • How Write a Program to send  TWO attachments in the same  mail.

    Hello,
    How to write a ABAP program so that when u run this program   it shd send two 0r more files as an attachment.
    Presently i know how to send a single attachment but not the multiple attachment.
    i.e. by using "send_api" function module .
    please reply ASAP i need this urgently.

    this is simpple FM which can can send any type of Attachment.
    FUNCTION zsend_mail_attachment.
    *"*"Local interface:
    *"  IMPORTING
    *"     REFERENCE(V_FILE_PATH) TYPE  STRING OPTIONAL
    *"     REFERENCE(V_SUBJECT) TYPE  SO_OBJ_DES
    *"  TABLES
    *"      IT_RECEIVERS STRUCTURE  SOMLRECI1
    *"      IT_MESSAGE STRUCTURE  SOLISTI1
      DATA: gd_cnt TYPE i,
            gd_sent_all(1) TYPE c,
            gd_doc_data LIKE sodocchgi1,
            gd_error TYPE sy-subrc.
      DATA objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE.
      DATA : it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
    * Binary store for File
      DATA : BEGIN OF it_file OCCURS 0,
               row(255),
             END OF it_file.
    * splitting of the filepath
      DATA : BEGIN OF i_split OCCURS 0,
               row(50),
             END OF i_split.
      DATA tab_lines LIKE sy-tabix.
      REFRESH : it_file, objbin, it_packing_list, i_split.
      CLEAR   : it_file, objbin, it_packing_list, i_split.
      DESCRIBE TABLE it_message LINES tab_lines.
      READ     TABLE it_message INDEX tab_lines.
      gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
      gd_doc_data-obj_langu  = sy-langu.
      gd_doc_data-obj_name   = 'SENDFILE'.
      gd_doc_data-obj_descr  = v_subject.
      gd_doc_data-sensitivty = 'O'.
      CLEAR it_packing_list.
      it_packing_list-head_start = 1.
      it_packing_list-head_num   = 0.
      it_packing_list-body_start = 1.
      it_packing_list-doc_type   = 'RAW'.
      it_packing_list-body_num   = tab_lines.
      APPEND it_packing_list.
      IF v_file_path IS NOT INITIAL.
        DATA : v_len      TYPE i,
               v_index    LIKE sy-index,
               v_doc_type TYPE  so_obj_tp,
               v_filename TYPE  so_obj_des .
        v_len = STRLEN( v_file_path ) - 3.
        v_doc_type = v_file_path+v_len(3) .
        TRANSLATE v_doc_type TO UPPER CASE .
        SPLIT v_file_path AT '' INTO TABLE i_split .
        DESCRIBE TABLE i_split LINES v_index .
        READ TABLE i_split INDEX v_index .
        v_filename = i_split-row .
        v_len = STRLEN( v_filename ) - 4.
        v_filename = v_filename(v_len) .
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename = v_file_path
            filetype = 'BIN'
          TABLES
            data_tab = it_file.
        LOOP AT it_file.
          MOVE it_file-row TO objbin-line.
          APPEND objbin.
        ENDLOOP.
        CLEAR it_packing_list.
        DESCRIBE TABLE objbin LINES tab_lines.
        it_packing_list-transf_bin = 'X'.
        it_packing_list-head_start = 1.
        it_packing_list-head_num   = 1.
        it_packing_list-body_start = 1.
        it_packing_list-doc_type   = v_doc_type.
        it_packing_list-body_num   = tab_lines.
        it_packing_list-doc_size   = tab_lines * 255.
        it_packing_list-obj_descr  = v_filename.
        APPEND it_packing_list.
      ENDIF.
    *  it_receivers-receiver = '[email protected]'.
    *  it_receivers-rec_type = 'U'.
    *  it_receivers-com_type = 'INT'.
    *  APPEND it_receivers .
    * Call the FM to post the message to SAPMAIL
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data = gd_doc_data
          put_in_outbox = 'X'
          commit_work   = 'X'
    *   IMPORTING
    *     sent_to_all = gd_sent_all
        TABLES
          packing_list = it_packing_list
          contents_txt = it_message
          contents_bin = objbin
          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.
    ENDFUNCTION.
    i have made it for only one attchmenet, for multiple attachmenet u can make more parameters <b>v_file_path_1, v_file_path_2, v_file_path_3</b> like wise do the coding as i have done for <b>v_file_path</b>
    hope this will solves ur query.....
    abhishek

  • In Elements 11 how do I get the verification code needed to send files as e-mail attachments ?

    In Elements 11 how do I get the verification code to send files as e-mail attachments ?

    I’ve found it usually works best with web mail via Adobe after obtaining verification. I know some email services block bulk email completely and I’ve only tested it with Gmail which works fine. Should also work with other web mail e.g. Yahoo and Hotmail. Give it a try. Before you start it will help to check your internet security settings. If they are set to High, reduce the settings to Medium temporarily. Then follow these instructions.
    1. Log in to your mail provider on the web and add the following email to your address/contacts book.
    [email protected]
    2. Open Organizer and on the menu click:
    Edit >> Preferences >> Sharing
    3. Choose Adobe Email Service from the client dropdown menu.
    4. Add your name and email address to the fields provided and click OK
    5. Test the system (first use only)  by selecting a photo in organizer and choosing Share >> Photo Mail then click Next (Mac users should use attachments)
    6. Choose a contact then click  Next
    7. Click Next Step, then click Next - the sender verification dialog will open.
    8. Check you have spelt your email address correctly and hit the Resend E-Mail button.
    9. Go to your inbox (also check spam) and when the Adobe mailer message is received copy (Ctrl+C) the long verification code.
    10. Return to the verification dialog and paste it (Ctrl+V) into the Sender verification field and click OK. Wait for validation confirmation then click OK to continue

  • Sending jpg attachments in Mail to Windows 8

    When I send a jpg attachment from my iMac 10.9.4 to a Windows 8 laptop the recipient sees only a square with an X in it. Is there something I need to do that will make it possible for them to see the jpg?

    Make sure you send Windows-friendly attachments. To do so for all messages, from the main Mail window choose Edit > Attachments, then make sure Always Send Windows-Friendly Attachments is selected. For a specific message, click the Attach button in the toolbar of the message window, then make sure Send Windows-Friendly Attachments is selected.
    Also use filename extensions (such as document.jpg).
    If the recipient sees two attachments (such as “MyFile” and “._MyFile”), the file with the underscore (such as “._MyFile”) can be ignored.

  • How to send multiple attachments thru mail?

    I haven't been able to figure out how from the mail application send docs, worksheets etc as attachment. Also how to attach multiple docs in the mail. Looking for help on this.
    Sparashar

    You need to start in the app that contains the files that you want to send as attachments and use that app's functionality to select and attach files to an email, and not start in the Mail app e.g. the GoodReader app supports multiple document types (word and excel, read only, PDFs, text files, pictures) and allows you to select one or more of them and attach/switch with them to an email.
    In the Mail app itself on iOS 6 you can now press and hold the body of the email and select photos from the Photos app to attach to it.

  • Learning Solution - Need to send a reminder e-mail to all participants

    I need to be able to send a reminder e-mail to all participants in a course.  I would like the e-mail to be sent to the participants 7 days prior to the start date of the course.
    We currently use SMARTFORMS to send an e-mail to a participant when he is booked into a course.  We would like to send the same e-mail to the participant 7 days prior to the start of the course as a reminder. 
    Would I accomplish this using a workflow?  Does anyone know a function that could be used to send the same e-mail again?  We have not been able to find the code to send the e-mail to the participant again.

    Hii Karen,
    We are also facing the same problem, but with the same i also want to know that how to send an e-mail to a participant when he is booked into a course coz for me its not working.
    Could you please tell me the steps to follow.
    Thanks & Regards,
    Nidhi

  • Need to send a link in mail using apex

    Hi,
    I need to send a mail using apex which will contain a link for a specific page. For sending mail , I used the following query:
    for c1 in (select EMAIL_ADDRESS
                 from USER_DETAILS
                where USER_NAME= :P4_USER_NAME and EMAIL_ADDRESS=:P4_EMAIL_ADDRESS) loop
      if c1.EMAIL_ADDRESS is not null then
        HTMLDB_MAIL.SEND(
          P_TO       =>  c1.EMAIL_ADDRESS,
          P_FROM     => '[email protected]',
          P_BODY     => 'Your new password is '|| 'xyzxyz',
          P_SUBJ     => 'Password detail' );
      end if;
    end loop;
    But how i will send the required link.
    Pls give some idea.
    Thanks,
    Chandra Bhanu

    Hi Chandra,
    Try this version of your code, you will alter the url to map to your apex server.
    DECLARE
       l_body   VARCHAR2 (4000);
    BEGIN
       FOR c1
          IN (SELECT email_address
                FROM user_details
               WHERE     user_name = :p4_user_name
                     AND email_address = :p4_email_address)
       LOOP
          IF c1.email_address IS NOT NULL
          THEN
             -- Include link to login page
             l_body :=
                   '<p>Your new password is '
                || 'xyzxyz'
                || '  To access the application and change your password, follow the '
                || 'link below.</p><p><a href="http://'
                || '</p><p><a href="http://edwprd:7777/pls/oitp/f?p=&APP_ID.:LOGIN</a></p>';
             apex_mail.send (p_to     => c1.email_address,
                             p_from   => '[email protected]',
                             p_body   => l_body,
                             p_subj   => 'Password detail');
          END IF;
       END LOOP;
    END;
    Jeff

  • Need to send some notifications by mail (not all notif)

    Hi!
    We run workflow embeded into EBS (11.5.10.2 4RUP). We have a custom workflow that uses Role (WF_LOCAL_ROLES) connected to employee register (ORIG_SYSTEM = 'PER' and orig_system_id = (person_id in per_all_people_f). we get the Role in the db package that starts the workflow and set it to the attribute Recipient.
    I assume there are standard notifications (WF) that are sent to these roles. the roles have a notification_preference = 'SUMMARY' because the administrators/user do not want the system to send many e-mails but a summary e-mail and the user should check theis notif in Applications.
    But... an here is the but....our specifc custom workflow creates a notification that we would like to send as an e-mail. what can we do?
    The mails should be sent specific to users/employees induvidually. I mean the e-mail is specicif constructed per employee, so it is not a good idea to create a Role that connect many users or something. Can we create new roles specific per user/employee with notification_preference = 'MAILHTML' (or other mail pref)??
    Would this work without intefiering with the other role. I need help to understand this functionality and how to get this to work. Thank you in advance!
    Regards,
    Patricia

    Hi,
    The only way that I can think of to do this would be to create an ad-hoc user at runtime which has an email preference set to MAILHTML (or any other preference that sends an email), and an email address set to the email address of the recipient. This would then send an email to the employee, and when the emails have been sent then you can purge the ad hoc directory so that you don't end up with lots of obsolete roles in the database.
    The downside of this is that there is no way for anyone to see the notification from within eBS. Because it isn't sent to the employee, it would not appear in their worklist, which may or may not be acceptable to the business. One possible workaround would be to create another ad-hoc role, and asssign both the employee user and the ad-hoc user to the role, and expand the role on the notification so that multiple copies are sent (one to each member of the role). If the notification requires a response, then you need to write a post notification function to deal with the possibility of multiple responses, which makes the solution more complex still.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Problem sending big attachments through mail - E72

    I've tried both profimail & the built-in client but most of the time it gives error like 'connection timeout or 'unable to send'. Is anyone else experiencing this problem ? This happens when the file size is around 2-3 MB.

    I just tried sending myself a 3.5 MB mp3 file on my E73, and then again a 3.6 MB mp3.  Both sent and downloaded smoothly with no issues.  But I don't do this very often, so my results could be different next time...  Have you tried upgrading to the new Nokia Email 3.09.0 client?  Your phone's layout may be different, but I upgraded through Control Panel -> Phone -> SW Update.  I don't think the older 3.05 beta from the Betalabs site mentioned large attachment problems, but it's worth a try.
    If that doesn't help, I wonder if this could be a network problem or a mail server problem.  Do you ever have trouble downloading large files from the web, streaming audio or video, etc.?  Do you get strong 3G coverage?  If you use a desktop computer, do you ever have trouble sending large attachments with this email account?  (Avoid testing with webmail, if at all possible.)  Does the file send eventually?

  • Need to send CSV attachments in a single mail to the Rcvr

    Hi All,
         Currently we are using 7.1 release of PI system. The scenario is from IDOC to ANSI Format. All the files recieved from IDOC should be sent as an attachment in  CSV format in a single mail .Could anyone please let me know how to proceed with this. If there is any javamapping needed for this? If yes, could you please provide the code for the  same,
    Regards,
       Pavithra

    Hi Pavithra,
    How to Guide for sending mails:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/d0964d7c-e66e-2910-24bb-ac535e4a5992
    Use StrictXML2PlainBean in the module processor to convert the data to CSV:
    /people/pooja.pandey/blog/2009/02/23/xml-to-text-conversion-made-easy-by-strictxml2plainbean
    http://help.sap.com/saphelp_nwpi711/helpdata/en/44/748d595dab6fb5e10000000a155369/content.htm
    Regards,
    Aravind

  • Messaging Plan needed to send photos via e-mail?

    I'm new to the mobile broadband community and would like to know if I can attach photos taken on my phone to an e-mail.  I have little interest in transmitting photos from my phone to other phones and I do not use text, so I am thinking I really don't need to get a messaging plan.  Right or wrong?

    Yes absolutely. You can always attach a photo via an E-mail just as you would on a computer. However, remember the size of the photos you are sending [i.e. File size!]. Sending a photo via E-mail will count towards your data cap whatever that may be on your plan. Photos, several of them, and just E-mail attachments in general can add up quickly so be sure to stay under your data limit to avoid extra fees.
    Happy E-mailing,
    --kwm1337

  • Can't send document attachments from Mail to iPhone

    ...well I can but not very well.... When using Gmail IMAP to sync everything, document attachments sent from Mac Mail to iPhone mail arrive as a bit of mess.. i.e. not as attachments but as text within the email itself, plus lots of garbled numbers and letters. Strange because if I send the same message from the iPhone back to itself or from webmail-Gmail it works fine. Its also just fine with photos and Pdf's. Help!

    No, sorry. false alarm.
    I just received a message, sent by Apple Mail 2.1.2 from OS 10.4.11, through POP, to an email-forwarding address, to my imap-gmail, and received from there (by IMAP) with Mail 2.1.2, too.
    Details of what got garbled below, just to say that sending the email not to the forwarding address but directly to [email protected] did not help either.
    the email was constructed like so:
    - some text, readable.
    - an attached PDF, space characters in name. this entire pdf was just printed in the email, meaning the postscript code and what have you.
    - some more text, that was still readable
    - an attached image that was probably pasted into the email, the name was "pastedGraphic.png". The image survived.
    - text, readable.
    - another PDF, raw contents printed into email body.
    - a zip file, spaces in name, made with the built-in archive maker of Tiger. Also here, the entire 'source code' of the zip is printed in the body copy.
    - some final bits of text. readable.
    On another computer, this email was not routed through a gmail account and was received by POP. not a single problem there. In fact, not ever.
    This is not very cool

  • When I send image attachments through Mail they are received as very small and squashed. How can I change this?

    I have a problem sending image attachements (e.g., jpeg, png files etc) with the Mail utility from my MacBook Pro.  When people receive my email the attached image shows up not as an attached file that can be saved or downloaded, but as just a very small, squashed up version of the image imbedded in the email message itself.
    I usually add these attachments by simply dragging and dropping the desired file into the window of the email text. Is this the wrong way to do it?
    thanks
    Jerry

    Is this the wrong way to do it?
    The safest way to send images is to create a compressed file and send that.
    Click the image you want to send, go to File in the menu bar and select Compress... You end up with a file with a .zip at the end. Attach that to your email. Then trash the .zip file.
    The person at the other end only has to double click the .zip attachment.
    You can compress are single image or a folder of them.

Maybe you are looking for

  • End Routine issue

    I am adding new records to the result_package in the end routine. How will I populate the SID and datapakid values to my new records? I am not able to code these fields in the end routine as they are not available and they get filled dynamically. Are

  • WEBDYNPRO JAVA OR WEBDYNPRO ABAP INTO SRM PORTAL

    Hi masters of SRM.   I have a question ?  what webdynpro is better to develop enhancement or new requisitions.   if you have any idea which will be implemented in new request from users ? thanks.

  • Finder Hangs Crashes and Burns in Lion: Steps to FIX

    Issue Description: Since installing OSX Lion the Finder hangs, entire system becomes unresponsive, cannot force Finder to relaunch and osx must be forced to restart. Occurred intermittently, usually when executing searches via Finder or Spotlight, or

  • Hide the document folder in GW7

    Since I don't use the document management option in GroupWise, can I hide the document folder in GW 7 client? I asked that question with GW 6.5 and was told NO. Thanks Gina

  • Caller-ID Block on CME

    Hi All, Is there a way to block caller-id on ephone-dn level for external calls and keep it for internal calls (i.e. dialing other extensions on the same site) as the caller-id block command hide it for all calls (external & internal). Please note th