Wdabap auto mail sending

Hi
i have requirement like this employee can change the emergency details online like phone num etc. when he upteted his details the auto mail should go to hr.
to send a mail how to write the logic.
can anybody help me.
Thanks in advance
Revathi

Hi kavitha,
Please refer following code .I have used jung's blog for this and its running very well.Here if you wil see the code i am sending an internal table in ecel format on an email id with some message.
DATA: l_text1  TYPE char255. " Text
  DATA: l_lines TYPE i,
        l_size  TYPE  sood-objlen. " Size of Attachment
  DATA lo_message_manager    TYPE REF TO if_wd_message_manager.
  DATA lo_api_controller     TYPE REF TO if_wd_controller.
  lo_api_controller ?= wd_this->wd_get_api( ).
  lo_message_manager = lo_api_controller->get_message_manager( ).
* Mail related
  DATA: i_content TYPE   soli_tab, " Mail content
        i_attach  TYPE   soli_tab. " Attachment
  DATA: l_send_request    TYPE REF TO    cl_bcs,  " E-Mail Send Request
        l_document        TYPE REF TO    cl_document_bcs,  " E-Mail Attachment
        l_recipient       TYPE REF TO    if_recipient_bcs, " Distribution List
        l_sender          TYPE REF TO    if_sender_bcs,  " Address of Sender
        l_uname           TYPE           salrtdrcpt,  " Sender Name(SY-UNAME)
        l_bcs_exception   TYPE REF TO    cx_document_bcs, " BCS Exception
        l_addr_exception  TYPE REF TO    cx_address_bcs,  " Address Exception
        l_send_exception  TYPE REF TO    cx_send_req_bcs. " E-Mail sending Exception
*        l_SO_OBJECT_MIME_GET type ref to SO_OBJECT_MIME_GET.
  DATA: l_recipient_soos  TYPE  soos1.
  DATA: lv_i_with_error_screen TYPE os_boolean.
  DATA: lv_result TYPE os_boolean.
  CONSTANTS: c_tab(1) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,  " Tab Character
             c_cr(1)  TYPE c VALUE cl_abap_char_utilities=>cr_lf, " Line Feed for End-Of_line
             c_ext    TYPE soodk-objtp VALUE 'XLS'. " XLS Extension
  DATA p_uname TYPE so_dir_ext .
  p_uname = 'sumit.goenka -avaya.co.in'.
* Preparing body of the Mail
  MOVE 'Please execute the trade given in the attached excel file' TO l_text1.
  APPEND l_text1 TO i_content.
  MOVE '' TO l_text1.
  APPEND l_text1 TO i_content.
  MOVE '' TO l_text1.
  APPEND l_text1 TO i_content.
  MOVE 'Warm Regards SAP' TO  l_text1.
  APPEND l_text1 TO i_content.
* Preparing contents of attachment with Change Log
  FIELD-SYMBOLS: <lfs_table> TYPE ANY,    " Internal table structure
                 <lfs_con> TYPE ANY.      " Field Content
  DATA: l_text TYPE char1024.    " Text content for mail attachment
  DATA: l_con(50) TYPE c.        " Field Content in character format
* Columns to be tab delimeted
  LOOP AT detail ASSIGNING <lfs_table>.
    DO.
      ASSIGN COMPONENT sy-index OF STRUCTURE <lfs_table>
             TO <lfs_con>.
      IF sy-subrc NE 0.
        CONCATENATE c_cr l_text INTO l_text.
        APPEND l_text TO i_attach.
        EXIT.
      ELSE.
        CLEAR: l_con.
        MOVE <lfs_con> TO l_con.
        CONDENSE l_con.
        IF sy-index = 1.
          CLEAR: l_text.
          MOVE l_con TO l_text.
        ELSE.
          CONCATENATE l_text l_con INTO l_text
             SEPARATED BY c_tab.
        ENDIF.
      ENDIF.
    ENDDO.
  ENDLOOP.
* Creates persistent send request
  TRY.
      l_send_request = cl_bcs=>create_persistent( ).
* Creating Document
      l_document = cl_document_bcs=>create_document(
                                    i_type  = 'RAW'
                                    i_text  = i_content[]
                                    i_subject = 'Buy / Sell Order' ).
      DESCRIBE TABLE detail LINES l_lines.
* Size to multiplied by 2 for UNICODE enabled systems
      l_size = l_lines * 2 * 255.
* Adding Attachment
      CALL METHOD l_document->add_attachment
        EXPORTING
          i_attachment_type    = c_ext
          i_attachment_size    = l_size
          i_attachment_subject = 'Buy Sell Order Detail'
          i_att_content_text   = i_attach[].
