File to Mail without Mapping

Hi Experts,
I need to pick up text files from a folder using File Adapter and then send them to a mail id directly without any mapping in XI. Please suggest how it can be done.
Thanks,
Shobhit

Hi-
Check out these links
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] [original link is broken]
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6d967fbc-0a01-0010-4fb4-91c6d38c5816

Similar Messages

  • How to send image file through mail without   any attachment

    Plz tell  me how to send image file through mail without any attachment  ( i mean not converting  that image into pdf or any format )  i want to send that text or image  through mail .

    Hi Sandeep,
    I think you can setup the type of email in Shared office Settings in transaction S016.
    There is an option called <Preset document classes>
    You choose this pushbutton to branch to the maintenance screen for the document classes that are directly displayed to users in the Business Workplace for selection when they use the Create function. The name under which the documents are displayed can also be maintained.
    http://help.sap.com/saphelp_nw70/helpdata/en/6c/69c30f418d11d1896e0000e8322d00/content.htm
    Haven't tried it though.
    Regards,
    Siddhesh

  • File to File multiple scenario without mapping

    Hi
    I am doing one simple file to file scenario without mapping i.e picking file from sender directory and then placing it in receiver directory via FTP.
    Now i have to take two files from different directories and place them in to different directories in the receiver side.
    On the sender side i have selected Advanced selection for source file and maintained the sceond directory name and filename.
    now i am not aware about the reciver side that how to place the two files in to different directories.
    I have to make only one interface for this.
    Thanks in advance.

    u have to follow the code in the link provided above but with some manipulations...
    in case u r placing the files in different target dir depending upon the source directory then ur code will be something like this:
    Note: i dont have a system as of now..so cant able to check the code for syntax errors..please cross check it
    MessagePropertyKey mpk = new MessagePropertyKey("Directory","http://sap.com/xi/XI/System/File");
    String SourceDir = msg.getMessageProperty(mpk);
    if(SourceDir.equals("/SourceDirectory1"))
    String targetDir1 = "/TargetDirectory1"
    msg.setMessageProperty("http://sap.com/xi/XI/System/File","Directory",targetDir1);
    else if(SourceDir.equals("/SourceDirectory2"))
    String targetDir1 = "/TargetDirectory2"
    msg.setMessageProperty("http://sap.com/xi/XI/System/File","Directory",targetDir2);
    else
    http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/engine/interfaces/messaging/api/Message.html#getMessageProperty(com.sap.engine.interfaces.messaging.api.MessagePropertyKey)
    lIbraries for adapter module development:
    http://wiki.sdn.sap.com/wiki/display/XI/Where%20to%20get%20the%20libraries%20for%20XI%20development
    How to develop adapter module:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa?QuickLink=index&overridelayout=true

  • File to Mail - no mapping

    Hi Experts,
         I have the following scenario to be done.
    I want to pick up a file from the FTP location and send it to a mail box as attachment.
    I went thro many blogs for configuring the sender FILE adapter & receiver MAIL adapter.
    My question is : Is there any need to define Message Interface compulsorily because when I want to define Receiver determiantion then it ask for MI. But in my scenario there is no need for mapping at all.
    So, please explain the step by step procedure and what are steps to be configured for this scenario.
    If possible with screenshots.

    Hello shankar,
    Go through this blogs...
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken] - File to Mail
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i - Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii - Dynamic File Name Part 2
    /people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address - Dynamic Mail Address
    Thanks,
    Satya Kumar
    Reward if it is useful..

  • How to keep same file name in File to Mail-Without Ripository Object??

    Hello Experts,
    I have a requirement where I need to pick a file and need to send that as an attachment by mail adapter through PI.
    I can send the file as attachment but the file name is being changed.
    For example,the source file with name "Vendor_2011_11_06" is being transfered but when I am checking the mail box,the file is coming as attachment but the name has been changed to "Untitled.bin".I want the same file name as it was in source SFTP server.
    Do any one have any idea that how can we set the file name at receiver mail adapter?
    **Note:I have not created any repository objects,simply configured the ID object with dummy Service Interface name.So no mapping exist.

    Hi,
      For example,the source file with name "Vendor_2011_11_06" is being transfered but when I am checking the mail box,the file is coming as attachment but the name has been changed to "Untitled.bin".I want the same file name as it was in source SFTP server.
        by using MessageTransformBean you can acheive this.
    Transform.ContentDisposition------  attachment or inline  For example, attachment;filename=u201Dabc.txtu201D
    Transform.ContentDescription------- Description
    Transform.ContentType------Specifies the payload type, for example, text/plain
    refer this blog
    http://wiki.sdn.sap.com/wiki/display/XI/DynamicEmailAttachmentnameforReceivedMails  
    i hope this will help you.
    regards,
    ganesh.

  • Importing .pst files into mail without a PC

    Hello to all those lovely Mac users,
    I've got an Outlook .pst file on CD. How can I import mail messages
    b without having access to a PC???
    The only OS X email client I'm aware of that supports .pst files is entourage 2004 + pst importer for entourage. I, however, only have Office X which is not supported by pst importer. Nor is Office 2004 Test drive.
    Thunderbird for OS X is a dead end as well.
    Please help me!

    You should probably take a look at one of the following options:
    • ol2mbox (free): http://sourceforge.net/projects/ol2mbox
    • O2M ($10): http://www.littlemachines.com/
    Andreas

  • Attaching Word and PDF files in Mail without preview in the middle of a message

    I am using Mail but often attaching Word docs and PDFs. Word attachments appear as small icons, but PDFs as preview and usually in the middle of the message. Can I attach PDFs as small icons and not in the middle  of a message? Having just moved to Mac from PC I am missing the tidyness of Outlook, but if you can help me I'll persist.

    I found this solution in a previous thread:
    1. Open Terminal (Applications > Utilities > Terminal)
    2. copy and paste this line after the $:
    defaults write com.apple.mail DisableInlineAttachmentViewing -bool yes
    3. hit return
    4. you may need to restart Mail for the change to take effect, it worked for me without restarting Mail.
    5. to change it back you would do
    defaults write com.apple.mail DisableInlineAttachmentViewing -bool false

  • 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.

  • How can I convert an outlook pst file to mac mail without using a windows based computer

    I recently bought the new iMac as my older Windows based computer crashed with a bad motherboard.  I have been trying to find a way to convert Outlook 2007 pst files to Mac Mail without the need to use a Windows based computer since all I have now is a Mac.  I have the copies of the pst files on my Mac, so I am looking for the most efficient way to convert them to the format that I can then open them in the Mac Mail.  Any suggestions would be greatly appreciated.

    Hi - thanks for the instructions but where do you get the option for Quicktime. If I do File - Export I only get the options for File name, place and size but no option that allows to select quicktime:-(
    Have you got any more tips?

  • Renaming a File to File without Mapping

    Hi All,
    I am having a scenario where there is a text file transfer without any conversion i.e. basically a file to file scenario with no mapping. The only requirement is to rename source file which has .csv extn to .dat. For instance if the sender file is XYZ.csv, the file at the receiver side should be XYZ.dat.
    As there is no mapping, I cannot use Dynamic Configuration UDF in mapping. One other option is to write an adapter module which seems too bulky for this small requirement. So as of now I am looking at any option which I can use without having to create IR objects or do text ->XML -> text conversion.
    I hope experts here can help in resolving the current problem and/or give some pointers
    Best Regards,
    Pratik

    > OS Command in File Receiver Channel: mv %f `basename %f .csv`.dat
    I think you should use the full path address, the same as you used for the folder.
    You can also use an adapter module, it is just a couple of lines:
    public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData)
                          throws ModuleException{
         try {
            Message msg = (Message) inputModuleData.getPrincipalData();
            Payload payload = msg.getDocument();
            String fileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File","FileName");
            // do something with the filename
            msg.setMessageProperty("http://sap.com/xi/XI/System/File","FileName", fileName);
            inputModuleData.setPrincipalData(msg);
        } catch (Exception e) {
            throw new ModuleException(e);
        return inputModuleData;

  • How can one send email-sized photo files as attachments in Mail, without the photos appearing within the email?s

    How can one send email-sized photo files as attachments in Apple Mail, without the photos appearing in the body of the email?  If it can be done, it's not at all obvious, at least not to me.  Thanks for any help you can provide.

    The "View as icon" option shrinks the photo to an icon in the sender's Apple Mail, but how it appears to the recipient varies dependingy on what e-mail client he/she uses.
    Using Apple Mail 5.0 (the Lion version) at both ends, the sender can use the "View as icon" option to shrink his view of the photo to an icon, but the recipient also using Apple Mail 5.0 still sees the full photo in line with the message text. The recipient can then use the "View as icon" option to shrink it to an icon, but I don't think that's not what jackofarabia is looking for.
    As far as I know there is no way in the current Apple Mail to do what jackofarabia wants. There should be, but there isn't.

  • File to XI scenarion without mapping

    HI All,
    MY REQUIREMENT:
    1. Need to read the data from FILE .
    2. pass the values to a BAPI structure in ECC Without any mapping
    QUESTIONS:
    1. Is it possible to complete the  scenario without mapping in XI.
    2. If possible how.
    Could any one help me how to achieve this
    Than you,
    Harsha P

    My source data structure is same as BAPI.
    We have created data types ,message types and Service interfaces for SENDER in ESR.
    But our Issues.
    1. Do we need to create Receiver Interface Objects.
    If yes How (In our scenario receiver is BAPI)
    import RFC under imported objects in esr
    2. What are the configurations we need to do in ID for SENDER and RECEIVER.
    coming to id:
    create everything like
    communication channels for sender as file and receiver as RFC.
    create Agrrements for sender and receiver.
    create Receiver determination and interface determination.
    Edited by: bhavanisankar.solasu on Feb 21, 2012 4:17 PM

  • Rename a file at the reciver without mapping with date/timestamp_filename

    Hi Friends,
    I have a scenario in which I have to rename the file if its exisiting at the reciever end with date/timestamp_filename in a file to file scenario without mapping.
    Thanks,
    --Sonal

    chk this (using adapter modules)
    http://wiki.sdn.sap.com/wiki/display/Snippets/DynamicfilenameinaFiletoFilepassthroughscenario

  • Sending mail without attachment file

    Hi Sapfans:
    I would like to send mail without attachment file, just a notice,
    needing multiple receiver, can change the mail title,
    Which function shoud I use?
    I just found out sending mail with attachment file there,
    Thanks a lot!

    Hi Alchie,
    Please take a look at my example below. It sens e-mail to multiple recipients without attachments.
    FUNCTION-POOL zts0001                    MESSAGE-ID sv.
    INCLUDE lsvimdat                                . "general data decl.
    INCLUDE lzts0001t00                             . "view rel. data dcl.
    */ Author: Aris Hidalgo
    */ Created on: September 7, 2006
    */ Purpose of program: This will send out e-mails to specified users in
    */ custom table ZSHIPTO_EMAIL whenever records have been deleted or
    */ modified via the maintenance view of ZTS0001. The changes will also
    */ be reflected in custom table ZTS_STPGEOLOC.
    TABLES: zts_stpgeoloc,
            zshipto_email,
            kna1.
    FIELD-SYMBOLS: <fs_old_total> TYPE ANY.
    *       CLASS lcl_main DEFINITION ABSTRACT
    CLASS lcl_main DEFINITION ABSTRACT.
      PUBLIC SECTION.
        TYPES: BEGIN OF t_zts0001_old,
                kunnr    TYPE zts0001-kunnr,
                cdseq    TYPE zts0001-cdseq,
                zaddress TYPE zts0001-zaddress,
                zcperson TYPE zts0001-zcperson,
                zcnumber TYPE zts0001-zcnumber,
               END OF t_zts0001_old.
        TYPES: BEGIN OF t_zts0001_new,
                kunnr    TYPE zts0001-kunnr,
                cdseq    TYPE zts0001-cdseq,
                zaddress TYPE zts0001-zaddress,
                zcperson TYPE zts0001-zcperson,
                zcnumber TYPE zts0001-zcnumber,
               END OF t_zts0001_new.
        TYPES: BEGIN OF t_zts_stpgeoloc,
                kunnr    TYPE zts_stpgeoloc-kunnr,
                cdseq    TYPE zts_stpgeoloc-cdseq,
                zaddress TYPE zts_stpgeoloc-zaddress,
                zcperson TYPE zts_stpgeoloc-zcperson,
                zcnumber TYPE zts_stpgeoloc-zcnumber,
               END OF t_zts_stpgeoloc.
        TYPES: BEGIN OF t_del_entries,
                kunnr    TYPE zts0001-kunnr,
                cdseq    TYPE zts0001-cdseq,
                zaddress TYPE zts0001-zaddress,
                zcperson TYPE zts0001-zcperson,
                zcnumber TYPE zts0001-zcnumber,
                name1    TYPE kna1-name1,
               END OF t_del_entries.
        TYPES: BEGIN OF t_modified_entries,
                kunnr       TYPE zts0001-kunnr,
                cdseq       TYPE zts0001-cdseq,
                old_address TYPE zts0001-zaddress,
                new_address TYPE zts0001-zaddress,
                old_person  TYPE zts0001-zcperson,
                new_person  TYPE zts0001-zcperson,
                old_number  TYPE zts0001-zcnumber,
                new_number  TYPE zts0001-zcnumber,
                name1       TYPE kna1-name1,
               END OF t_modified_entries.
        DATA: gt_zts0001_old      TYPE STANDARD TABLE OF t_zts0001_old,
              gt_zts0001_new      TYPE HASHED   TABLE OF t_zts0001_new
                                           WITH UNIQUE KEY kunnr cdseq,
              gt_zts_stpgeoloc    TYPE STANDARD TABLE OF t_zts_stpgeoloc,
              gt_del_entries      TYPE STANDARD TABLE OF t_del_entries,
              gt_modified_entries TYPE STANDARD TABLE OF t_modified_entries,
              gt_zshipto_email    TYPE STANDARD TABLE OF zshipto_email,
              t_maildata          TYPE sodocchgi1,
              gt_mailtxt          TYPE STANDARD TABLE OF solisti1,
              gt_mailrec          TYPE STANDARD TABLE OF somlreci1.
        DATA: v_old_total     TYPE i,
              v_new_total     TYPE i,
              v_flag(1)       TYPE c,
              v_counter(1)    TYPE c,
              v_contents(255) TYPE c.
    ENDCLASS.
    *       CLASS lcl_get_old_recs DEFINITION
    CLASS lcl_get_old_recs DEFINITION INHERITING FROM lcl_main.
      PUBLIC SECTION.
        METHODS: export_old_recs.
    ENDCLASS.
    *       CLASS lcl_get_old_recs IMPLEMENTATION
    CLASS lcl_get_old_recs IMPLEMENTATION.
      METHOD export_old_recs.
        SELECT kunnr cdseq zaddress zcperson zcnumber
        FROM zts0001
        INTO TABLE gt_zts0001_old.
        v_old_total = sy-dbcnt.
        ASSIGN v_old_total TO <fs_old_total>.
        EXPORT gt_zts0001_old = gt_zts0001_old TO MEMORY ID 'AVH'.
        CLEAR gt_zts0001_old. REFRESH gt_zts0001_old.
      ENDMETHOD.
    ENDCLASS.
    *       CLASS lcl_old_and_new DEFINITION
    CLASS lcl_old_and_new DEFINITION INHERITING FROM lcl_main.
      PUBLIC SECTION.
        METHODS: compare_old_and_new.
    ENDCLASS.
    *       CLASS lcl_old_and_new IMPLEMENTATION
    CLASS lcl_old_and_new IMPLEMENTATION.
      METHOD compare_old_and_new.
        DATA: wa_del_entries    LIKE LINE OF gt_del_entries.
        FIELD-SYMBOLS: <fs_old> LIKE LINE OF gt_zts0001_old,
                       <fs_new> LIKE LINE OF gt_zts0001_new.
        SELECT kunnr cdseq zaddress zcperson zcnumber
        FROM zts0001
        INTO TABLE gt_zts0001_new.
        v_new_total = sy-dbcnt.
        IF v_new_total <> <fs_old_total>.
          IMPORT gt_zts0001_old = gt_zts0001_old FROM MEMORY ID 'AVH'.
          LOOP AT gt_zts0001_old ASSIGNING <fs_old>.
            READ TABLE gt_zts0001_new WITH TABLE KEY kunnr = <fs_old>-kunnr
                                                     cdseq = <fs_old>-cdseq
                                                     ASSIGNING <fs_new>.
            IF sy-subrc <> 0.
              MOVE-CORRESPONDING <fs_old> TO wa_del_entries.
              APPEND wa_del_entries TO gt_del_entries.
              CLEAR wa_del_entries.
              DELETE FROM zts_stpgeoloc
              WHERE kunnr = <fs_old>-kunnr
                AND cdseq = <fs_old>-cdseq.
            ENDIF.
          ENDLOOP.
          IF NOT gt_del_entries[] IS INITIAL.
            EXPORT gt_del_entries = gt_del_entries TO MEMORY ID 'DEL'.
          ENDIF.
          REFRESH gt_zts0001_old.
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    *       CLASS lcl_check_changes DEFINITION
    CLASS lcl_check_changes DEFINITION INHERITING FROM lcl_main.
      PUBLIC SECTION.
        METHODS: check_for_changes.
    ENDCLASS.
    *       CLASS lcl_check_changes IMPLEMENTATION
    CLASS lcl_check_changes IMPLEMENTATION.
      METHOD check_for_changes.
        TYPES: BEGIN OF t_zts_stpgeoloc,
                mandt    TYPE zts_stpgeoloc-mandt,
                kunnr    TYPE zts_stpgeoloc-kunnr,
                cdseq    TYPE zts_stpgeoloc-cdseq,
                zcgeoloc TYPE zts_stpgeoloc-zcgeoloc,
                zaddress TYPE zts_stpgeoloc-zaddress,
                zcperson TYPE zts_stpgeoloc-zcperson,
                zcnumber TYPE zts_stpgeoloc-zcnumber,
               END OF t_zts_stpgeoloc.
        DATA: wa_modified_entries LIKE LINE OF gt_modified_entries,
              lt_zts_stpgeoloc    TYPE HASHED TABLE OF t_zts_stpgeoloc
                                       WITH UNIQUE KEY kunnr cdseq,
              wa_zts_stpgeoloc    LIKE LINE OF lt_zts_stpgeoloc.
        FIELD-SYMBOLS: <fs_zts0001_old> LIKE LINE OF gt_zts0001_old,
                       <fs_zts0001_new> LIKE LINE OF gt_zts0001_new.
        IMPORT gt_zts0001_old = gt_zts0001_old FROM MEMORY ID 'AVH'.
        SELECT kunnr cdseq zcgeoloc zaddress zcperson zcnumber
        FROM zts_stpgeoloc
        INTO CORRESPONDING FIELDS OF TABLE lt_zts_stpgeoloc.
        SELECT kunnr cdseq zaddress zcperson zcnumber
        FROM zts0001
        INTO TABLE gt_zts0001_new.
        LOOP AT gt_zts0001_old ASSIGNING <fs_zts0001_old>.
          READ TABLE gt_zts0001_new WITH TABLE KEY
                                         kunnr = <fs_zts0001_old>-kunnr
                                         cdseq = <fs_zts0001_old>-cdseq
                                         ASSIGNING <fs_zts0001_new>.
          IF sy-subrc = 0.
            READ TABLE lt_zts_stpgeoloc WITH TABLE KEY
                                            kunnr = <fs_zts0001_new>-kunnr
                                            cdseq = <fs_zts0001_new>-cdseq
                                            INTO wa_zts_stpgeoloc.
            IF sy-subrc = 0.
              wa_zts_stpgeoloc-mandt    = sy-mandt.
              wa_zts_stpgeoloc-kunnr    = <fs_zts0001_new>-kunnr.
              wa_zts_stpgeoloc-cdseq    = <fs_zts0001_new>-cdseq.
              wa_zts_stpgeoloc-zcgeoloc = space.
              wa_zts_stpgeoloc-zaddress = <fs_zts0001_new>-zaddress.
              wa_zts_stpgeoloc-zcperson = <fs_zts0001_new>-zcperson.
              wa_zts_stpgeoloc-zcnumber = <fs_zts0001_new>-zcnumber.
              MODIFY zts_stpgeoloc FROM wa_zts_stpgeoloc.
              COMMIT WORK AND WAIT.
            ENDIF.
    *       address
            IF <fs_zts0001_old>-zaddress <> <fs_zts0001_new>-zaddress.
              MOVE: <fs_zts0001_new>-kunnr  TO wa_modified_entries-kunnr,
                    <fs_zts0001_new>-cdseq  TO wa_modified_entries-cdseq,
              <fs_zts0001_old>-zaddress TO wa_modified_entries-old_address,
              <fs_zts0001_new>-zaddress TO wa_modified_entries-new_address.
              v_flag = 1.
            ENDIF.
    *       person
            IF <fs_zts0001_old>-zcperson <> <fs_zts0001_new>-zcperson.
              MOVE: <fs_zts0001_new>-kunnr  TO wa_modified_entries-kunnr,
                    <fs_zts0001_new>-cdseq  TO wa_modified_entries-cdseq,
              <fs_zts0001_old>-zcperson TO wa_modified_entries-old_person,
              <fs_zts0001_new>-zcperson TO wa_modified_entries-new_person.
              v_flag = 1.
            ENDIF.
    *       number
            IF <fs_zts0001_old>-zcnumber <> <fs_zts0001_new>-zcnumber.
              MOVE: <fs_zts0001_new>-kunnr  TO wa_modified_entries-kunnr,
                    <fs_zts0001_new>-cdseq  TO wa_modified_entries-cdseq,
              <fs_zts0001_old>-zcnumber TO wa_modified_entries-old_number,
              <fs_zts0001_new>-zcnumber TO wa_modified_entries-new_number.
              v_flag = 1.
            ENDIF.
          ENDIF.
          IF v_flag = 1.
            APPEND wa_modified_entries TO gt_modified_entries.
            CLEAR wa_modified_entries.
          ENDIF.
    *     update ZTS_STPGEOLOC based from the modified records in ZTS0001
          IF v_flag = 1.
            CLEAR v_flag.
            UPDATE zts_stpgeoloc SET zaddress  = <fs_zts0001_new>-zaddress
                                      zcperson = <fs_zts0001_new>-zcperson
                                      zcnumber = <fs_zts0001_new>-zcnumber
                                   WHERE kunnr = <fs_zts0001_new>-kunnr
                                     AND cdseq = <fs_zts0001_new>-cdseq.
          ENDIF.
        ENDLOOP.
        IF NOT gt_modified_entries[] IS INITIAL.
        EXPORT gt_modified_entries = gt_modified_entries TO MEMORY ID 'MOD'
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    *       CLASS lcl_messages DEFINITION
    CLASS lcl_messages DEFINITION INHERITING FROM lcl_main.
      PUBLIC SECTION.
        METHODS: create_message.
    ENDCLASS.
    *       CLASS lcl_messages IMPLEMENTATION
    CLASS lcl_messages IMPLEMENTATION.
      METHOD create_message.
        FIELD-SYMBOLS: <fs_email> LIKE LINE OF gt_zshipto_email,
                       <fs_del>   LIKE LINE OF gt_del_entries,
                       <fs_mod>   LIKE LINE OF gt_modified_entries.
        DATA: wa_mailtxt LIKE LINE OF gt_mailtxt,
              wa_mailrec LIKE LINE OF gt_mailrec.
        IMPORT gt_modified_entries = gt_modified_entries
                                     FROM MEMORY ID 'MOD'.
        IMPORT gt_del_entries = gt_del_entries FROM MEMORY ID 'DEL'.
        SELECT * FROM zshipto_email INTO TABLE gt_zshipto_email
         WHERE zevent = '2'.
        IF sy-dbcnt > 0.
    */    routine for records that were deleted
          IF NOT gt_del_entries[] IS INITIAL.
            t_maildata-obj_name  = 'Record Deleted in table ZTS0001'.
            t_maildata-obj_descr = 'Record Deleted in table ZTS0001'.
            t_maildata-obj_langu = sy-langu.
            CLEAR: v_flag, v_counter.
            LOOP AT gt_zshipto_email ASSIGNING <fs_email>.
              LOOP AT gt_del_entries ASSIGNING <fs_del>.
    *           get name of dealer
                SELECT SINGLE name1 FROM kna1
                INTO <fs_del>-name1
                WHERE kunnr = <fs_del>-kunnr.
                IF v_counter IS INITIAL.
                 CONCATENATE: 'FYI: The ff record/s were deleted in tables'
                               'ZTS0001 and ZTS_STPGEOLOC by user' sy-uname
                                                          INTO v_contents
                                                         SEPARATED BY space.
                  wa_mailtxt-line =  v_contents.
                  APPEND wa_mailtxt TO gt_mailtxt.
                  CLEAR: wa_mailtxt, v_contents.
                ENDIF.
                APPEND wa_mailtxt TO gt_mailtxt. "Extra space for message
                CONCATENATE: 'Dealer :' <fs_del>-kunnr '-'
                             <fs_del>-name1
                             INTO v_contents
                             SEPARATED BY space.
                wa_mailtxt-line = v_contents.
                APPEND wa_mailtxt TO gt_mailtxt.
                CLEAR: wa_mailtxt, v_contents.
                CONCATENATE: 'Ship-To:' <fs_del>-cdseq
                             INTO v_contents
                             SEPARATED BY space.
                wa_mailtxt-line = v_contents.
                APPEND wa_mailtxt TO gt_mailtxt.
                CLEAR: wa_mailtxt, v_contents.
                CONCATENATE: 'Address:' <fs_del>-zaddress
                             INTO v_contents
                             SEPARATED BY space.
                wa_mailtxt-line = v_contents.
                APPEND wa_mailtxt TO gt_mailtxt.
                CLEAR: wa_mailtxt, v_contents.
                CONCATENATE: 'Contact person:' <fs_del>-zcperson
                             INTO v_contents
                             SEPARATED BY space.
                wa_mailtxt-line = v_contents.
                APPEND wa_mailtxt TO gt_mailtxt.
                CLEAR: wa_mailtxt, v_contents.
                CONCATENATE: 'Contact number:' <fs_del>-zcnumber
                             INTO v_contents
                             SEPARATED BY space.
                wa_mailtxt-line = v_contents.
                APPEND wa_mailtxt TO gt_mailtxt.
                CLEAR: wa_mailtxt, v_contents.
                v_counter = 1.
              ENDLOOP.
              wa_mailrec-receiver = <fs_email>-zemail.
              wa_mailrec-rec_type  = 'U'.
              APPEND wa_mailrec TO gt_mailrec.
              CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
                   EXPORTING
                        document_data              = t_maildata
                        document_type              = 'RAW'
                        put_in_outbox              = 'X'
    *                  commit_work                = 'X'
                   TABLES
    *                  object_header              = mailtxt
                        object_content             = gt_mailtxt
                        receivers                  = gt_mailrec
                   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.
                MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
              ENDIF.
              CLEAR:    wa_mailtxt, wa_mailrec.
              REFRESH:  gt_mailtxt, gt_mailrec.
            ENDLOOP.
          ENDIF.
          CLEAR wa_mailtxt.
          REFRESH gt_mailtxt.
    */    routine for records that were modified
          IF NOT gt_modified_entries[] IS INITIAL.
            CLEAR t_maildata.
            t_maildata-obj_name  = 'Record changed in table ZTS0001'.
            t_maildata-obj_descr = 'Record changed in table ZTS0001'.
            t_maildata-obj_langu = sy-langu.
            CLEAR v_counter.
            LOOP AT gt_zshipto_email ASSIGNING <fs_email>.
              CONCATENATE: 'FYI: The ff records were changed in tables'
                           'ZTS0001 and ZTS_STPGEOLOC by user' sy-uname
                           INTO v_contents
                           SEPARATED BY space.
              wa_mailtxt-line =  v_contents.
              APPEND wa_mailtxt TO gt_mailtxt.
              CLEAR: wa_mailtxt, v_contents.
              LOOP AT gt_modified_entries ASSIGNING <fs_mod>.
    *          get name of dealer
                SELECT SINGLE name1 FROM kna1
                INTO <fs_mod>-name1
                WHERE kunnr = <fs_mod>-kunnr.
                APPEND wa_mailtxt TO gt_mailtxt.
                CONCATENATE: 'Dealer :' <fs_mod>-kunnr '-'
                             <fs_mod>-name1
                             INTO v_contents
                             SEPARATED BY space.
                wa_mailtxt-line = v_contents.
                APPEND wa_mailtxt TO gt_mailtxt.
                CLEAR: wa_mailtxt, v_contents.
                CONCATENATE: 'Ship-To:' <fs_mod>-cdseq
                             INTO v_contents
                             SEPARATED BY space.
                wa_mailtxt-line = v_contents.
                APPEND wa_mailtxt TO gt_mailtxt.
                CLEAR: wa_mailtxt, v_contents.
    *           address
                IF NOT <fs_mod>-old_address IS INITIAL AND
                   NOT <fs_mod>-new_address IS INITIAL.
                  CONCATENATE: 'Address from:' <fs_mod>-old_address
                               INTO v_contents
                               SEPARATED BY space.
                  wa_mailtxt-line = v_contents.
                  APPEND wa_mailtxt TO gt_mailtxt.
                  CLEAR: wa_mailtxt, v_contents.
                  CONCATENATE: 'Address to  :' <fs_mod>-new_address
                               INTO v_contents
                               SEPARATED BY space.
                  wa_mailtxt-line = v_contents.
                  APPEND wa_mailtxt TO gt_mailtxt.
                  CLEAR: wa_mailtxt, v_contents.
                ENDIF.
    *           person
                IF NOT <fs_mod>-old_person IS INITIAL AND
                       NOT <fs_mod>-new_person IS INITIAL.
                  CONCATENATE: 'Contact person from:'
                               <fs_mod>-old_person
                               INTO v_contents
                               SEPARATED BY space.
                  wa_mailtxt-line = v_contents.
                  APPEND wa_mailtxt TO gt_mailtxt.
                  CLEAR: wa_mailtxt, v_contents.
                  CONCATENATE: 'Contact person to  :'
                               <fs_mod>-new_person
                               INTO v_contents
                               SEPARATED BY space.
                  wa_mailtxt-line = v_contents.
                  APPEND wa_mailtxt TO gt_mailtxt.
                  CLEAR: wa_mailtxt, v_contents.
                ENDIF.
    *           number
                IF NOT <fs_mod>-old_number IS INITIAL AND
                       NOT <fs_mod>-new_number IS INITIAL.
                  CONCATENATE: 'Contact number from:'
                               <fs_mod>-old_number
                               INTO v_contents
                               SEPARATED BY space.
                  wa_mailtxt-line = v_contents.
                  APPEND wa_mailtxt TO gt_mailtxt.
                  CLEAR: wa_mailtxt, v_contents.
                  CONCATENATE: 'Contact number to  :'
                               <fs_mod>-new_number
                               INTO v_contents
                               SEPARATED BY space.
                  wa_mailtxt-line = v_contents.
                  APPEND wa_mailtxt TO gt_mailtxt.
                  CLEAR: wa_mailtxt, v_contents.
                ENDIF.
              ENDLOOP.
              wa_mailrec-receiver = <fs_email>-zemail.
              wa_mailrec-rec_type  = 'U'.
              APPEND wa_mailrec TO gt_mailrec.
              CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
                   EXPORTING
                        document_data              = t_maildata
                        document_type              = 'RAW'
                        put_in_outbox              = 'X'
    *                  commit_work                = 'X'
                   TABLES
    *                  object_header              = mailtxt
                        object_content             = gt_mailtxt
                        receivers                  = gt_mailrec
                   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.
                MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
              ENDIF.
              CLEAR:    wa_mailtxt, wa_mailrec.
              REFRESH:  gt_mailtxt, gt_mailrec.
            ENDLOOP.
          ENDIF.
        ENDIF.
        FREE MEMORY ID 'AVH'.
        FREE MEMORY ID 'DEL'.
        FREE MEMORY ID 'MOD'.
      ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
    *       FORM get_orig_contents_of_zts0001                             *
    */ before saving the data in the database
    FORM get_orig_contents_of_zts0001.
      DATA: get_old_recs TYPE REF TO lcl_get_old_recs.
      CREATE OBJECT get_old_recs.
      CALL METHOD get_old_recs->export_old_recs.
    ENDFORM.
    *       FORM get_rev_contents_of_zts0001                              *
    */ after saving the data in the database
    FORM get_rev_contents_of_zts0001.
      DATA: old_and_new   TYPE REF TO lcl_old_and_new,
            check_changes TYPE REF TO lcl_check_changes,
            messages      TYPE REF TO lcl_messages.
      CREATE OBJECT: old_and_new, check_changes, messages.
      CALL METHOD old_and_new->compare_old_and_new.
      CALL METHOD check_changes->check_for_changes.
      CALL METHOD messages->create_message.
    ENDFORM.
    *       FORM move_latest_date_and_user                                *
    FORM move_latest_date_and_user.
      zts0001-zcreated_by   = sy-uname.
      zts0001-zchanged_date = sy-datum.
    ENDFORM.
    Hope it helps...
    P.S. Please award points if it helps...

  • How can I attach a pdf file to outgoing mail without it opening up within the message?

    How can I attach a pdf file to outgoing mail without in opening up within the message?

    You can use the Share button on Preview's toolbar. Choosing Email pops open Mail with the PDF already iconified as an attachment. If it doesn't behave this nicely for you, select the PDF in Mail and choose the right contextual menu, where you will find View as Icon. I also have Send Windows-Friendly attachments enabled.

Maybe you are looking for