Automatic mail sending at good receipt

Hello friends
When a goods receipt against a PO (movement type 101) is done into any plant , an e-mail should be sent to ‘[email protected] ’ stating:
Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
Plz suggest how to do this.
what are the tables that can be used
wat are the fms that can be used etc
where this can be configuered,, or done thru ABAP

Hi,
1.create an enhancement project using enhancement number:MBCF0005..
in CMOD and in the below fuction module exit you can add you logic to send the mail.
<b>EXIT_SAPM07DR_001.</b> in INCLUDE ZXMBCU05 .
2.you can get all the required data in the MSEG table.
3. you can use the following fuction module to send the email.
'SO_NEW_DOCUMENT_ATT_SEND_API1'
below is the sample code..
REPORT ZPAVAN_EXAMPLE.
DATA: OBJPACK     LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
      OBJHEAD     LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
      OBJBINLIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
      OBJTXTLIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
      RECLISTLIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
      DOC_CHNGLIKE SODOCCHGI1,
      TAB_LINES LIKE SY-TABIX.
PARAMETER P_EADDR LIKE RECLIST-RECEIVER.    "EXTERNAL E-MAIL ADDRESS
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
DOC_CHNG-OBJ_DESCR = 'SEND EXTERNAL MAIL'.
OBJTXT = 'LINE 1 OF MESSAGE'.
APPEND OBJTXT.
OBJTXT = 'LINE 2 OF MESSAGE'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
RECLIST-RECEIVER = P_EADDR.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
     EXPORTING
          DOCUMENT_DATA              = DOC_CHNG
          PUT_IN_OUTBOX              = 'X'
     TABLES
          PACKING_LIST               = OBJPACK
          OBJECT_HEADER              = OBJHEAD
          CONTENTS_BIN               = OBJBIN
          CONTENTS_TXT               = OBJTXT
          RECEIVERS                  = RECLIST
     EXCEPTIONS
          TOO_MANY_RECEIVERS         = 1
          DOCUMENT_NOT_SENT          = 2
          OPERATION_NO_AUTHORIZATION = 3
          OTHERS                     = 4.
IF SY-SUBRC EQ 0.
  WRITE:/ 'E-MAIL MESSAGE SENT TO', P_EADDR.
ELSE.
  WRITE:/ 'COULD NOT SEND E-MAIL TO', P_EADDR.
ENDIF.
thanks and Regards,
Pavankumar