* Add document to send request
      CALL METHOD l_send_request->set_document( l_document ).
* Get Sender Object
      l_uname = sy-uname.
      l_sender = cl_sapuser_bcs=>create( l_uname ).
      CALL METHOD l_send_request->set_sender
        EXPORTING
          i_sender = l_sender.
* E-Mail
      TRANSLATE p_uname TO UPPER CASE.
      l_recipient_soos-recesc = 'U'.
      l_recipient_soos-recextnam = p_uname.
* Preparing recepient from SAP Logon Name
      CALL METHOD cl_send_request_bcs=>create_recipient_from_soos1
        EXPORTING
          i_soos1 = l_recipient_soos
        RECEIVING
          result  = l_recipient.
* Add Recipient
      CALL METHOD l_send_request->add_recipient
        EXPORTING
          i_recipient  = l_recipient
          i_express    = 'U'
          i_copy       = ' '
          i_blind_copy = ' '
          i_no_forward = ' '.
*Trigger E-Mail immediately
      l_send_request->set_send_immediately( 'X' ).
      CALL METHOD l_send_request->send( lv_result ).
      IF lv_result IS INITIAL.
*       *    report message
        CALL METHOD lo_message_manager->REPORT_SUCCESS
          EXPORTING
            message_text = 'Mail sent successfully '.
      ENDIF.                                                              .
      COMMIT WORK.
    CATCH cx_document_bcs INTO l_bcs_exception.
    CATCH cx_send_req_bcs INTO l_send_exception.
    CATCH cx_address_bcs  INTO l_addr_exception.
  ENDTRY.
If you have any doubt then feel free to ask.
regards
PG

