End user receving same mail , twice in a day .

Hi,
Throu this report , i am sending mail to a user. I the scheuld this program as background job.
But My problem is end user receving same mail twice a day.I am sure , Program is executed onces in day.
Plz help me to solve the problem
REPORT  zplm008_tdr_mail_alert        .
*DATA DECLARATION.
DATA: it_ztdr TYPE TABLE OF ztdr WITH HEADER LINE.
DATA  wa_maktx TYPE makt-maktx..
*SELECTION SCREEN
PARAMETER: p_date TYPE sy-datum DEFAULT sy-datum MODIF ID dat .
*START-OF-SELECTION
START-OF-SELECTION.
  SELECT * FROM  ztdr INTO TABLE it_ztdr
         WHERE  rlddt  = p_date.
  IF it_ztdr[] IS NOT INITIAL.
    LOOP AT it_ztdr.
      PERFORM send_mail.
    ENDLOOP.
  ENDIF.
*&      Form  SEND_MAIL
      text
-->  p1        text
<--  p2        text
FORM send_mail .
  DATA: lt_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                   WITH HEADER LINE.
  DATA:   ls_message TYPE char255.
  DATA: lt_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
        lt_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
        lt_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
        lt_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
        gf_cnt TYPE i,
        gf_sent_all(1) TYPE c,
        gs_doc_data LIKE sodocchgi1,
        gf_error TYPE sy-subrc.
      Adds text to email text table
  lt_message = 'Hi,'.
  APPEND lt_message.CLEAR lt_message.APPEND lt_message.
  lt_message = 'Requested design is released. Pls raise the TPR (If required to be ordered).'.
  APPEND lt_message.CLEAR: lt_message.APPEND lt_message.
  lt_message = 'Details of the released design:'. APPEND lt_message.
  lt_message = '*******************************'.APPEND lt_message.CLEAR: lt_message.APPEND lt_message.
  MOVE : 'TDR No '  TO lt_message.
  lt_message+21(1) = ':'.
  lt_message+22(40) = it_ztdr-tdrid   .APPEND lt_message.
  MOVE  : 'PED Part no '  TO lt_message.
  lt_message+21(1) = ':'.
  lt_message+22(40) = it_ztdr-matnr.
  APPEND lt_message.
  CLEAR: wa_maktx.
  SELECT SINGLE maktx FROM makt INTO  wa_maktx WHERE matnr = it_ztdr-matnr.
  MOVE 'PED Part Description' TO lt_message.
  lt_message+21(1) = ':'.
  lt_message+22(40) = wa_maktx   .APPEND lt_message.
  MOVE : 'PED Part Rev no' TO lt_message .
  lt_message+21(1) = ':'.
  lt_message+22(40) = it_ztdr-matnr_rv .APPEND lt_message.
  MOVE: 'Rnd part No  ' TO lt_message .
  lt_message+21(1) = ':'.
  lt_message+22(40) = it_ztdr-ref_matnr . APPEND lt_message.
  MOVE : 'Rnd Part Rev '  TO lt_message .
  lt_message+21(1) = ':'.
  lt_message+22(40) = it_ztdr-ref_matnr_rv .APPEND lt_message.
  CLEAR: lt_message.
  APPEND lt_message.
  APPEND lt_message.
  lt_message = 'To View the Design:'.
  APPEND lt_message.
  lt_message = '*******************'.APPEND lt_message.
  CLEAR: lt_message.
  APPEND lt_message.
  lt_message ='For Standard gauge, use Transaction: ZPED_TOOLPRINT'.
  APPEND lt_message.
  lt_message ='For Non-Standard gauge, use Transaction:  ZCV04N or CV04N'.
  APPEND lt_message.
*Send email message, although is not sent from SAP until mail send
*program has been executed(rsconn01)
Fill the document data.
  gs_doc_data-doc_size = 1.
  DATA subject TYPE string.
  CONCATENATE 'Design Released for'  it_ztdr-tdrid  'of'  it_ztdr-ref_matnr
        INTO subject SEPARATED BY space.
