Pulling e-mail body for variable in job

We currently are using the Email Event in TES to pull a single string from an e-mail trigger into a variable in a job.  However, we are now looking to see if we can put multiple strings into an e-mail and use them for multiple variables in a single job.  Is this a possibility, and if so, how should the strings be seperated?  If it is not a possibility, is anyone else pulling in multiple strings from an outside source like email to populate job variables?  We are currently runing ver. 5.3.1.                

Hi Rachana,
The problem with this was that, there was some configuration problem with the transaction SCOT.
When the mail was sent to my client's ID: the E-Mail body looked perfect, but when it was sent to my Company's ID it was distorted.
Please check, this could be the problem and let me know if you face further issues.
Thanks & Regards,
Goutham.

Similar Messages

  • Prob in getting Mail body for the standard tcode F150(Dunning).

    Hello all,
    I am using F150 for the dunning notice print out.After seeing the display of the dunning notice once we come back it populates a popup window where it asks to send the mail to the particular mailid or not. I have used the BTE ---  SAMPLE_PROCEE_00001040 and copied it as z function module and customised according to my requirement in order to get the mail id of the customer in the pop up.My mail is going to the customers mail id properly only but my prob is that we are not able to get any mail body for that particular mail.Where can we add the mail body text to that mail in the standard tcode f150.can any one suggest is it possible or not.
    Regards,
    Pavani.
    Edited by: Pavani Rayappureddi on Aug 11, 2009 11:21 AM

    solved my self.
    added         C_ITCPO-TDTITLE  = 'Pending Receivables Statement-XXX GROUP'.
    in the bte code.

  • Help with newsletter PHP Mail script for mySQL / cron job

    I'm just trying to set up a PHP script to send emails as a cron job.
    It pretty much seems to work, but I can't get it to do two parts.
    The first part is to send the emails, and the second is to send a notification email to the site owner confirming that the emails have been sent.
    The script looks like:
    <?php
    include_once "connect_to_mysql.php";
    $sql = mysql_query("SELECT UserID, Firstname, Email, Newsletter_Received FROM Users WHERE Firstname='test' LIMIT 20");
    $numRows = mysql_num_rows($sql);
    $mail_body = '';
    while($row = mysql_fetch_array($sql)){
      $id = $row["UserID"];
      $email = $row["Email"];
      $name = $row["Firstname"];
      $mail_body = 'Test - please ignore';
        $subject = "Safari Awards Newsletter";
        $headers  = "From:[email protected]\r\n";
        $headers .= "Content-type: text/html\r\n";
        $to = "$email";
        $mail_result = mail($to, $subject, $mail_body, $headers);
      if ($mail_result) {
      mysql_query("UPDATE Users SET Newsletter_Received='1' WHERE Email='$email' LIMIT 20");
      } else {
    ?>
    <?php
    if ($numRows == 0) {
      $subj = "Newsletter Sent";
      $body = "The current newsletter has been sent to everyone.";
         $hdr  = "From:[email protected]\r\n";
         $hdr .= "Content-type: text/html\r\n";
         mail("[email protected]", $subj, $body, $hdr);
    ?>
    Basically with the line
    include_once "connect_to_mysql.php";
    included, it sends the emails as per the SELECT query, but does not send the 'Newsletter Sent' email.
    But if I take out that line, it obviously doesn't send the emails as per the SELECT query, but it does send the 'Newsletter Sent' email.
    Any suggestions on what might need changing in order for it to do both would be much appreciated!
    Thanks.

    Change this line -
    if ($numRows == 0) {
    to this -
    if ($mail_result) {

  • Getting Mails repeatedly for Job Alert

    Hi,
    I have configured CCMS mail alerts for a particular job that runs once in an hour.Till yesterday i got single mail for every one hour for that failed job .But now am getting 10 to 15 mails for the single job that fails in an hour .Could someone please help me on this?
    We have found one difference between alert mails for  the failed  jobs .. I have found only one difference in date like " 15.03.2010 "  and  " 03/15/2010 " ... may this be the cause due to day light timing change in USA? If so how can i resolve this .....
    Thanks
    Prakash
    Edited by: rdhaprakasam2003 on Mar 15, 2010 3:55 PM
    Edited by: rdhaprakasam2003 on Mar 16, 2010 3:57 PM

    problem solved thanks to 3everyone

  • Create hyperlink for reply to in mail body while sending email.

    Hi All,
    We have a requirement where we need to create an hyperlink for reply to in the mail body.
    We have implemented entire functionality using CL_BCS classes and everything is working fine.
    Only problem we have is when we give document type as HTM instead of RAW then entire formatting of mail body gets disturbed although we get the hyperlink.
    Is there any way where we can send the mail in html format using CL_BCS,CL_DOCUMENT_BCS ?
    KR Jaideep,

    Hi ,
    Please find the code below I am using to make the hyperlink. Do I need to fill the entire mail body using HTML Tags ? If yes, then I guess it will increase the complexity of program as the mail content will vary from one mail to another depending upon whether different invoice documents have text maintained in them.
    lwa_text = '<html>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '<body>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = text-012.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        CONCATENATE '<a href="mailto:'
                    lv_receiver
                    '">'
                    lv_receiver
                    '</a>'
               INTO lwa_text.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '</body>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        lwa_text = '</html>'.
        APPEND lwa_text TO li_text.
        CLEAR lwa_text.
        TRY.
            CALL METHOD cl_document_bcs=>create_from_text
              EXPORTING
                i_text         = li_text
                i_documenttype = 'HTM'
                i_subject      = 'Test for hyperlink'
                i_importance   = '1'
                i_sensitivity  = 'P'
              RECEIVING
                result         = lref_document_bcs.
          CATCH cx_document_bcs .
        ENDTRY.

  • Apple Mail 8.0 does not display email body for local folders

    Last week I upgraded to Yosemite on a 2013 Mac Air. The upgrade went smoothly, but now I notice that all my mail on my local folders (i.e., not my gmail account) is missing the content of the message. New mail filed after the upgrade displays fine and messages filed prior to the upgrade that were sent from me, display fine, but all mail received and filed before the upgrade is blank except for the header. I tried to move a message thinking it might force Mail to identify a problem...and it does. It gives me the message "The message '<MESSAGE TITLE>' could not be moved to the mailbox '<DESTINATION FOLDER>'. Couldn't load body for <MFLibraryMessage:0x600000584780, library id:2172 conversationID:1224 mailbox:2010 <SOURCE FOLDER>"
    I have scoured the web for solutions, and there are similar symptoms regarding Apple Mail and IMAP accounts, but my IMAP mailboxes display fine.
    I made a TimeMachine back up before the upgrade, so I could restore the old OSX (Mountain Lion) and try again, but I'd love to find an easier solution.

    Hi there,
    ok now I found a solution:
    Navigate to the folder which contains the local mailboxes as MBOX-Files. ~/Library/Mail/V2/Mailboxes/
    Locate the MBOX-file which contains the messages which are not displayed.
    In my case I tried to access mails from "Empfangen" and "Gesendet" so I copied over those two MBOX-files to the desktop.
    Now go to mail.app and select import message box
    In the following context menu select "import files from Apple Mail" (cuz Apple Mail MBOX-files are not standard MBOX format)
    Import the content.
    After import drag your messages from the imported folder to the original folder.
    done!
    I hope that helps someone who has the same problem.
    Greetings

  • Need v11.5 Xtras for e-mail, saving list variables

    Hi all,
    I'm working on a new DVD project that needs to run on the latest Windows and Mac platforms, but am having trouble finding Xtras that have been updated for Director 11.5 and have been recompiled for Intel-based Macs.
    Specifically, I am looking for Xtras with these features:
    1. Ability to send e-mails. DirectEMail appears to be the most-recommended, but the newest version I see is dated 2004. StarSoft has an Xtra that only lists Windows platforms as compatible. Is there anything good out there for Director 11.5 for both platforms?
    2. Ability to save/retrieve Lingo variables (specifically lists) to/from a disk file. I've looked at both PropSave (appears to be very outdated - 2002?) and vList (newest version is 11.5-compatible, but appears to be discontinued - no obvious way to order from their web site). Can anyone suggest anything?
    Many thanks in advance!

    Hi,
    May be using flash ? here is an example :
    http://www.sourcecodeonline.com/details/flashformmail.html
    Brahim AYI
    De : WHairston [email protected]
    Envoyé : mercredi 21 septembre 2011 13:52
    À : brahim_ayi
    Objet : Need v11.5 Xtras for e-mail, saving list variables
    Re: Need v11.5 Xtras for e-mail, saving list variables
    created by WHairston <http://forums.adobe.com/people/WHairston>  in Basics - View the full discussion <http://forums.adobe.com/message/3929351#3929351

  • SSIS Jobs:-getting issue The expression for variable failed evaluation.

    Hi ,
    I have one package where I am having single DFT.in source i am taking query from variable., and destination I am taking destination table from variable.
    i have created a package configuration, i have created a job.when I am running I am getting below error
    Code: 0xC0019004     Source: LoadArchive Using BIML  Description: The expression for variable "V_Archivequery" failed evaluation. There was an error in the expression. 
    this error is coming for all the variable which need to be changed at run time.
    below is the query which will chnage the value of the variable on run time.
    SELECT Archivequery,ArchiveTableName,BBxKeyDerExpr FROM Fabrication.dbo.FileMaster WITH (NOLOCK)
    WHERE SourceFileName = ?
    suggest me some good solution.
    Regards,
    Vipin jha
    Thankx & regards, Vipin jha MCP

    Hi Vipin jha,
    According to your description, you created one SSIS package with data flow task, you used variable with the expression SELECT Archivequery,ArchiveTableName,BBxKeyDerExpr FROM Fabrication.dbo.FileMaster WITH (NOLOCK) WHERE SourceFileName = ?, when you the
    package with sql agent job, you got the error message.
    I tried to reproduce the issue on my local machine, but it works fine for me. To troubleshoot the problem, please refer to the following steps:
    Make sure the variable can be found in the Variables collection.
    Objects in SSIS are case sensitive, please validate that the name of the variable is correct.
    If the problem remain unresolved, i would appreciate it if you could give us detailed information of error message, I would be appreciated it if you could provide sample data and screenshot of the package. It will help us move more quickly toward a solution.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Database Mail Fails For SQL Server Agent Jobs / Maintenace plans - Why ?

    Database Mail Fails For SQL Server Agent Jobs / Maintenace plans - Why ?
    This has been a very common question I have seen relatedt to Database mail and I thought will post here so if you run into this issue, it could be due to one of the following and also have mentioned below how to get around them. Bottom line is datbase mail works fine with SQL Agent jobs and maintenace plans in SP1 on all platforms.
    1. If you see this on 64 bit platform and on RTM build, this is a bug that is addressed in SP1.
    2. If you see the below error message, it is known issue and this is because of design that requires SQL Agent to restart, if SQL Agent was started before enabling databasemail and setting a new profile. We are evaluating to change this design of not requiring to restart agent for our future release.
    Re: 264] An attempt was made to send an email when no email session has been established
    This problem will go away after restarting SQL Server Agent in this case. Thanks,
    Gops Dwarak, MSFT

    This may be related to the fact that DBMail, by default, shuts itself down after 10 minutes of inactivty.  If the mail service isn't running, you won't be able to queue up any mail messages.
    There may be a built-in mechanism for addressing this problem, but I found that I can detect this situation and start the mail listener before sending db mail.  I use the following in stored procs that need to send email.
    You could increase the inactivity period for db mail shutdown from 600 seconds to some larger value.  It might not make sense to do so, since shutting it down releases its resources back to teh system; if your SQL server only sneds mail infrequently, it might be better to start the mail listener on demand.  Someone with more experience than I might want to add their two cents' worth.  :-)
    /* Check the mail engine. Start the service if is is stopped         */
    /* -- the DB Mail engine shuts down after 10 minutes (of inactivity) */
    /* -- this setting can be changed, but we probably don't need to.    */
    DECLARE @rc INT
    IF NOT EXISTS (SELECT * FROM msdb.sys.service_queues
                   WHERE name = N'ExternalMailQueue' AND is_receive_enabled = 1)
        EXEC @rc = msdb.dbo.sysmail_start_sp
        -- TODO: add handling and logging for any engine start issues

  • How to send e-mail alert to the user job is successful or failed.

    Hi Experts,
    I have scheduled a job using DBMS_JOB Package; in this job I am calling a procedure.
    How can we send an e-mail(alert) to the user if the job is successful (or) job fails.
    If the job is successfully completed, then we have to send mail as “Job is completed successfully along with job name”.
    If the job fails we have to send email as “error message of the job along with job name”(why the job is failed).
    This alert should be sending automatically no manual intervention.
    Please help me.
         CREATE OR REPLACE PROCEDURE APPS_GLOBAL.arc_procedure (P_ID IN NUMBER)
         IS
         CURSOR C IS SELECT id,table_name,archive_table_name,where_condition
         FROM apps_global.control_ram
         WHERE id = p_id
         ORDER BY id, table_name;
         BEGIN
            FOR I IN C
            LOOP
               EXECUTE IMMEDIATE
                  'INSERT INTO '
               || I.ARCHIVE_TABLE_NAME
               || '
         (SELECT * FROM '
               || I.TABLE_NAME
               || ' WHERE '
               || I.WHERE_CONDITION
               || ')';
               EXECUTE IMMEDIATE
                  'DELETE FROM '
               || I.TABLE_NAME
               || ' WHERE '
               || I.WHERE_CONDITION
               || '';
               COMMIT;
            END LOOP;
         EXCEPTION
            WHEN OTHERS
            THEN
               ROLLBACK;
               DBMS_OUTPUT.PUT_LINE (
               'An error was encountered - ' || SQLCODE || ' -ERROR- ' || SQLERRM);
         END arc_procedure;
         /This is my job.
    DECLARE
      X NUMBER;
    BEGIN
      SYS.DBMS_JOB.SUBMIT
      ( job       => X
       ,what      => 'APPS.arc_procedure(1);'
       ,next_date => to_date('05/01/2013 00:00:00','dd/mm/yyyy hh24:mi:ss')
       ,interval  => 'TRUNC(SYSDATE+1)'
       ,no_parse  => FALSE
      SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
    COMMIT;
    END;
    /Thanks in advance.

    Hi,
    I think you can do by creating mailing procedures and call it in the loop and outside the loop.
    There would be two procedure one in inside loop which will execute after successfull completion of the loop.
    Other would be in the exception block like i shown in the below code you have written;
    V_variable_1 you can use as a parameter for what is the error occured.
    like suppose your mailing procedure name is Status_email and Status_email_1.
    CREATE OR REPLACE PROCEDURE APPS_GLOBAL.arc_procedure (P_ID IN NUMBER)
         IS
         CURSOR C IS SELECT id,table_name,archive_table_name,where_condition
         FROM apps_global.control_ram
         WHERE id = p_id
         ORDER BY id, table_name;
    V_VARIABLE_1 NUMBER;
    V_VARIABLE_2 VARCHAR2(400);
         BEGIN
            FOR I IN C
            LOOP
               EXECUTE IMMEDIATE
                  'INSERT INTO '
               || I.ARCHIVE_TABLE_NAME
               || '
         (SELECT * FROM '
               || I.TABLE_NAME
               || ' WHERE '
               || I.WHERE_CONDITION
               || ')';
               EXECUTE IMMEDIATE
                  'DELETE FROM '
               || I.TABLE_NAME
               || ' WHERE '
               || I.WHERE_CONDITION
               || '';
               COMMIT;
                     STATUS_EMAIL;
            END LOOP;
         EXCEPTION OTHERS THEN
    V_VARIABLE_1 :=SQLCODE;
    V_VARIABLE_2 :=SQLERRM;
               ROLLBACK;
    STATUS_EMAIL_1(V_VARIABLE_1,V_VARIABLE_2);
         END arc_procedure;
         / You can refer to sample email procedure i have created for you.
    CREATE OR REPLACE PROCEDURE STATUS_EMAIL
    AS
       v_From       VARCHAR2(80) := 'EMAIL_ID';
       v_Recipient  VARCHAR2(80) := 'EMAIL_ID';
    --YOU CAN SEND EMAIL TO MORE THAT ONE USER SO YOU CAN USE LIKE BELOW VARIABLE....
       v_Recipienttt  VARCHAR2(80) := 'EMAIL_ID';
       v_Subject    VARCHAR2(80) := 'SUBJECT_FOR_THE_MAIL';
       v_Mail_Host  VARCHAR2(30) := 'MAIL_SERVERS_HOST_IP(SMTP_SERVER)';
       v_Mail_Conn  utl_smtp.Connection;
       crlf         VARCHAR2(2)  := chr(13)||chr(10);
    BEGIN
      v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host);
      utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
      utl_smtp.Mail(v_Mail_Conn, v_From);
      utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
      utl_smtp.Rcpt(v_Mail_Conn, v_Recipienttt);
    --OPEN DATA CONNNECTION
      UTL_SMTP.OPEN_DATA(v_mail_conn);
    --MAIL HEADER
      utl_smtp.write_DATA(v_Mail_Conn,'Date: '   || to_char(sysdate, 'DD-MON-YYYY hh:mi:ss AM') || crlf);
      utl_smtp.write_DATA(v_Mail_Conn,'From: '   || v_From || crlf );
      utl_smtp.write_DATA(v_Mail_Conn,'Subject: '|| v_Subject || ||crlf);
      utl_smtp.write_DATA(v_Mail_Conn,'To: '     || v_Recipient || crlf);
      utl_smtp.write_DATA(v_Mail_Conn,'Cc: '       || v_Recipienttt ||','|| crlf);
    --MAIL BODY
      utl_smtp.write_DATA(v_Mail_Conn,'MIME-Version: 1.0'|| crlf );
      utl_smtp.write_DATA(v_Mail_Conn,'Content-Type: multipart/mixed;'|| crlf );
      utl_smtp.write_DATA(v_Mail_Conn,' boundary="-----SECBOUND"'|| crlf ||crlf );
      utl_smtp.write_DATA(v_Mail_Conn,'-------SECBOUND'|| crlf );
      utl_smtp.write_DATA(v_Mail_Conn,'Content-Type: text/plain;'|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,'Content-Transfer_Encoding: 7bit'|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,'Procedure is successfully complited without error'|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,null|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,null|| crlf);
    utl_smtp.write_DATA(v_Mail_Conn,null|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,'Dear All, '|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,'Procedure is successfully complited without error'||'.' ||crlf);
      utl_smtp.write_DATA(v_Mail_Conn,null|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,null|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,null|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,null|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,'Regards, '|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,null|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,'any_name '|| crlf);
      utl_smtp.write_DATA(v_Mail_Conn,null|| crlf);
      utl_smtp.write_data(v_Mail_Conn, utl_tcp.CRLF ||'This mail is auto generated.');
      --CLOSE CONNECTION
      UTL_SMTP.CLOSE_DATA(v_mail_conn);
      utl_smtp.Quit(v_mail_conn);
    EXCEPTION
      WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
        raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
    END;
    /cheers..

  • How can I get the mail body of the start point mail

    Hi,
    I am using 'MailStartPoint' activity to fetch mails using POP3 protocol. It is fetching the mail successfully. Now, how can I read the different parts of mail message such as Subject, Body in variables.
    Thank You,
    Hali Gerorge.

    You need to set data types values as below for reading the mail.
    %SUBJECT%
    %BODY%
    %HEADER%
    %SENDER%
    Check this link for more details - http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/help.htm?content=001463.html
    Also see "Use an e-mail start point" @ http://www.adobe.com/devnet/livecycle/videotraining.html
    ~ Varun

  • [SOLVED] Mail content for Direct Alert Notifications

    Hi,
    I asked this question during a 10g New Features course once but didn't get an answer... maybe somebody here can help?
    The format (long) of an email notification from EM (10.2.0.3) is:
    E-mail Subject (Long Format):
    EM Alert: <severity> <target name> <message>
    E-mail Body (Long Format):
    Subject: EM Alert: Critical: prod1.us.oracle.com - CPU Utilization is 90%
    Date: Mon, 14 Oct 2004 12:56:46 +0000 (GMT)
    From: "EMD Notifications" <[email protected]>
    To: [email protected]
    Name=prod1.us.oracle.com
    Type=Host
    Host=prod1.us.oracle.com
    Metric=CPU Utilization (%)
    Timestamp=14-OCT-2003 12:57:04 (GMT 0:00)
    Severity=Critical
    Message=CPU Utilization is 90%
    Rule Name=ALL_HOST_METRICS
    Rule Owner=MGMT_REPI would like to (drastically) change that format. The emails will be going to a central helpdesk where they will be picked up by people with absolutely no Oracle knowledge, logged as faults and passed to the DBA team. As such I need to present them with a no-fuss, easily understood email - something like:
    Subject: EM Alert: <severity> <target name> <message>
    E-mail Body (Long Format):
    Helpdesk,
    The following event has been detected on <name> for <host>:
    <message>
    <timestamp>
    Please raise a <severity> fault and pass to the DBA team for investigation. 
    If necessary please contact the on-call DBA.Has anybody ever achieved (or know how to achieve) something similar?
    Cheers,
    Joseph

    Just a further note - this has already been raised as an enhancement request. The following update is from Oracle Support:
    The enhancement bug 6155970 was opened in 2007 .
    Feedback from DEV is that ER 6155970 is not planned for implementation in 11G.
    Bug description.
    Abstract: SUPPORT CUSTOMIZATION OF EMAIL FORMATS FOR ALERTS
    Many enterprises rely on email/pages as a primary way of getting
    notifications for alerts. Many of them rely on the subject line of the email as way
    to determine the type of alert.
    Thus, it is important for them to be able to:
    a) specify the pieces of information about the alert that they would like to
    see in the subject as well as the body of the notification
    b) specify length to be shown for some of these (e.g. the message of the
    alert). This customer in particular would like to have EM show more of the
    alert message in the subject line, beyond what it is currently showing.
    Solution:
    You can use an OS command notification rule and use a Shell script to send customized mail.
    The OS notification rules set the following variables to unix schell.
    "target name " $TARGET_NAME
    "target type " $TARGET_TYPE
    "target host " $HOST
    "metric in alert " $METRIC
    "metric value " $METRIC_VALUE
    "policy rule " $POLICY_RULE
    "key value " $KEY_VALUE
    "key value name " $KEY_VALUE_NAME
    "violation context " $VIOLATION_CONTEXT
    "timestamp " $TIMESTAMP
    "severity " $SEVERITY
    "message " $MESSAGE
    "rule_name " $RULE_NAME
    "rule owner " $RULE_OWNER

  • How to send data in mail body

    Hi experts,
    I can send all the data of internal table as attachment through mail. But requirement is to send all the data in mail body. No attachment should go with this mail. How to do this?
    Regards,
    Goutam Sahoo

    Hi Check this sample program. Clearly mentioned the body of the message .
    <pre>REPORT  zvenkat_mail_simple.
    Mail related declarations
    "Variables
    DATA :
         g_sent_to_all   TYPE sonv-flag,
         g_tab_lines     TYPE i.
    "Types
    TYPES:
         t_document_data  TYPE  sodocchgi1,
         t_packing_list   TYPE  sopcklsti1,
         t_attachment     TYPE  solisti1,
         t_body_msg       TYPE  solisti1,
         t_receivers      TYPE  somlreci1.
    "Workareas
    DATA :
         w_document_data  TYPE  t_document_data,
         w_packing_list   TYPE  t_packing_list,
         w_attachment     TYPE  t_attachment,
         w_body_msg       TYPE  t_body_msg,
         w_receivers      TYPE  t_receivers.
    "Internal Tables
    DATA :
         i_document_data  TYPE STANDARD TABLE OF t_document_data,
         i_packing_list   TYPE STANDARD TABLE OF t_packing_list,
         i_attachment     TYPE STANDARD TABLE OF t_attachment,
         i_body_msg       TYPE STANDARD TABLE OF t_body_msg,
         i_receivers      TYPE STANDARD TABLE OF t_receivers.
    "start-of-selection.
    START-OF-SELECTION.
      PERFORM send_mail.
      "Form  send_mail
      " PACKING LIST table requires information about how the data in the
      " tables OBJECT_HEADER, CONTENTS_BIN and CONTENTS_TXT are to be
      " distributed to the documents and its attachments. The first row is
      " for the document, the following rows are each for one attachment.
    FORM send_mail .
      "Subject of the mail.
      w_document_data-obj_name  = 'MAIL_TO_HEAD'.
      w_document_data-obj_descr = 'Simple mail using SAP ABAP'.
      "Body of the mail
      PERFORM build_body_of_mail
        USING:space,
              'Hi,',
              'I am fine. How are you? How are you doing ? ',
              'This program has been created to send simple mail',
              'with Subject,Body with Address of the sender. ',
              'Thanks and Regards,',
              'Venkat.O,',
              'SAP HR Technical Consultant.'.
      "Write Packing List (Body)
      DESCRIBE TABLE i_body_msg LINES g_tab_lines.
      w_packing_list-head_start = 1.
      w_packing_list-head_num   = 0.
      w_packing_list-body_start = 1.
      w_packing_list-body_num   = g_tab_lines.
      w_packing_list-doc_type   = 'RAW'.
      APPEND w_packing_list TO i_packing_list.
      CLEAR  w_packing_list.
      "Fill the document data and get size of attachment
      READ TABLE i_body_msg INTO w_body_msg INDEX g_tab_lines.
      w_document_data-doc_size = ( g_tab_lines - 1 ) * 255 + STRLEN( w_body_msg ).
      "Receivers List.
      w_receivers-rec_type   = 'U'.  "Internet address
      w_receivers-receiver   = <give mail id here>.
      w_receivers-com_type   = 'INT'.
      w_receivers-notif_del  = 'X'.
      w_receivers-notif_ndel = 'X'.
      APPEND w_receivers TO i_receivers .
      CLEAR:w_receivers.
      "Function module to send mail to Recipients
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = w_document_data
          put_in_outbox              = 'X'
          commit_work                = 'X'
        IMPORTING
          sent_to_all                = g_sent_to_all
        TABLES
          packing_list               = i_packing_list
          contents_txt               = i_body_msg
          receivers                  = i_receivers
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc = 0 .
        MESSAGE i303(me) WITH 'Mail has been Successfully Sent.'.
      ELSE.
        WAIT UP TO 2 SECONDS.
        SUBMIT rsconn01 WITH mode = 'INT'
                     WITH output = 'X'
                     AND RETURN.
      ENDIF.
    ENDFORM.                    " send_mail
    "      Form  build_body_of_mail
    FORM build_body_of_mail  USING l_message.
      w_body_msg = l_message.
      APPEND w_body_msg TO i_body_msg.
      CLEAR  w_body_msg.
    ENDFORM.                    " build_body_of_mail</pre>
    Thanks
    Venkat.O

  • ERMS Mail Body Content

    Hello.
    During  ERMS processing I need to accept mail body content for future processing.
    How in method IF_CRM_ERMS_SERVICE~EXECUTE of class CL_CRM_ERMS_AH_CREATE_IR could see mail body as string?
    Thank you.
    Igor Spector

    Hi Igor,
    I believe you have the answer in variable lr_sc_mail_data of that method. After instatiated (around line 167), you just have to read table lr_sc_mail_data->body and get the entry that as content_ascii filled.
    Can you check if that is working in your scenario?
    Kind regards,
    Garcia

  • How to use "Mail Merge for Word" to include only Account fields?

    We're attempting to use the Mail Merge for Word template to create a document containing several fields from the Account object. We do not need any fields from the Contact object, and there are many contacts linked to each account.
    When choosing "Get On Demand Data > Accounts", removing all the [Contacts] fields, selecting the necessary [Accounts] fields, then clicking "OK", a "List Download in Progress" window appears, followed by one that says "Microsoft Word - Subscript out of range". None of the [Accounts] fields are available in the downloaded data.
    Can anyone tell me how to include the appropriate Account fields without any Contact fields (which pulls a separate Merge record for every Contact linked with the selected Account)?
    Thanks.

    Thanks for trying to help with this.
    So far, we've been unable to pull even a SINGLE account record. So the problem is not related to data volume limitations. The tool seems to require that Contacts are selected, but for this application we only want a single merge document per Account.
    If anyone else has had success using the Mail Merge for Word tool to pull only Account data, please give us your guidance. Thanks.

Maybe you are looking for