E-mailing: How to sent out an email to the Managers OUTLOOK express account

Hi Experts,
System is ECC6.0.
I hv requirement that, the sales orders comes from EDI into SAP. If there is a error in material (like,
non-sellable, not existing etc.), I need to trap this issue/error.....................fine, I did it and working fine.
But, in next step, I need to send out an email to the manager to his/her OUTLOOOK express(NOT work flow account) email account"s inbox, with a standard specified format!!!!
I do NOT think, work flow is necessorily involved here in this scenario!!!
So, let me know that,
1) Is WORK FLOW involvment i there?
2) How to get it done that, sending out email to OUTLOOK express account with a standard format
3) Any FMs, piece of code
replies appreciated.
Edited by: SAP ABAPer on Sep 6, 2008 3:34 PM
Edited by: SAP ABAPer on Sep 6, 2008 3:35 PM

Hello
I can offer two proposals:
1) Standard report RSEIDOCA is used to actively monitor IDoc processing.
This report can be scheduled in background and reports failed IDocs. Unfortunately SAP did not offer e-mail notification together with this report which is really a shortcoming. However, I have written a modified version of this report which allows to send e-mails (see below).
2) Another scenario we are using is to replace wrong partners/materials with dummy partners or materials ensuring that the IDoc will be processed under all circumstances. In this case we set the Purchase order number supplement (sales order -> header -> tabstrip Order Data: field VBAK-BSTZD) = 'ERR'.
Using a condition (transaction VOFM ) we trigger an ORDRSP IDoc if a new sales order has BSTZD = 'ERR'. This IDoc is forwared to SAP-XI and translated into an e-mail to the customer service.
The crucial parts of my report ZRSEIDOCA are shown below (adjust selection screen and notification routine):
...*    perform show_act_moni.
**    PERFORM send_notification.
    PERFORM _send_email_notification.
    MESSAGE s596.
  ELSE." keine Benachrichtigung
    MESSAGE s597.
  ENDIF.
*&      Form  _SEND_NOTIFICATION
*       text
*  -->  p1        text
*  <--  p2        text
FORM _send_email_notification.
* define local data
* All activities done via facade CL_BCS!
  DATA: lo_send_request       TYPE REF TO cl_bcs.
  DATA: lt_text               TYPE bcsy_text.
  DATA: lo_document           TYPE REF TO cl_document_bcs.
  DATA: lo_sender             TYPE REF TO cl_sapuser_bcs.
  DATA: lo_recipient          TYPE REF TO if_recipient_bcs.
  DATA: lo_bcs_exception      TYPE REF TO cx_bcs.
  DATA: lx_sent_to_all        TYPE os_boolean.
  DATA: ls_edidc              TYPE edidc,
        lo_idoc               TYPE REF TO zcl_idoc,
        lif_idoc              TYPE REF TO zif_idoc,
        ls_text               TYPE soli,
        ld_text(50)           TYPE c,
        ld_subject            TYPE so_obj_des,
        ld_date(10)           TYPE c,
        ld_time(8)            TYPE c.
  TYPES: BEGIN OF ty_s_idocdata.
  INCLUDE TYPE vbak AS vbak RENAMING WITH SUFFIX _vbak.
  INCLUDE TYPE kna1 AS kna1 RENAMING WITH SUFFIX _kna1.
  TYPES: END OF ty_s_idocdata.
  DATA: ls_idocdata   TYPE ty_s_idocdata.
  TRY.
*     -------- create persistent send request ------------------------
      lo_send_request = cl_bcs=>create_persistent( ).
*     -------- create and set document -------------------------------
*     create document from internal table with text
**      APPEND 'Hello world!' TO lt_text.
**      lo_document = cl_document_bcs=>create_document(
**                      i_type    = 'RAW'
**                      i_text    = lt_text
**                      i_length  = '12'
**                      i_subject = 'test created by ZRSEIDOCA' ).
      ld_subject = 'IDoc Monitoring'.
      WRITE syst-datum TO ld_date DD/MM/YYYY.
      WRITE syst-uzeit TO ld_time.
      CONCATENATE ld_subject syst-slset
        INTO ld_subject SEPARATED BY space.
      CONCATENATE ld_subject ':' INTO ld_subject.
      CONCATENATE ld_subject ld_date 'at' ld_time
        INTO ld_subject SEPARATED BY space.
      LOOP AT i_edidc INTO ls_edidc.
        " Create IDoc instance
        CLEAR: lo_idoc,
               ls_idocdata.
        lo_idoc = zcl_idoc=>create_by_idoc_control( ls_edidc ).
        IF ( lo_idoc IS BOUND ).
          lif_idoc ?= lo_idoc.
          CALL METHOD lif_idoc->get_specific_data
            CHANGING
              c_data = ls_idocdata.
        ELSE.
        ENDIF.
        WRITE ls_edidc-docnum TO ls_text-line NO-ZERO.
        CONDENSE ls_text-line.
        IF ( ls_idocdata-vbak IS NOT INITIAL ).
          CONCATENATE 'POnumber' ls_idocdata-bstnk_vbak
            INTO ld_text SEPARATED BY '='.
          CONCATENATE ls_text-line ld_text
            INTO ls_text-line SEPARATED BY space.
          WRITE ls_idocdata-bstdk_vbak TO ld_text DD/MM/YYYY.
          CONCATENATE 'POdate' ld_text
            INTO ld_text SEPARATED BY '='.
          CONCATENATE ls_text-line ld_text
            INTO ls_text-line SEPARATED BY space.
          IF ( ls_idocdata-kunnr_vbak IS NOT INITIAL ).
            CONCATENATE 'Customer' ls_idocdata-kunnr_vbak
              INTO ld_text SEPARATED BY '='.
            CONCATENATE ls_text-line ld_text
              INTO ls_text-line SEPARATED BY space.
          ENDIF.
          IF ( ls_idocdata-name1_kna1 IS NOT INITIAL ).
            CONCATENATE '(' ls_idocdata-name1_kna1 ')'
              INTO ld_text.
            CONCATENATE ls_text-line ld_text
              INTO ls_text-line SEPARATED BY space.
          ENDIF.
        ENDIF.
        APPEND ls_text TO lt_text.
      ENDLOOP.
      lo_document = cl_document_bcs=>create_document(
                      i_type    = 'RAW'
                      i_text    = lt_text
**                      i_length  = '12'
                      i_subject = ld_subject ).