Populate the subject/generic message attributes
  gs_doc_data-obj_langu = sy-langu.
  gs_doc_data-obj_name  = 'TDREQ'.
  gs_doc_data-obj_descr = subject .
  gs_doc_data-sensitivty = 'O'.
Describe the body of the message
  CLEAR lt_packing_list.
  REFRESH lt_packing_list.
  lt_packing_list-transf_bin = space.
  lt_packing_list-head_start = 1.
  lt_packing_list-head_num = 0.
  lt_packing_list-body_start = 1.
  DESCRIBE TABLE lt_message LINES lt_packing_list-body_num.
  lt_packing_list-doc_type = 'RAW'.
  APPEND lt_packing_list.
  CLEAR lt_receivers.
  REFRESH lt_receivers.
Add the recipients email address
For SAP mail
IF NOT GSCR_UNAME IS INITIAL.
  lt_receivers-receiver = it_ztdr-reqnm.
  lt_receivers-rec_type = 'U'.
  APPEND lt_receivers.
ENDIF.
For external mail
IF NOT gs_outtab-reqnm IS INITIAL.
   lt_receivers-receiver = gs_outtab-reqnm.
   lt_receivers-rec_type = 'U'.
   APPEND lt_receivers.
ENDIF.
Call the FM to post the message to SAPMAIL
  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
      document_data              = gs_doc_data
      put_in_outbox              = 'X'
      commit_work                = 'X'
    IMPORTING
      sent_to_all                = gf_sent_all
    TABLES
      packing_list               = lt_packing_list
      contents_txt               = lt_message
      receivers                  = lt_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.
Store function module return code
  gf_error = sy-subrc.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
Get lt_receivers return code
  LOOP AT lt_receivers.
  ENDLOOP.
  PERFORM initiate_mail_execute_program.
    CLEAR:lt_message[] , lt_message , gs_doc_data ,gf_sent_all,lt_packing_list[]
    ,lt_packing_list ,lt_receivers[], lt_receivers.
ENDFORM.                    " SEND_MAIL
*&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
      text
-->  p1        text
<--  p2        text
FORM initiate_mail_execute_program .
  WAIT UP TO 2 SECONDS.
  SUBMIT rsconn01 WITH mode = 'INT'
                WITH output = 'X'
                AND RETURN.
ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM

Hi,
In your code
You are looping the perform in which you are calling below FM.
LOOP AT it_ztdr.
   PERFORM send_mail.
ENDLOOP.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gs_doc_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = gf_sent_all
TABLES
packing_list = lt_packing_list
contents_txt = lt_message
receivers = lt_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.
So keep your FM after the loop.
Pls. reward if useful...