Similar Messages

  • Auto mail sending

    Hi Gurus, Please see the below scenario and reply. We have create a zreport for PM order Compliance report calculating that is order type or work center wise, including that client required the list of order Auto mail sent to particular recipient when we execute the z program, So now Abaper ask me pls provide the FS like table name and field name. Please suggest how can i solve this issue ? give some idea to provide the Fs. Best Rajeev

    I just know we can do it by shell scripting.
    Please let me know how to do this and how should I define a concurrent program for that, so as to call it in my script with parameters.\Why shell scripting and define a concurrent program for it if you can do it via PL/SQL? Please see these links for details.
    http://forums.oracle.com/forums/search.jspa?threadID=&q=UTL_SMTP&objID=c84&dateRange=all&userID=&numResults=15&rankBy=10001
    http://forums.oracle.com/forums/search.jspa?threadID=&q=UTL_MAIL&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Incomming Inspection Auto mail if Rejected

    Hi Experts,
    During incoming inspection if characteristics are rejected and UD Code will be selected  as "R",  requirement is auto mail sending option should be there which is having all rejected characteristics detail.
    We can send this mail through std sap mail but this results detail functionality not available in this mail.
    Kindly suggest me how can I configure this mail and which functional module it ill work so that I can send all characteristics  results will be send through sap mail.
    As per my assumption one functional module need to be activate and which is having functionality of inspection report detail.
    When UD Code "R" Selected system will send this report to predefined users.
    Guide me on this issue
    1) Which Functional Module suitable for this
    2) Is it possible we can send Result detail
    3) Where I have to define the user names so that system will send automatically (EX, Puchase Deprt Head, Planning and Engineering Dept users)
    Thanks
    Shiva Patil

    Dear Shiva
    I have this functionality created when the material is rejected through Alert management. My settings are as follows
    1) A function module is created which consists of all the datas pertaining to the inspection lot. This alert goes based on the roles. So we have defined in this program which all roles this mail has to go. When rejection happens the mail will go the derived roles for the particalur plant
    This FM works based on the Alert management functionality
    2) I have added this function module under the follow up action in the selected codes
    3) when material is rejected follow up action triggers automatic mail to LN
    Regards
    Gajesh

  • Send Auto mail to Vendors for Pending Delivery of Purchase orders

    Hi Gurus,
    I want to send an Auto Mail to my vendors according to their products as a reminder for the delivery of items of Purchase Order .
    Please give the configuration changes required for the same
    Thanks a lot in Advance
    Sam

    the message determination has to be customized, and the purchasing value key should have reminder days.
    everything else is master data maintenance (material master, info record, message conditions)
    http://help.sap.com/saphelp_erp60_sp/helpdata/en/6a/c1041badb111d1b6120000e8a738dc/frameset.htm

  • SAP BP Master data amendment to send Auto mail to customer to inform the changes

    Hi,
    Need advise for my requirement to send an auto mail to customer whenever any amendment is made on customer data. As i read in SAP help there are some standard workflows which will help to perform this task. Names of Standard workflows.
    Need urgent help???
    Regards
    Ahmedii

    Hi,
    apparently there's a worfklow wizard for approval, check this sap help link:
    <a href="http://help.sap.com/saphelp_47x200/helpdata/en/8d/25fd14454311d189430000e829fbbd/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/8d/25fd14454311d189430000e829fbbd/frameset.htm</a>
    And an approval workflow is present in the tutorial as well:
    <a href="http://help.sap.com/saphelp_47x200/helpdata/en/fb/135983457311d189440000e829fbbd/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/fb/135983457311d189440000e829fbbd/frameset.htm</a>
    kind regards, Rob Dielemans

  • Problem in Auto Mail of ALV Report :  Urgent

    Hello All ,
    I have created one ALV Report contain 240 Columns . This report is need to schedule for auto mail in HTML Format.
    My Problem is when I am sending this report manually the html output displays all the columns in the mail attachment.  While it is scheduled thro' SM36 in background mode the HTML format displays only restricted columns (say upto 132 columns)
    Also, we have tried to create new page format  X_65_512/2 to accomodate the output.  However this option did not work.
    Any solution to resolve the same is most welcome !
    Regards
    Swati Namdeo

    Hi
       This problem was not resolved. I tried few things but not good. So what we did we created a few profile like MM/SD/FICA and we executed report based on profile and sent them only the column relevant to them.
    Regards,
    Atul Joshi

  • Auto mail of RFQ to vendor with attachment

    Hi experts
    We are using auto mail of RFQ (ME9A) functionality through which a pdf file (as attachment) is emailed to the vendor's email address. I want to send one more attachment (for eg. a JPG file) in same mail along with the RFQ document. Please help how the same can be done
    thanks in advance

    Hi Rajat,
    I think maybe you need to use tr-code "NACE".
    1. Choose Application "EA" (Purchasing RFQ)
    2.Click "Output types" or press "F5"
    3.Choose Output Types "NEU" (RFQ)
    4.Click "Processing routines" to check whether below red part are have forms.
    If not have, I think you may need to copy program "SAPFM06P" to a z* program and change the form name here as z* and add your PDF forms here.
    Regards

  • Infotype 41 auto mail

    Hi experts,
    I hv configured infotype 41 and in the date type i mentioned the type of activity performed. is there any customization or development that can be done for auto mail generation, when an employee completes his training/probation date that is defined in infotype 41.

    Hi,
    This can be done via an ABAP program.
    We've done this for 19 Infotype.
    The program runs every night (it is tied to a job) and lists all the IT 19 records that has current date. And then sends this list as mail to the related person.
    Best regards,
    Dilek

  • Auto Mail configuration problem in produduction server

    Dear Sir,
    I have configured manual mail send configuration in sap through transaction code scot .
    I want sap report should be autogenerated and auto send it on the reuired consultant /vendor email addresses .
    I had tried to schedule one report through background job but its not working ..
    Wating for your reply

    Problem is that I cannot imagine any forum which would want to have this question, again... and again...and again...and again...and again...and again...and again...and again...and again...and again...and again...and again...
    @ Rohit: What was it that prevented you from using the search to see whether anyone has tried to do this before you and found an answer? Was it something we did wrong?
    Cheers,
    Julius

  • Auto mail to vendor after GRN and Invoicing

    I need to work for my client in MM who needs a automail to vendor after GRN and Invoicing , kindly help  to know the procedure for Auto mail generation to Vendor or a work flow so that i can work with ABAP team just needed a flow.

    For Mail to Vendor after MIRO transaction, Please proceed as follows
    Go to NACE t code,
    Select MR for Invoice verification
    Create New output type by copying Invoice print out put type and set transmission medium 5 for external send
    Assign Program, processing routines. Set partner function VN-Vendor
    Maintain new output type to Message schema MR0002- MM-LIV- Message Determination.
    With the hep of basis do setting in SCOT tcode
    Create condition record in NACE for this output type
    You can send e-mail by MR90 tcode
    For Mail to Vendor after MIGO transaction,
    i think you have to go for the custom development since SAP don't have functionality of GR message to external send
    You may use badi- MB_DOCUMENT_BADI

  • Auto mail alert on ID lock

    Hi All,
    I am looking to send auto mail alerts to user when the ID is locked due to incorrect logon attempts or advance mail alert if the ID is about to expire in couple of days.....I was expecting that SAP ECC provides standard way to deal with this as any other application....
    It so happens that the user comes to know about the ID expiration on the day when he tries to logon and the pain going through support process waiting for day to get it resolved.......There should be proactive way to deal with this kind of situation so that the user is alerted in advance without causing business impact waiting for it to be resolved...
    Any suggestions on how this can be achieve???
    Regards,
    Milan

    There is nothing in standard, but it is very easy to implement on your own if you need it. I also found a way to lock / unlock in intervals (try the factory calendar...) and the user BAPI's can do just about anything which SU01 can do as well.
    A downside to that which you are attempting is that a mail alert to tell someone that their password has been locked or is about to be locked would "trigger" them to logon only for the purpose of keeping the account alive. Some people do this anyway and is the wrong motivation for a person to keep their user ID in the system. So your users will start appearing to be more active, where in fact they are not actually using the system.
    If for your levels of user activity and intervals (e.g. quarterly planning) the policy is too strict, then you can either relax the policy or use user groups to isolate one of them as an execption.
    There was at least one question asked before which provided many details on how and why to do this. Just make a simple search.
    Cheers,
    Julius
    > Total Questions:  46 (42 unresolved) 
    Please clean up your neglected questions. The "Comment" field is not mandatory when closing a thread (to avoid bumping all ancient irrelevant questions to the top of the forum again).

  • I want to don't send to original mail sender for over quota

    Dear all.
    an messages deliver to first receiver
    and first receiver forwarding message second receiver by auto mail forwarding.
    So, if second receiver on mailbox over quota, bounce message deliver to first receiver and original sender.
    In this case, original sender want to don't receive over quota message.
    How to configure for this case.
    Thank you~

    bssong wrote:
    an messages deliver to first receiver
    and first receiver forwarding message second receiver by auto mail forwarding.
    So, if second receiver on mailbox over quota, bounce message deliver to first receiver and original sender.Are you sure it is delivered to the 'first receiver' as well as the original sender?
    In this case, original sender want to don't receive over quota message.
    How to configure for this case.If you are using the mailforwardingaddress: method of forwarding, then the original envelope sender address will remain, therefore the original sender will get bounces.
    If you have the most recent Messaging Server 6.3 patch installed you could use the sieve redirect :resetmailfrom parameter which will cause the envelope sender address to be reset to the current sieve owner. That way bounces go to the sieve owner.
    Regards,
    Shane.

  • Purchage Order Auto Mail

    Hi All,
    my requirement is..........
    As we save PO an automatic mail message for CRM PLAN is going to all customers which is define under message tab with zaut output type.....
    As by any means IF the same time mother/feeder vessel schedule is changed and the respective user update this change in
    SAME PO(ME22N).......
    AS THE user AGAIN SAVE THIS PO now this time the crm plain send will be change as it carries the change one schedule
    but inplace of that it send the previous one....
    I want when the second time the user chnage the schedule in me22n and save than the change one CRM PLAN will send by auto mail........
    please give me the correct solution for this sao problem....
    thanks
    rahul

    Hi,
    Check the ZAUT output driver prgrm where you need to handle for the change PO also.
    Regards,
    Aditya

  • Alert Auto mail generate

    In oracle R12 auto mail generation possible actually I want to automatically mail send to desired address with the specific report on given time period

    Please refer:
    Concurrent Processing - How to Configure the Concurrent Request Output Option for Notifications by Email . [ID 456925.1]
    https://forums.oracle.com/forums/search.jspa?threadID=&q=Send+Email+Concurrent+Output&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    regards,

  • Order Entry Auto mail to Party

    hi,
    Can We send a Auto Mail at the Time of Order Booking.

    Hi,
    You can make alert in system to send you an email for booked sales orders.

