How to send email after bdc upload done?

Hi Experts,
How do we send an email after the bdc upload program run successfully. I want to send email to the users saying the material upload successfully message with the material details.
How can i do it? Is there any way to trigger a mail after calling the bdc upload part?
Please help me on this.
Thanks in advance.
Regards,
Rashika.

Hi,
After the BDC has run. check if sy-subrc is zero or not.
IF sy-subrc EQ 0.
        COMMIT WORK.
and in this IF statement use the following code:
    wa_receivers-receiver = so_malid-low.
    wa_receivers-rec_id = so_malid-low.
    wa_receivers-rec_type = 'U'.
    wa_receivers-com_type = 'INT'.
    wa_receivers-notif_del = 'X'.
    wa_receivers-notif_ndel = 'X'.
    APPEND wa_receivers TO gi_receivers.
    CLEAR wa_receivers.
Populate the subject/generic message attributes
  wa_doc_data-obj_langu = sy-langu.
  wa_doc_data-obj_name = lc_obj_name.
  wa_doc_data-obj_descr = 'Find Inactive PU/DU'(001).
  wa_doc_data-sensitivty = lc_sensitivity.
Describe the body of the message
  wa_message = '<html><head>'.
  APPEND wa_message TO gi_messages.
  wa_message = '<style type="text/css">'.
  APPEND wa_message TO gi_messages.
  wa_message = lc_style_content.
  APPEND wa_message TO gi_messages.
  wa_message = lc_style_content1.
  APPEND wa_message TO gi_messages.
  wa_message = '</style></head>'.
  APPEND wa_message TO gi_messages.
  wa_message = '<body>'.
  APPEND wa_message TO gi_messages.
  wa_message = 'Hi,<BR><BR>'(002).
  APPEND wa_message TO gi_messages.
CONCATENATE(' Updation successful')
    '.<BR><BR>'
    INTO wa_message SEPARATED BY space.
    APPEND wa_message TO gi_messages.
DATA: lv_tab_lines TYPE i VALUE 255.
  CLEAR gi_packing_list.
  REFRESH gi_packing_list.
  wa_packing_list-transf_bin = space.
  wa_packing_list-head_start = 1.
  wa_packing_list-head_num = 0.
  wa_packing_list-body_start = 1.
  DESCRIBE TABLE gi_messages LINES lv_tab_lines.
  READ TABLE gi_messages INDEX lv_tab_lines INTO wa_message.
  wa_doc_data-doc_size = ( lv_tab_lines - 1 ) * 255 + STRLEN( wa_message ).
  APPEND wa_message TO gi_messages.
  DESCRIBE TABLE gi_messages LINES wa_packing_list-body_num.
  wa_packing_list-doc_type = 'HTM'.
  wa_packing_list-doc_size = lv_tab_lines * 255.
  APPEND wa_packing_list TO gi_packing_list.
  CLEAR wa_packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = wa_doc_data
      sender_address             = gc_sender_address
      sender_address_type        = gc_sender_address_type
      commit_work                = 'X'
    TABLES
      packing_list               = gi_packing_list
      contents_txt               = gi_messages
      receivers                  = gi_receivers.
Regards,
Rajesh Kumar