Similar Messages

  • End user cannot e-mail to most people... 550 error.

    I have an end user that reported to me that she hasn't been able to e-mail to some of her contacts for almost a year now. When I questioned what she was doing and see here is what I got.
    She uses WebAccess to manage e-mail. When she tries to send e-mail to contacts both inside and outside the district the other end user never gets said e-mail. She states she doesn't get an error or anything. When I have her demonstrate the process I notice that she gets a lot of "Save as Draft" when she presses the send button. I am still trying to figure out how to resolve that issue. She stated this started happening on her home (Personal) desktop but is now happening on her work laptop as well. She stated she was able to send e-mail using her phone.
    When I e-mailed her the first time I received an error from the MTA stating "550 A proper RFC822/2822 address must be given." I ran a GWCHeck reindex/fix against this account and it reported errors as well as fixed them. I was able to get her to e-mail to me using her laptop after that but she is still stating her home desktop isn't working. I can't find much regarding this specific error as stated. I did send her a response asking her to delete all contacts in Frequent Contacts and try to e-mail me again to see if she has issues with that. I am still waiting on a response for this.
    Anyone have an idea on how to resolve this?
    Thanks
    Richard

    In article <[email protected]>, Rhuhman wrote:
    > I have an end user that reported to me that she hasn't been able to
    > e-mail to some of her contacts for almost a year now.
    >
    Clearing the frequent contact list and the GWCheck are good starts.
    Do subsequent GWChecks for this user come clean now? Sometimes the
    errors it says it clears needs some additional prodding to fully clear.
    Do you run regular GWChecks for the whole PostOffice? I usually aim for
    Structure Fix daily, and Contents Fix weekly. Checking those logs for
    this user may assist. http://www.konecnyad.ca/andyk/gwlogs.htm
    It would also be worth following a particular message with the user. Is
    the address actually accurate, what does the Properties of the sent
    item show, what messages does GWIA give about the message?
    If needed, there is message tracking that can be turned on to track the
    message through POA to MTA to MTA to GWIA.
    Andy Konecny
    Knowledge Partner (voluntary SysOp)
    KonecnyConsulting.ca in Toronto
    Andy's Profile: http://forums.novell.com/member.php?userid=75037

  • User receiving two mails for a single shc to approve

    Dear Experts,
    we have a scenario in which same user exists in 2 purchase organizations , one as virtual user, however when a shc created from purchorg1, user receives approval mail twice which shouldn't happen.When a shc created and approved, po created, would it be possible to change the shc as we receive 'system status is active' ,although found a note but still need confirmation to apply the same for SRM5.0 version.Please advice me on how to trace the workflow approval chain in srm for shc and the approvers involved also on deletion of assignment of virtual user.
    Thanks and Regards,
    Sathya Kumar.

    substitution error.

  • Workflow sends the same email twice

    I created in Sharepoint Designer a workflow to send an email when a new item is created, but i recieve the same mail twice at the same time. Can somebody help me?
    workflow:
    email Lukas Kuypers
    then add 30 days to today (save in variable datum)
    then pause to variable datum
    then delete current item
    then stop workflow

    Hi,
    Per my understanding, a custom SharePoint Designer workflow send an email twice when there is only one send email action in it.
    A possible reason is that the workflow has been triggered twice. Sometimes, due to the performance issue of the SharePoint Server, even after a workflow instance is
    finished, the item submitting is still during processing which triggers another workflow instance and send the second email again.
    As a workaround, you can add one step at the end of your workflow to pause the workflow for a few minutes for a test.
    A link about the similar issue with explanation in details for your reference:
    https://sharepointnomad.wordpress.com/tag/duplicate-notifications/
    Feel free to reply if there is any progress.
    Thanks 
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Prevent end-user doubleclicking buttons

    EHLO
    Anyone experienced this?
    There are certain checks needed for buttons which trigger inserts to tables. If the response is slow and the page redirects on the same page after submit the end-user might press submit twice or even more eagerly. Such might lead then cumbersome situations where the data is inserted several times etc..
    The checking can of course be done by writing certain conditions e.g. selects to the table etc.. but is there better way to do this?
    How-about having prevent-doubleclick-checkbox for the button and then have actually 3-statuses
    - working - and there custom message for the eager pusher
    - success
    - failure
    /paavo

    Hiya
    We're having big problems at the moment with our users double clicking and gettting oracle errors (because we do not allow duplicate rows in the tables).
    I've tried your suggestion using a HTML button and inserting the Javascript to disable the button once it's been clicked, and this works great.
    However I was wondering if there is something similar I could use for the Template Based Buttons (rather than HTML) as these have been used throughout our applications. I have tried the javascript method, but this doesnt seem to work.
    Many Thanks in advance.
    Natalie.

  • How to enter the same cell twice in a formula

    I am studying environmental engineering. we have a lot of complicated formulas that are long chains. In these formulas I need to reference the same cell many times , the problem is when I click on the cell again all it does is rehighlight that cell earlier in the equation. When I do this in excell it works fine. If i type the cell in it works but this can be a hassle. I like working in Iwork because the charts and graphs are nicer but I seem to be finding that some items like this, goal seek, and the fact that you can not extend a polynomiel function forward and back excell is much better than Iwork.

    Same question twice in one day. Hold down the command key when selecting it the second time.

  • How to Use the same iview for both KM End User and the KM Administrator

    Hi friends,
    *This is my scenario :* How to Use the same iview for both KM End User and the KM Administrator but with different Context
    Menu Options.
    i followed these steps but im getting same context menu for both KM End User and the KM Administrator .
    Assign the role Content Administrator to the user km_admin. This is needed so that km_admin can change
    the presentation settings for the KM Folder u201EReports_kmFolder‟.
    Now, login with user km_admin. Navigate to the Km Folder reports_kmFolder through Content Administration
    -> Km Content. Click on Details link of the folder reports_kmFolder.
    Go To Settings -> Presentation. Click on the tab u201ESettings for You‟-> Click on button u201ESelect Profile‟.
    Select the radio button corresponding to u201Elayout Set‟, and choose u201EConsumerExplorer‟ from the dropdown.
    Click u201EOK‟.
    Select both the check boxes corresponding to Items Affected as shown above, and click u201ESave‟
    Now, remove the u201ESuper Administrator‟ role from the user km_admin and login with this user.
    How rto resolve this????
    Regards,
    Prasad.

    Hello Prasad,
    Most likely the user km_admin still has system principal roles assigned, even though you removed the Super Admin role, you should check that this user doesn't have any other admin roles, otherwise it will be considered a System Principal user and will therefore still have access to all content. For more information see http://help.sap.com/saphelp_nw70/helpdata/en/19/56f28fbd4e11d5993b00508b6b8b11/frameset.htm
    Try creating a new user with just read access to the content and you should see that it will not be able to make any changes etc.
    Regards,
    Lorcan.

  • After changing a mail list name in Server end, users can't see the update in outlook client

    Dear all,
    This is a real issue. I am a Help-desk in a global company and after changing a mail list name in Server end, users can't see the update in outlook client. Even I download Offline address book in full detail, user still can't see the change in her outlook.
    Does anyone know how to fix it?
    Thanks,
    Franklin hong

    Hi,
    Would you please detail what you did by "changing a mail list name in Server end"? What is the mail list and what server?
    If you switch to Online Mode instead of Cached Exchange Mode, does the user see the change?
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • I tried to download a form from my doctor's office and got a message that I had to install adobe reader, accept the end-user agreement agreement, quit and relaunch. I did all that to my best understanding of those words but still saw nothing but the same

    I tried to download a form from my doctor's office and got a message that I had to install adobe reader, accept the end-user agreement, quit and relaunch. I did all that, to my understanding of those words which could be wrong, but still have the same message. Please help.

    The key word is "launch", the Apple word for "run an app". You must run an app from Applications

  • End User's mailing list administration

    Hi,
    I have a customer who has just migrated from iMS 5 to newest JES05Q4. Everything seems to be OK except one thing: In iMS 5 end users were able to use Delegated Admin to manage their mailing lists.In 05Q4, Delegated Admin does not allow end users to login. Is this a configuration issue, or is that function removed from the newest Delegated Admin? What is the recommended way for web-based mailing list manipulations?

    Yeah, that's gone from the current DA. We're hoping to get better stuff into JES5, due out sometime around the end of the year.

  • Prevent same user login  more than twice in Online examination Application

    Hello Every Body,
    I want to prevent my user login more than twice in my application so what should i do?
    If user login twice then third time he must not be able to login and must not be able to attend online exam..
    Please somebody help me ....

    BalusC wrote:
    Implement HttpSessionListener or HttpSessionAttributeListener and get hold of all logged in Users and its Sessions in a Map. During login just check in the Map if the User isn't already in there. If it isn't, then add it to the map. If it is, then disallow login (or better, invalidate the previous Session and replace it in the Map it with current login). During logout, remove the User from the Map. During destroy of the session, remove the User from the Map.+"I want to prevent my user login more than twice in my application so what should i do?+
    +If user login twice then third time he must not be able to login and must not be able to attend online exam.."+
    Well i'm afraid that would not solve cause the end user's requirement.To me end user actually wants to stop any user to login his application(for taking an exam) more that twice. He has not added a clause stating end user at the sametime. Therefore, it is up to end user clearly define what is actual requirement is.

  • Multiple Mail ID into End User

    Hello all,
    Can we have multiple mail ID's into End User in CUCM 9.1.2 ?
    If yes how to define ?
    Regards,

    No, you cannot.

  • Hi i have download os x mavericks system preferences go to users & groups click on account picture scroll down to Linked click on Linked i have the same picture twice how do i delete these pictures

    hi i have download os x mavericks system preferences go to users & groups click on account picture scroll down to Linked click on Linked i have the same picture twice how do i delete these pictures

    I am not connected even though I am.
    It is showing you are connected, but the signal strength is low.
    bookmarks
    Those are what is in the Favorites bar. They can be changed by deleting the from the Favorites bar. To add others, add them to the Favories bar.
    How can you remove that app?
    You can't.
    Un-install CleanMyMac. It can damage the entire system.
    Myth of the Dirty Mac
    CleanMyMac - Uninstall
    CleanMyMac2 Un-install
    If you are going to re-install, make sure you have 1 or preferably 2 full backups using Time Machine and/or a clone.
    Try booting into the Safe Mode using your normal account.  Disconnect all peripherals except those needed for the test. Shut down the computer and then power it back up after waiting 10 seconds. Immediately after hearing the startup chime, hold down the shift key and continue to hold it until the gray Apple icon and a progress bar appear. The boot up is significantly slower than normal. This will reset some caches, forces a directory check, and disables all startup and login items, among other things. When you reboot normally, the initial reboot may be slower than normal. If the system operates normally, there may be 3rd party applications which are causing a problem. Try deleting/disabling the third party applications after a restart by using the application un-installer. For each disable/delete, you will need to restart if you don't do them all at once.
    Safe Mode
    Safe Mode - About

  • End User Manual

    Hi SAP Gurus,
    We are currently want to create the end user manual for the users at client.
    I want to know what are the different  details that should be maintained in the End User Training Manual.
    Should we enter screen shots and any question answer  in the same.
    If any one has the template , can mail me at [email protected]
    Also What is the concept Power User.?
    Edited by: Kapil Joshi on Dec 27, 2007 7:27 PM

    Hi Kapil,
    You can use Info Pack for the documentation in that you just key in the data for the various transation and system capture all the screen shots as well as Path T codes and Settings to be entered it is very good tool.
    Once you have that you can start from SPRO with Enterprise structure and all modules seprately and can prepare the documents.
    Power Users are Super Users who have the authorisation for Modify, Update and Input and some timeCustomise also.
    Cheers!!
    Biren Agnihotri
    Every customisation is diffrent from another so a standard template will not be of any help.

  • End user training material

    Hi Friends,
    i am looking for end user training material for A/R,A/P and CIN.
    if anybody have that please porvide me with the same.
    My Mail ID is [email protected]
    Thanks in Advance
    RK

    Hi Jyotsna,
    Do you have the enduser training material for GL, CONTROLLING, PROFIT CENTER ACCTG, COST CENTER ACCOUNTG, INTERNAL ORDERS AND ALL OTHERS IF SO WILL APPRECIATE IF YOU COULD EMAIL ME
    ALSO IF U CAN EMAIL ME AR, AP, BANK.
    THKS IN ADVANCE
    M.M
    email me at [email protected]
    How do we assign points i am new to the forum.

Maybe you are looking for

  • I installed the update and now my itunes won't open - can anyone help?

    I had to update as it wouldn't recognise my iphone anymore, although it opened fine prior to the upgrade.

  • ITunes playlist empty after moving music folder

    I have recently moved my music folder to a different partition on my PC. After doing that, my entire song list, including playlists, has vanished from iTunes. I tried changing the media folder location by going to edit -> preferances -> advanced. I t

  • Monitor HP 2010i sleep problems

    My computer worked before we moved it from one side of the room to the other. Power it on and it says no signal and the monitor goes to sleep. Can't get past that. Moving back and it does the same. Can anyone help me? P.s. unplugged.. detached connec

  • Comparing Quotations

    Hi all,    In Price Comparision list,,,,is it possible to compare the RFQ's considering entire condition types,manual excise & vat values . will the values of the above mentioned condition types, maual excise and VAT can be displayed duing the compar

  • Does the iPhone display turn on when the iPhone is asleep anan alarm sounds

    My iPhone was asleep when its alarm sounded. It was in airplane mode (I didn't want someone calling me during the night). When the alarm sounded, I heard the alarm sound and the phone vibrate, but the display itself was still off; I had to press the