Maybe you are looking for

  • My matched songs in iTunes on my computer show the artists, but some do not show up on my iPad or iPhone?

    My matched songs in iTunes on my computer show all the artists, but most artists do not show up in Music on my iPad or iPhone? I recently fixed the song titles coming back from Match update changed to Track ** by going thru every song's info (command

  • Error when changing a Company Code for a given Cost Center

    Hello Friends ,                          I'm trying to modify a company code value for a given cost center in KS02 and I get the below error. The error message receommends to change the analysis period ( not sure what it is..) but when I click edit >

  • FI Report showing Discount amount before posting a Document

    We are paying Vendor's invoices.  While creating document, we enter Discount base amount and payment terms. Discount amount appears only after document is posted.  Is there any way I can print/display discount amount before posting the document? Than

  • Changing tthe url of application developed by HTMLDB

    Hi all, I have developed an application using htmldb. I have this htmldb in windows environment. Right now i am using url as http://localhost:7777/pls/htmldb/f?p=107:101 now i want to change the url some http://site1.xyz.com i have tried by putting f

  • Financing options and reward points

    I must admit I was caught offguard when I bought my dad an ipad a couple of weeks ago on the special financing option and did not receive my points. I was confused but after doing some research I saw Best Buy changed their policy last July.  It didn'