*     add document to send request
      CALL METHOD lo_send_request->set_document( lo_document ).
*     --------- set sender -------------------------------------------
*     note: this is necessary only if you want to set the sender
*           different from actual user (SY-UNAME). Otherwise sender is
*           set automatically with actual user.
      lo_sender = cl_sapuser_bcs=>create( sy-uname ).
      CALL METHOD lo_send_request->set_sender
        EXPORTING
          i_sender = lo_sender.
*     --------- add recipient (e-mail address) -----------------------
*     create recipients - please replace e-mail address !!!
      LOOP AT o_email.
        lo_recipient = cl_cam_address_bcs=>create_internet_address(
                                          o_email-low ).
*       add recipient with its respective attributes to send request
        CALL METHOD lo_send_request->add_recipient
          EXPORTING
            i_recipient = lo_recipient
            i_express   = 'X'.
      ENDLOOP.
*     ---------- send document ---------------------------------------
      TRY.
          CALL METHOD lo_send_request->set_status_attributes
            EXPORTING
              i_requested_status = 'N'  " suppress delivery confirmation
              i_status_mail      = 'E'.
        CATCH cx_send_req_bcs .
      ENDTRY.
      TRY.
          CALL METHOD lo_send_request->set_send_immediately
            EXPORTING
              i_send_immediately = 'X'.
        CATCH cx_send_req_bcs .
      ENDTRY.
      CALL METHOD lo_send_request->send(
        EXPORTING
          i_with_error_screen = 'X'
        RECEIVING
          result              = lx_sent_to_all ).
      IF lx_sent_to_all = 'X'.
        WRITE text-003.
      ENDIF.
      COMMIT WORK.
* *                     exception handling
* * replace this very rudimentary exception handling
* * with your own one !!!
    CATCH cx_bcs INTO lo_bcs_exception.
      WRITE: text-001.
      WRITE: text-002, lo_bcs_exception->error_type.
      EXIT.
  ENDTRY.
ENDFORM.
Regards
  Uwe