Similar Messages

  • Automatic mail sending for goods receipt

    Hello friends
    When a goods receipt against a PO (movement type 101) is done into any plant , an e-mail should be sent to ‘[email protected] ’ stating:
    Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
    Plz suggest how to do this.
    what are the tables that can be used
    wat are the fms that can be used etc
    where this can be configuered,, or done thru ABAP

    solved self. scheduled a backgound job. as no user exit and badi is available

  • Automatic Purchase Order upon Goods Receipt 101/161

    Hi Guys,
    Hope everyone is well. I would like to know in as simple terms as possible, what is the use of Automatic Purchase Order upon Goods Receipt mvt 101 or 161. Can someone explain to me the purpose of this? or applicable in which type of business scenario?
    Because i think, if it is upon Goods Issue, then it is understandable, you would want to top up the stocks, but upon GR? Why?
    This is a non configuration question, just a business process question..

    >
    Nazrin84 wrote:
    > Hi Guys,
    >
    > Hope everyone is well. I would like to know in as simple terms as possible, what is the use of Automatic Purchase Order upon Goods Receipt mvt 101 or 161. Can someone explain to me the purpose of this? or applicable in which type of business scenario?
    >
    > Because i think, if it is upon Goods Issue, then it is understandable, you would want to top up the stocks, but upon GR? Why?
    > This is a non configuration question, just a business process question..
    This process is used in case of emergency when stock is required in the plant and we dont have time to first create PO and then get its approval and follow the normal process. In the case of emergency, we tell the vendor to deliver the material and on receipt of this material we take it into the system through GR and the corresponding PO is automatically generated.
    Usually this is option available in system, but it depends on the clients requirement whether they want this option available to end users or not. Mostly our clients prefer not to have this option enabled, as this way can lead to irregularities by the users.
    So they prefer to follow the normal process, but this process for above scenario is followed on war footings that way the GR takes place immediately when Goods are received.

  • IDOC - Automatic Mail Sending

    Hi All,
    Basically I need to remove the automatic mail sending feature in the IDOC, please give me the solution, whether  it is standard functionality, or is there any user exit to avoid.
    If it is a Standard functionality then mention the Std. Program name or
    If it is from userexit then plz mention the Exit name.
    Thanks In Advance.

    think u need to check tcode swu3 for automatic workflow customizing and check in we40 (error AND STATUS PROCESSING) whether the processing code is assigned to the workflow task.
    if it is assigned,the workflow will be automatically triggered and the mail will be sent to the user by itself.
    ALE error handling uses workflow. A standard task is provided for each message type. Task TS20000051 is used for all BAPIs.
    Workflow functions as follows:
    A task (work item) is generated for the error handling and stored as a message in the inboxes of the employees responsible.
    If one of these employees processes the work item, the standard task method for error handling is started. The user can, for example, restart IDoc processing.
    If the IDoc is processed successfully, the work item is deleted from the inboxes of all the employees involved.
    For this procedure to function, the employees responsible for a particular message type and partner (sender or receiver) must be defined as follows:
    1. A hierarchy of organizational units (for example, "sales office") and positions (for example, "customer officer for customer X") is created and employees are assigned to it.
    2. The standard tasks for error handling (for example, an error related to an inbound sales order) are assigned to the relevant organizational units or positions (for example, "sales office").
    3. The organizational unit, position or employee responsible for dealing with the error are specified for each partner and message type in the partner profiles.
    If an error occurs, the system determines:
    1. The employees responsible using the staffing schedule of the organizational unit or position linked to the standard task.
    2. The employees defined in the partner profiles (using position, user ID, or organizational unit).
    3. The employees appearing in both groups represent those who will receive a work item in their inboxes.
    Please give me reward point If it is useful
    Thanks
    Murali Poli

  • Plz help : "AUTOMATIC" Mail sending

    Hey Friends
    Please see the word "automatic", as soon as user enters a good receipt in MB01 or MIGO, an automatic mail should be send to [email protected] stating:
    Material # XXXX quantity XXX has been received into Plant XXXX (field WERKS) Storage Location XXXX (field LGORT) and the date received in.
    Please tell me how to do this as automatic.
    i have found that data is stored in the MSEG table, but how to use it so that and automatic mail is send.
    Thanks

    Hi,
    To send an email please use this sample code:
    * Declarations.
    PARAMETERS: p_email(50) LOWER CASE.
    DATA: document_data LIKE sodocchgi1.
    DATA: t_content LIKE STANDARD TABLE OF solisti1.
    DATA: s_content LIKE solisti1.
    DATA: t_receivers LIKE STANDARD TABLE OF somlreci1.
    DATA: s_receivers LIKE somlreci1.
    START-OF-SELECTION.
    * Receivers.
    s_receivers-receiver = p_email.
    s_receivers-rec_type = 'U'.
    s_receivers-express = 'X'.
    APPEND s_receivers TO t_receivers.
    * Subject
    document_data-obj_descr = 'New mail from Sap'.
    * Body
    s_content = 'Hi,'.
    APPEND s_content TO t_content.
    CLEAR: s_content.
    APPEND s_content TO t_content.
    s_content = 'Test email from sap, please don''t reply to this email'.
    APPEND s_content TO t_content.
    CLEAR: s_content.
    APPEND s_content TO t_content.
    s_content = 'Thanks,'.
    APPEND s_content TO t_content.
    s_content = 'Naren.'.
    APPEND s_content TO t_content.
    * Send the email.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
    document_data = document_data
    TABLES
    object_content = t_content
    receivers = t_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 e208(00) WITH 'Error in sending email :-(('.
    ELSE.
    MESSAGE s208(00) WITH 'Email sent :-))'.
    ENDIF.
    SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
    In order to do it automaticly either:
    - create program which will read a table and look for new entries and schedule it SM36
    - use workflow (configure event handling)
    Regards,
    Wojciech

  • Automatic backorder scheduling upon goods receipt

    Hello,
    We need backorder scheduling to run automatically upon goods receipt.
    When material is received we need backorder scheduling (program SDV03V02) to run automatically so that the allocation of materials to sales orders is updated as soon as possible. We also need a list of
    sales orders that have been updated in this manner.      
    Steps for Reconstruction    
    Transaction code V_V2
    This transaction should be executed automatically when certain movement postings such as goods receipt are done in SAP.
    Does anyone know how this may be possible in standard SAP, or know a work around/solution for this question?  Please advise, and thank you.

    This might be possible with a workflow, but I'm not an expert on that.
    A workaround would be to schedule a background job to run V_V2 as frequently as necessary. This won't be as fast as "immediately", but normally 5-10 minute difference is not noticable to the users. To my knowledge, rescheduling program displays the messages in the job log, so you'll have the order numbers there.
    And, of course, there is always ABAP...

  • Java Mail Sending delivery/read receipts

    Hi
    I am using SMTP Protocol to send a mail... Is it possible to check if mail server is capable of sending delivery/read receipts.
    Please do reply me with your suggestions, how to handle it.
    Regards
    Subramanyam

    you need to set the message header "Disposition-Notification-To"
    to an email as in the following line of code
    msg.setHeader("Disposition-Notification-To", "<[email protected]>");

  • Automatic e-mail on initial Goods Receipt

    After we create a new product in SAP, we need a way to automatically e-mail a list of people only on the initial receipt of that item.  We do not want an e-mail to go out on following receipts.  Also, we would like the list to be specific to each plant that it is received into.
    Example: We create a new product in SAP and receive it into plant 1010 two weeks after it has been created.  We want SAP to e-mail three people in plant 1010 that the product is ready to sell.  We do not want them to be e-mailed anymore when that product is received again.
    Is SAP capable of this?

    Hi ,
    Though this is not the exact solution you are looking for , I suggest you to try activating missing part check for your plant , and use reservation for the initial procurement. If you do the correct settings in this , you can do  the customisation to get the mails to the MRP controler of the plant.
    Refer the URL for information on missing part check :
    http://help.sap.com/saphelp_47x200/helpdata/en/e1/8e51341a06084de10000009b38f83b/frameset.htm
    Hope this would serve your purpose.
    Regards
    raghuramam.

  • Automatic Mail Sending in Java/JSP/Servlets

    Hi,
    How to send mails with a specified format automatically after a stipulated no of days when the user does not access a file/page.
    TIA

    1. In your web application, have a database that keeps track of when a user accesses a page.
    2. Once a day, run a program that scans that database looking for cases when a user has not accessed a page for N days, or whatever your criterion is. Use JavaMail to send an e-mail message to each of those users.
    If you have specific questions about any of these things, don't hesitate to ask them in the appropriate forum.

  • Automatic mail sending freezes outlook 2013

    I have a brand new laptop with fresh installation of Office Home and Business 2013, and there is a problem i can't wrap my head around it.
    User takes his laptop home, writes 10+ mails and sends them, they lay down in outbox till tomorrow, where he comes to work, connects to network and then problems start to arise.
    Mails and attachments never exceed more than 1 or 2 mb's and its usually one at that size...
    Problem; user connects laptop to network and Outlook freezes for 15-30 minutes, later on unfreezes and mails are sent (it is sending them in freezed period), after that everything works just fine..
    I have reinstalled office, removed profile, checked for plugins there are none, problem still not resolved.
    Anyone has any idea?

    So no one has any idea, or maybe i used bad english, if so please ask i will clarify if missed something

  • ABAP Query Automatic mail send

    Dear ABAP Gurus,
    Is it possible for a query to build/fix a printer to a query?  When you run the query , it should send the layout to the person who run it in PDF format. How can it be done without any abap code?
    many thanks
    John Black

    Hi Prashantroy
    You can change the text of the notification e-mails as described in "Changing the Texts of Notification E-Mails".
    Refer to [Notification by E-Mail  |http://help.sap.com/saphelp_nw04/helpdata/en/89/c5fd430b63c74bbdfaa5f2ec9bb20b/content.htm]
    Hope it will helps
    Best Regards
    Arun Jaiswal

  • Standard Work Flow for Goods Receipt

    Hi All,
              I am working on Work flow is there any standard work flow for Goods Receipt?
    If so please help me in this regard.
    I found a BO BUS2017. Is this right one?
    Thanks.
    Ranganadh.

    hi,
    Refer to the link.
    Automatic mail sending for goods receipt
    Regards
    Sumit Agarwal

  • Goods Receipt message (external send)

    Hi,
    I am trying to implement the GR message notification functions to Buyers who created the PO.
    I made a copy of MLGR and i am testing it in MB02. It seems to work fine with SAPoffice but i am unable to get any message when i chose the external send option. Which program and form rutine should i use? and also i'm using ME partner function.
    Thanks in advance ,
    Regards,
    Pablo

    Srinivas,
          Thanks for your help, but i already tested this program and rutine. This program only works fine for SAPOFFICE, and i need to configure the external send (MS Outlook), so as to send a mail when a goods receipt is done. 
    Regards,
    Pablo

  • Error in getting APO in goods receipt

    Hi Guys,
       I was trying to get Automatic Purchase order in Goods Receipt with transaction code OMJJ
       in OMJJ I try to copy 101 to my own desired Movement type 222  and then I created info record using
       ME11.In next process when i do MB01 transaction process i get the error  Goods movement not possible with mvmt type 222. What can be done to rectify the error?
    Regards
    Jino.

    Hi,
    In OMJJ transaction code i couldnt able to copy the 101 to my desired movement code.
    for eg: if I copy Mvtype from 101 to 251(my desired movement type). the new Mvtype 251 is not getting saved,Can I able to  know the steps in OMJJ??? becos once after the OMJJ process when I check in
    Mvtype column in transaction code MB01 there is no newly Mvtype (251) created is show.
    Regards
    Jino.

  • Import of bulk serial numbers with Goods Receipt

    Hello
    I need to create an Add-On that automates the creation of Goods Receipt PO documents with linked serial numbers. Using the DI API I manage to create the Goods Receipt and link about 1000 serial numbers to one document without any problems. When the item qty (and linked serial number qty) goes beyond 10,000 it crashes (probably runs out of memory).
    I know an alternative would be possibly using the DI Server. Has anyone ever done this with such big volumes? Not sure if the DI Server would be able to handle say 100,000 serial numbers, at a time.
    Any advice is appreciated.
    Thanks,
    Jéan

    Thanks Gordon.
    This is not good news. I am just concerned as the SDK help on DI Server specifically states:
    "Business partners can use the DI Server for the following main scenarios:
    ==>> Heavy duty operations, such as batch"
    I assume this is the same type of "heavy duty operation" as a data take-on would be? Or does it mean that B1's serial number management is limited to small quantities at a time.
    Jéan

Maybe you are looking for

  • Regarding File Adapters

    Hello    I am working on File Adapters and would like to know as to how do you go about specifying the record substructure when you select the File Content Conversion in the Message Protocol of the Adapter configuration.I went through the help conten

  • Answering a second call

    On a few of occasions, I have had a second call coming through, I try to end the first call and answer the second except, that button is cleverly placed directly over the hangup button. The person on the first call has inevitably hung up before I cou

  • MSI KT3 ULTRA2-C and AGP compatibility

    Hi, I'm just about to buy a new motherboard these days, MSI KT3 ULTRA2-C, with an XP 2000/2000+ and memory, but not a new video card, since i can't afford it right now. I only have an AGP Creative 3D Blaster Banshee 16 MB, but it is a 3.3v agp card (

  • WiFI/Phone simultaneous use on a v1 hardware/v2.0 clean software load

    Symptoms: On a call using the phone part of the iPhone. Turn on/Connect to wifi. Shows full signal/3 'arcs'. I go to connect. It seems to start connecting/downloading, then switches to look like it wants to [and tries to] access edge. WiFi drops to 1

  • Audio Delayed When Exporting To Camera

    When exporting the movie to my camera, the audio is not quite synced with the video on the Mini-DV tape. I have determined the offset to be about 8 frames. If I then import that video, extract the audio, and then move it to the left 8 frames, it is t