Similar Messages

  • How 2 send email after connection lost & comes back - without loosing text.

    Having problems with ISP connection - not fault of Firefox. When connection is dropped while I am typing an email, yellow message appears at top of email screen advising connection lost & to try again later. Once the connection is regained, there is no obvious way to send the email - screen remains frozen even after connection is regained. End up having to retype email and hope connection holds.

    One option would be to compose your emails in a separate program that lets you save locally so you don't have to worry about your internet connection. Options include Microsoft Word or a wide variety of free software such as http://www.libreoffice.org/ . But it's a hassle and interrupts the flow, so definitely not optimal.
    In a search on the add-ons site, I did find one that promises to save your form data as you go. The problem is, a lot of webmail sites uses techniques that bypass regular form controls, so this might not work. But, it could be worth a try, or feel free to keep searching.
    [https://addons.mozilla.org/en-US/firefox/addon/lazarus-form-recovery/ Lazarus: Form Recovery :: Add-ons for Firefox]

  • [SOLVED]How to send email to a local user?

    I have installed Mutt, msmtp, procmail and I can send and receive emails to/from remote hosts and I'd like to send email locally also (to the recipients on the same machine as the sender).
    When I try to send email to a local user from the root account -
    echo "Test message" | mail -s "Test subject" localuser
    then I get an error that connection to the port 25 is refused. Because the /etc/msmtprc file contains the 'localhost' as the default account's host, and on the local host I don't have a mail server listening on 25 port running.
    When I try to send email from a non-root account which has in /$HOME/.msmtprc file a real email account on a remote server, then of course there is an error that the domain for the email address 'localuser' is not recognized.
    How can sending email to local users be enabled?
    Last edited by nbd (2014-09-30 22:33:37)

    If I understand correctly, postfix it's a constantly running daemon. Seems to be an overhead for delivering only from time to time sent messages.
    ewaller wrote:
    > Out of the box, sendmail should be safe, but I think you have to enable local mail.
    Currently I have msmtp-mta installed, which is described as having sendmail functionality. If I install sendmail - will it be possible to send local email without running email daemons?

  • How to send email notification in different languages in Workflow ?? Urgent Help Needed

    Gurus,
    How to send email notification in different languages in Workflow? Can anyone send me some useful guidelines or link where it is mentioned.

    There is no profile option available to specify whether send or not send email notification.
    But after login, in preferences youcan set the notification preference value by which you can configure whether to send or not
    to send email notifications.
    If you select ''Do not send me mail' or 'Disabled' it will not send.
    For other values it sends the notfication in different formats like text, html, attachments etc...
    Edited by: sarojak on Jun 27, 2011 7:18 AM

  • Can't send email after 3.0 upgrade

    I can receive but not send email after the 3.0 upgrade. Also, the stock and weather buttons never update.
    Email is my important issue. Any ideas?

    Yeah, I put that in the title so hopefully people would see it right off the bat. I've been in the forum, looking at threads since the update to see if I'm the only one, and seem to be. I know tons of people are seeing problems with yahoo pushing email, but that's less of a concern to me at this point. And the fact that it worked just fine until this update tells me Apple broke it with their update. Surely I'm not the only person. And switching to gmail is not a good option for me. First of all, I hate gmail. Second of all, the sbcglobal account is my main mail account for my dsl line and I use it heavily. I don't want to switch. Shouldn't have to in my opinion.
    I was in the Promenade in Santa Monica earlier, was going to ask a "Genius", but the wait to see one was ridiculous. couldn't get an appointment till Monday. I'll wait till I'm back home to go the apple store I guess. It just frustrates me because I seriously doubt they can do anything at the store I haven't done already.

  • I can't send email after iOS7 update...

    I can't send email after the iOS7 update....this is a show stopper for me.   When is a fix expected?

    First it would help if you explain exactly what happens when you send an email. 
    Do you get an error message?
    If so what does the message say?
    The abilitly to send or receive emails does not fall on Apple or the IOS 7.
    You email provider gives you that ability.
    Double check and make sure your outgoing mail server is correct.

  • Can not send emails after ML update

    I am unable to send emails after updating to Mountain Lion. Four email accounts, same problem: All settings are unchanged, but SMTP servers for outgoing mail are set as passive. No problem with incoming emails. Any suggestions?

    I thought they might be. Apple seems to forget about POP accounts, and most problems seem to occur in them.
    Do you have a backup before upgrading?
    Did Mail go through the upgrade process the first time you opened Mail after the installation? Sounds like something may have gone wrong.
    All mail accounts and emails are stored in you user/Library/Mail/V2 folder. If you have a time machine backup, just restore that V2 folder from before the upgrade (close Mail first) and see if that fixes the problem.
    To see your Library folder, click on the desktop to make it active, then go to the menu at the top, select Go, then Go to Folder and type or copy and paste
    ~/Library
    Then go to the Mail folder and open it and click on Time Machine - restore the V2 folder from before the backup

  • HT4864 I cant send email after the IOS 7. I receive all emails normaly in the outlook 2011, bus I cant receive.

    I  cant send email after the IOS 7. I receive all emails normaly in the outlook 2011, bus I cant receive. What can I do?

    Update - I now have it working.
    am not really sure what exactly fixed it.
    I changed a lot of things but my setup now has the following which I think fixed.
    outgoing server  - p06-smtp.mail.me.com
    override default port checked - port now 587
    on more options button changed it to "use incoming server info".

  • Hi, I can't send email after installed maverick with mail

    hi, I can't send email after installed maverick with mail
    Thanks

    OS X Mail: Troubleshooting sending and receiving email messages

  • How to send emails from HANA SQL Console

    Hi,
    Please guide how  to send mail from HANA Studio SQL Console.
    Is there any standard procedure in Hana Studio to send Mail( e.g. in MS SQL  "sp_send_dbmail" Procedure)

    Hi Preethi,
    Please go through the attached link:
    How to send emails from HANA
    Regards,
    Krishna

  • How to send emails from of pdf's generated by oracle reports

    I have several pdf documents , I want to email those pdf's . Please let me know how to send emails from oracle reports .
    Thanks,
    Previn

    I have integrated Oracle Reports with Oracle Portal and used the scheduling feature via portlets. We have reports that run every monday morning for management. For more info go to:
    http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html
    OR
    I think if you set destype=mail, desformat=PDF, and desname=[email protected] that should also do the trick.
    Just be sure that you have put your mail server's IP address in the rep_<machine_name>.conf file located in your <oracle_home>/reports/conf directory. If this is not set up, the mail feature won't work.
    Martin

  • How to send emails to spam folder?

    I just got my Note4 and the phone's Help tells me that I need to select the email, then the bottom menu will populate with a little red circle with a + in it. I am to click that and the email address is sent to spam. But my bottom menu is NOT giving me that spam icon to click.  How can I block emails? Or how can I get that little icon to show up?
    Thanks!!

    Yes, I have unsubscribed to the emails that allowed me too. Now I would
    like to block spefic addresses and/or domains.
    My email addresses are @verizon.net, @gmail.com and a corporate one. I am
    using Gmail for the Gmail accounts and using the default email service that
    came on the phone. It's icon is an envelope with a red @
    I know the gmail service allows me to easily click "report spam"  but using
    note 4  how can I block emails in my  verizon.net account and corporate
    account?
    Thanks.
           <https://community.verizonwireless.com>
    A message from the Verizon Wireless Community
    <https://community.verizonwireless.com>
    <https://www.verizonwireless.com/wcms/consumer/explore.html> 
    <http://www.verizonwireless.com/wcms/consumer/shop.html>  [image: MY
    VERIZON] <http://www.verizonwireless.com/b2c/myverizonlp/> 
    <http://www.verizonwireless.com/support/>
       how to send emails to spam folder?  created by Verizon Wireless Customer
    Support <https://community.verizonwireless.com/people/vzw_customer_support>
    in Android - View the full discussion
    <https://community.verizonwireless.com/message/1176922#1176922>

  • TS3276 I lost the ability to send email after upgrading to maverick.

    I lost the ability to send email after upgrading to maverick.  Has anyone  else had this problem?

    Mail troubleshooting - Yosemite
    What does Mail/Window/Connection Doctor Show? If the server is red, select it and look at the Show Details box.
    Troubleshooting sending and receiving email messages
    Troubleshooting sending email messages

  • How to sending email from Oracle Forms

    How to sending email from Oracle 6i(Forms)
    I need to send email to a distribution list(multiple email addresses).

    send email of multiple email address
    [email protected],[email protected],[email protected]
    create or replace function mailout
    (sender in varchar2,
    recipient in varchar2,
    ccrecipient in varchar2,
    subject in varchar2,
    message in varchar2) return number
    is
    crlf varchar2(2) := chr(13)||chr(10);
    connection utl_smtp.connection;
    mailhost varchar2(50) := 'Add email server Ip Address here';
    header varchar2(4000);
    v_num number :=1;
    str number:=0;
    email varchar2(50);
    begin
    connection := utl_smtp.open_connection(mailhost,25);
    header := 'Date: '||to_char(sysdate,'dd mon yy hh24:mi:ss')||crlf||
    'From: '||sender||' '||crlf||
    'Subject: '||subject||crlf||
    'To: '||recipient||crlf||
    'Cc: '||ccrecipient||crlf||message;
    utl_smtp.helo(connection,mailhost);
    utl_smtp.mail(connection,sender);
    utl_smtp.rcpt(connection,recipient);
    while (instr(ccrecipient,',',1,v_num)>0) loop
    email:=substr(ccrecipient,str+1,instr(ccrecipient,',',1,v_num)-str-1);
    dbms_output.put_line(email);
    utl_smtp.rcpt(connection,email);
    str:=instr(ccrecipient,',',1,v_num);
    v_num:=v_num+1;
    end loop;
    utl_smtp.open_data(connection);
    -- utl_smtp.write_data(connection,header);
    utl_smtp.write_data(connection,'MIME-Version:1.0'||crlf||'Content-type:text/html'||crlf||header);
    utl_smtp.close_data(connection);
    utl_smtp.quit(connection);
    return 0;
    exception
    when utl_smtp.invalid_operation then
    dbms_output.put_line('Invalid Operation in SMTP transaction');
    return 1;
    when utl_smtp.transient_error then
    dbms_output.put_line('Temporary problem with sending email ');
    return 2;
    when utl_smtp.permanent_error then
    dbms_output.put_line('Permanent problem with sending email ');
    return 3;
    end;

  • Just want to find out how to send email? Can receive just fine, but cant send?!?!

    Hi Just wanted to find out how to send email? can receive just fine but cant send. Using hotmail at the moment.
      Any help would be great
    Thanks

    go to your mail providers setup guide and compare every single setting to how your smtp setup in your settings are set
    and if they are not the same change yours to match their page
    and if they are the same contact your isp to inquire as to why they are blocking the ports your mail provider are using

Maybe you are looking for

  • Possible Resolution to MiFi 2200 connection issues when using WiFi

    I was having issues connecting to the Internet with my Windows 7 laptop using the MiFi 2200 as a WiFi device. My WiFi adfapter was retaining the last IP Address it had obtained ... in my case my home network. Go to a command prompt and do an ipconfig

  • XML PL/SQL Parser Out of memory

    Im parsing a 20M file and recieving the following result. I have tried to cut the file size down and have found a small version that will parse successfully. We have tried adjusting the ulimit -d 2097152 ulimit -s 32768 and also set java_pool_size =

  • Format of variable imported from FrameMaker file

    When I import my FrameMaker  files into RoboHelp, at least one of the variable formats changes. That is, a variable format containing a superscript character gets removed when imported into RoboHelp. Is there a way to fix this variable format in Robo

  • Account payable,account receivable, asset account

    HI sir /madam          i want to know the process of ACCOUNT RECEIVABLE, ACCOUNT PAYABLE,ASSET ACCOUNT what ficos consultancy do, what are steps in fico do other then mm and sd person do. i want to know the only fico job in in this process AP,AR,AA.

  • Is it legal to airdrop music?

    Is it legal to airdrop music?