Similar Messages

  • TS1424 I have several incomplete songs after purchase from Itunes.  I sent out an email to find out how do I correct this problem? Follow-Up: 219141808

    I have 6-7 incomplete songs after purchase from Itunes.  I sent out an email to find out how do I correct this problem? Follow-up 219141808

    Welcome to the Apple Community.
    Try deleting the problematic file (electing to remove original file if/when prompted) and then re-downloading the file from the iTunes store.
    You can re-download content purchased from the iTunes store (availability varies depending on location) using the purchased option from the Quick Links section in the top right corner of the iTunes homepage in your iTunes application on your computer.
    You can re-download content purchased from the iTunes store (availability varies depending on location) using the purchased option at the bottom of the screen of the iTunes app (or video app) on your iOS device.
    If the problem re-occurs, select the content which is causing a problem and use the 'Report a problem' button in Your Purchase History using your computer.

  • I sent out an email to a group of 5 and addressed it to myself- it appears to have gone to my whole contact list- how can I sort this please

    I sent out an email to a group of 5 and addressed it to myself- it appears to have gone to my whole contact list- how can I sort this please?

    Nope, not strange at all. No system should try to be all things to all people. 
    Actually, there is a way to do this:  After creating a group message, save the conversation and add new messages it when necessary.
    If you want to suggest someting to Apple, post it here:
    Apple - iPhone - Feedback

  • How can I view my messages in mail, I only can see incoming emails, but the the screen where the message must be visible is empty. Also attachements are nog visible. These messages are visible on my Iphone. thanks

    How can I view my messages in mail, I only can see incoming emails, but the the screen where the message must be visible is empty. Also attachements are nog visible. These messages are visible on my Iphone. thanks

    And attached is a screen grab showing selected e-mails in the Inbox...the white space below are e-mails too!

  • All of my texts are now being sent through my email after the new update. How do I change this back to just sending with my phone number?

    All of my texts are now being sent through my email after the new update. How do I change this back to just sending with my phone number?

    Try settings -- messages -- send & recieve and see if your email and phone number are in there and if there is only a check mark next to your email address.  If so just check off your phone number and try that.

  • How do I read an email attachment in MS Outlook that comes through as win mail.dat extension?

    How do I read an email attachment in MS Outlook that comes through as winmail.dat file?  Is there a setting I can change to make any attachment I receive from someone who has Windows?  Thanks!

    Hope this helps.
    http://support.apple.com/kb/ht2614

  • How do I get my emails on the cloud

    How do I transfer my emails into the cloud?

    I have the same problem with the "me" account. If I change to "icloud" or "mac" the mails will received.

  • How do I delete multiple emails at the same time rather than individually?

    How do I delete multiple emails at the same time rather than individually?

    My mistake
    I was looking at my KB, even tested my suggestion with the command key, and then wrote option
    Barry

  • I changed my email address on one of my old APPLE accounts and want to merge my accounts together, how can I change my email address on my old Apple account?

    I changed my email address on one of my old APPLE accounts and want to merge my accounts together so I can get all my songs!!  My computer crashed and I'm tryng to change everything over to my mac via my ipod classic and just Transfer old files.  It's ejecting my disc (ipod) so I figured I could just change my old Apple ID to be one with my new one.
    how can I change my email address on my old Apple account?

    There is no way to merge two Apple IDs as all purchases made with each account are always tied to those accounts.
    All you can do to each account is change the email address for each one but they can't have the same email address.

  • How to find out which type of the driver is used in our application?

    Hi all,
    can anyone tell me how to find out which type of the driver is used in our application?
    Thanks in advance,
    Phoeniox

    Hi,
    Check out this...
    Class.forName("com.mysql.jdbc.Driver"); //if u r using MySql
    List drivers = Collections.list(DriverManager.getDrivers());
                   for(int i=0;i<drivers.size();i++)
                        Driver driver = (Driver)drivers.get(i);
                        String driverName = driver.getClass().getName();
                        System.out.println("Driver "+i+":::"+driverName);
    you need to load the driver and display in the same program.
    Then only you'l get the required result.
    prakhyath

  • How to find out who has deleted the production Query

    Hi All,
    I have searche SD , i can find it for infoobject deletion but i couldn't find it for Query.
    Please let me know is there any possiblity to kow
        How to find out who has deleted the production Query
    Awaiting for your replies.
    cheers

    Hi Mahesh and all,
    Thanks for all your  inputs.
    I have tried with RSRREPDIR tabel , I am unable to see that query at all.
    If I use theT-code SLG1,
      please guide me on the steps with paramets to be given in the respective ..object, subobject etc..
    OR
    could you please suggest any other way.
    cheers
    leena

  • How to find out who had deleted the function moldule? S O S

    how to find out who had deleted the function moldule Thank you very much.

    if this fm was assigned to device class (package) you'll find it in
    tables tadir, e070, e071
    try with name of function module or function group
    hope that helps
    Andreas

  • How do I get my email address recently changed on my account in iTunes on my MacBook Pro to show up on the sign-on notice on my iPad (4th gen)?

    How do I get my email address recently changed on my account in iTunes on my MacBook Pro to show up on the sign-on notice on my iPad (4th gen)?  It reflects my old email address and therefore won't recognize my password.  When I try to do something on the App Store on my iPad, it brings up a notice to sign on, which reflects the old email address, and rejects my password since the username/email address is no longer correct.  Puzzled!

    I have another question for the community.  My daughter tells me that my texts to her show my primary email address as the account name of the sender (me) when I text her, rather than my cell phone number from which I'm texting her.  I've had others report that to me too. How do I turn that off so that recipients see my cell phone number displayed as the sending party and not my email address?  Thanks - 

  • How to find out what are all the change pointers assoicated for an idoc ??

    Hi ,
    How to find out what are all the change pointers activated for an idoc ??
    Thanks,
    Varma

    Verma,
    You can check what are the active Change Pointers for the message type in tcode <b>BD50</b>
    Use tcode <b>BD61</b> to check whether change pointers are active or not??
    Hope this helps..

  • HT2731 I was ask for my secure question and they did not work. So I went into my account and tap on my secure question that I forgot my secure question. It replied back that it just sent me a email. The email never came. I did this three time. My email is

    I was ask for my secure question and they did not work. So I went into my account and tap on my secure question that I forgot my secure question. It replied back that it just sent me a email. The email never came. I did this three time. You have myy email as correct. I have check my account and it show as being correct.

    It's a really bad idea to post your email addresess - it's an invitation to spam - and I've asked the Hosts to remove them.
    This is a user-to-user forum and no-one on here can take any direct action. If your Yahoo address is not working that's something you would need to take up with Yahoo - have you checked it by sending yourself an email to it?
    Otherwise you will need to contact Support: go to https://expresslane.apple.com/ and click on 'iTunes' in the center column and then 'iTunes Store' in the right-hand column and proceed from there.

Maybe you are looking for