Mail to basis when userid is locked

Dear Experts,
                     My requirement is to send a mail to basis team whenever a userid gets locked (when he tried to logon to sap after three times with rong password).
How to do this can u give some of your valuable inputs.
Thanks and Regards,
Thirukumaran. R

Dear Thirukumaran,
I have done a similar scenario in my project successfully.
1. As this does not involve any approval process there is no need to create workflow and it can be handled via ABAP code itself.
Steps:
1.Go to SE38. Create a report there with code as below. Copy and paste the below code.
REPORT  zuser_lock_workflow.
DATA : BEGIN OF st1,
  bname LIKE usr02-bname,
  user_flag LIKE usr02-uflag,
  loc_user(255),
  END OF st1.
DATA : BEGIN OF st2,
  loc_user(255),
  END OF st2.
DATA : it_user LIKE TABLE OF st1 WITH HEADER LINE,
       wa_user LIKE LINE OF it_user.
DATA : it_lock LIKE TABLE OF st2 WITH HEADER LINE,
       wa_lock LIKE LINE OF it_lock.
SELECT bname uflag FROM usr02 INTO TABLE it_user
 WHERE uflag = '128'.
DATA : wa_objhead TYPE soli_tab,
 i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
 i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
 objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE,
 objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
 objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
 objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
 reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE,
 i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
 i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
 i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
 w_ctrlop TYPE ssfctrlop,
 w_compop TYPE ssfcompop,
 w_return TYPE ssfcrescl,
 wa_doc_chng TYPE sodocchgi1,
 w_data TYPE sodocchgi1,
 v_form_name TYPE rs38l_fnam,
 v_objnam TYPE string,
 v_bodytxt1 TYPE string,
 v_bodytxt2 TYPE string,
 v_len_outn TYPE i,
 v_lines_txt TYPE i,
 v_lines_bin TYPE i,
 v_len_out LIKE sood-objlen.
REFRESH: i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
i_objbin[] = i_record[].
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt. "TEXT
i_objpack-doc_type = 'RAW'.
APPEND i_objpack.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
i_objpack-transf_bin = 'X'.
i_objpack-head_start = 1.
i_objpack-head_num = 1.
* i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_bin. "BIN
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = text-000.
i_objpack-obj_descr  = text-001.
i_objpack-doc_size = v_lines_bin * 255 .
APPEND i_objpack.
wa_doc_chng-obj_name = text-000.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = text-000.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
i_reclist-receiver = 'XABAPER'. "'Note: Here instead of XABAPER specify your own basis id
i_reclist-rec_type = 'B'.
APPEND i_reclist.
DATA : loc_var(1000),
      lv_bname(1000).
DATA : var(5) VALUE '0',
      var1(5) VALUE '255',
      var2(5) value 1.
DATA: it_solisti1 LIKE TABLE OF solisti1 WITH HEADER LINE.
DATA : loc_user(255).
DATA : lin(3) TYPE n.
DESCRIBE TABLE it_user LINES lin.
LOOP AT it_user INTO wa_user.
  lv_bname = wa_user-bname .
  CONCATENATE lv_bname loc_var INTO loc_var SEPARATED BY ','.
ENDLOOP.
it_lock-loc_user = loc_var.
APPEND it_lock.
DATA : n TYPE i.
DATA : strlen TYPE string.
CONCATENATE 'Please Unlock the userids : '  loc_var INTO loc_var.
n = STRLEN( loc_var ).
DATA : loc_flag(1).
LOOP AT it_lock.
  IF var2 > 0.
    wa_lock-loc_user = loc_var+var(var1).
    APPEND wa_lock TO it_lock.
    var = var + 255.
    var1 = var1 + 255.
    var2 = n - var.
    loc_flag = 1.
  it_solisti1-line = wa_lock-loc_user.
  APPEND it_solisti1.
  ENDIF.
ENDLOOP.
IF loc_var IS NOT INITIAL.
  CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
      document_data                    = wa_doc_chng
     document_type                    = 'RAW'
*     PUT_IN_OUTBOX                    = ' '
*     COMMIT_WORK                      = ' '
*   IMPORTING
*     SENT_TO_ALL                      =
*     NEW_OBJECT_ID                    =
    TABLES
*     OBJECT_HEADER                    =
     object_content                   = it_solisti1
*     CONTENTS_HEX                     =
*     OBJECT_PARA                      =
*     OBJECT_PARB                      =
      receivers                        = i_reclist
*   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 ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ELSE.
    MESSAGE s888(sabapdocu) WITH 'Mail Successfully Sent to the Basis Team'.
  ENDIF.
ENDIF.
2. Save and activate the report. Now go to SA38 tcode and schedule a background job for this report.
3. Specify the time interval for which the report has to run in background.
4. Once this is completed whenever a user attempts locks a user id by wrong attempt a mail will be automatically sent to
the basis person's id. (please specify the )
5. This is perfectly working for me. Incase if you face any issues please tell me.
KR,
Bharath

Similar Messages

  • Mail when in Sleep/Lock?

    Trying to determine what activity continues when the iPhone is in sleep (or locked) mode.
    From experience and the manual, I understand it will receive calls, messages and sound calendar and alarm alerts, play music. Maybe there is more.
    However, I'm not sure what Mail activity should occur when in Sleep?
    Sometimes it appears as though it has received Mail while in Sleep. But more often it will present mail that is "out of date" until it connects after waking up.
    Would someone explain or send link with info on "activity when in sleep."
    Thanks in advance.
    System: iPhone 3G, iOS 4.2.1

    "Sleep" means on, but idle. You will still receive calls, e-mail and text when the phone is in "sleep" state. Sleep means you are not using it, and the screen is dark. If you want, you can turn it off. Then it will not do any of the things above and phone calls will go directly to voicemail. I would venture to say most folks do not power off their phone at night. But they plug it in to a charger (which turns the phone back on, if it is off).

  • Infected files found in mail data base.

    Greetings to everyone,
    A few days ago, ClamXav detected infected files when scanning my mail data base. One of wich was a phishing kind of mesage, and the other was defined as a trojan. It turns out that they were mesages from 2009, by the time when i had a G5 Power PC. I've never open theme, nor clicked the links attached. Now i have a new Mac, but those mails are still in the data base; i think they migrated from my imap account. Any way, i red the ClamXav developper's page and he says that its not advisable to trash out or put this kind of files into quarantine. it bothers me that they still remain in my user's library.
    Can someone give me a tip on how to cope with this issue?
    Thank you!

    Grandel wrote:
    Greetings to everyone,
    A few days ago, ClamXav detected infected files when scanning my mail data base. One of wich was a phishing kind of mesage, and the other was defined as a trojan. It turns out that they were mesages from 2009, by the time when i had a G5 Power PC. I've never open theme, nor clicked the links attached. Now i have a new Mac, but those mails are still in the data base; i think they migrated from my imap account. Any way, i red the ClamXav developper's page and he says that its not advisable to trash out or put this kind of files into quarantine. it bothers me that they still remain in my user's library.
    I wish you had asked this question in the ClamXav Forum where I would have found it earlier.
    Unless the infection name contains "OSX" it's almost certainly not anything that can impact your OS. But there still could be a couple of issues.
    If the infection name contained the word "Heuristics" then it means that phishing message was not positively identified as a phishing attempt, but something about the way it was formatted looked suspicious enough to warn you about it. All such messages should be read before you delete them, as they could well be a false alarm.
    The other question I would have asked you is what e-mail client you were using on your G5. Some e-mail clients (including Apple Mail in the early days) stored all their e-mail in one large database. If you were to delete the infected file, you would lose all your e-mail, so an alternate procedure is necessary to find and delete the message.

  • I can no longer compose using my exisiting e mail data base system does not pull up existing e mail addresses

    Suddenly when I compose an e mail the system no longer recognizes my existing e mail data base or e mails I have sent to clients on many occasions. I have to manually pull up the e mail copy and paste it into the send section. This does not happen when I use my g mail on internet explorer.

    Hi Olivier,
    Thanks very much for that. it worked on my powerbook(running Tiger). I went to the link and followed the instructions and it worked. Did i mention that my dad who has a iMac running Leopard now has the same problem. I thought i would just do the same but the Preference in Mail for Leopard is of course different. There is no icon called "Server Settings" under Accounts section like there is on mine. Do you have a link for the same kind of instructions for Leopard?
    Thanks again,
    Bryce

  • Mail shows up when I go into Safari

    My mail show up when I click on the Safari icon in the dock. I have to quit mail if I want to get into Safari.

    Have you reset your phone?
    Hold the home button + the lock button for about 10-12 seconds until the Apple logo appears.  You will not lose any data or current settings.

  • MII UserID gets locked frequently

    Hi
            I have created a MII user through which PI post messages to MII MesageListener. This user is getting locked frequently so PI fails to post the messages. Can anyone tell me why the userID gets locked frequently? I am using MII version 12.1.6
    Thanks in advance
    Shaji

    In cases that I have seen, it is usually some job folks forgot about that did not get the password updated when it changed.  A scheduled job is frequently the problem, but not always as I have seen message listener jobs which were causing the problems or even webpage invoked transactions.
    Good luck,
    Mike

  • I can record voice memos fine using the built-in iPhone 4 mic.  And my Bluetooth headset (Jawbone Era) works fine when I leave messages on voice mail systems etc. when calling on the iPhone 4.  However, I cannot record voice memos with my Bluetooth mic.

    I can record voice memos fine using the built-in iPhone 4 mic.  And my Bluetooth headset (Jawbone Era) works fine when I leave messages on voice mail systems etc. when calling on the iPhone 4, so it appears my headset mic is fine.  I can also use voice activated dialing, although it fails miserably interpreting numbers.  However, I cannot record voice memos with my Bluetooth mic.   I just get barely audible static.  Any suggestions?   Thanks.

    Hello, did you ever get an answer to your question? I just picked up a Jawbone Era and using on an iPhone 4s running 5.0.1. Seems to work fine on regular calls, but not on the built in Voice memos application. It worked fine on my older Jawbone Icon, but haven't tested on the 4s or iOS 5.
    Thanks!

  • Can you customize what folder MAIL goes to when adding attachments?

    Can you customize what folder MAIL goes to when adding attachments?
    My friend has 2 email addresses for businesses.
    He has invoices in folders for both, and wants to set up the Mac like this:
    When he writes from one email address and attaches documents - he want the Mac always to go to the corresponding folder for that company of his. Same for the other email address...
    Make sense?
    Can this be done?
    Thanks in advance....

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether your problem is caused by third-party system modifications that load automatically at startup or login. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Shut down your computer, wait 30 seconds, and then hold down the shift key while pressing the power button.
    When you see the gray Apple logo, release the shift key.
    If you are prompted to log in, type your password, and then hold down the shift key again as you click  Log in.
    *Note: If FileVault is enabled under OS X 10.7 or later, or if a firmware password is set, or if the boot volume is a software RAID, you can’t boot in safe mode. Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs.  The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Help needed! Just want to cancel my year subscription. No answer from support via mail, noone answers when I call, support chat don't work.

    Hi there
    I'll pass your details to our Russian team and they'll contact you to assist further.
    Kind regards
    Bev

  • I carnt hear my message tone,the sounds it makes when the phone locks and opens.Also i am unable to hear my music playing from my phone but my alarm and ringtone are working.Can anyone help

    i carnt hear my message tone,the sound it makes when the phone locks and opens,also i am unable to hear music when playing from my phone but my ringtone and alarm tone work.Ive made sure the silent button is not on,and the volume button on the side of the phone is just showing it blank instead of it going up and down.To try and fix this i have reset my settings and restored my phone,but now its just skipping the music i have purchased from itunes when in a docking station which is now another problem i have as well.Can anyone help????

    Hello dbrookes,
    Thank you for using Apple Support Communities!
    It sounds like even though the Mute switch is not on, sounds are not making the, well, sound they should, and the volume buttons make a blank volume indicator appear on the screen that does not show the volume level.
    I wanted to recommend a couple of things.
    First, I would reset the phone:
    Resetting your device
    Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
    From: iPhone, iPad, iPod touch: Turning off and on (restarting) and resetting
              http://support.apple.com/kb/ht1430
    If that does not resolve the issue, then you may want to try backing up to iTunes, and restoring the iPhone again but this time do not restore the backup and set it up as new to see if the issue persists without the previous configuration.
    Just incase you need it, this article will help with that:
    iOS: How to back up and restore your content
    http://support.apple.com/kb/HT1766
    Cheers,
    Sterling

  • Delete mail from server when deleting from mail

    I like Mail.
    But - the ONE feature I miss from Entourage is this:
    Delete mail from server when deleting the trash
    Mail can be set to delete messages from the server -- after downloading to the local computer. OK - BUT - I read my email from 3 computers. I want to keep the messages on the server - unless I delete them after trashing - and to read them on 3 computers.
    The BEST way is to delete when I trash them -- NOT when I read them.
    Using the mail program to see all messages on the server and to then delete them one-by-one is a major PITA.
    How can I tell Apple to add this feature?
    Dick
    Dual 2.7 G5, intel iMac, 3 G4 Macs, 2 iPods   Mac OS X (10.4.6)  

    Use the "When moved from Inbox" option that should do it. If you trash it then it goes, if you move it goes... HTH
    Siberian

  • How do I receive an e-mail or notification when someone accepted my invitation in iCal?

    Hi people,
    I have had this problem for a while now and I can't seem to find a solution.
    When I invite people to an event in iCal, the invitation is e-mailed without a problem to the invited people. If they accept, I can watch this on both my iPhone and in iCal. Nevertheless I never receive any e-mail or notification when someone accepts.
    Is it possible to receive an e-mail or quick notification on my iPhone about that?
    Thank you!
    Michaël Duwyn

    >If they could actually save the filled in document that would be just as good because they could attach it to an e-mail
    In Acrobat Pro, open the form and go to the Advanced menu and choose enable usage rights for Reader users.
    Now, they will be able to fill out the form and save it to send it back to you in an email.
    Be aware that there is a 500 use per form limit so this isn't a good answer for high volume use forms.

  • I upgraded my 4s to 7.0.4 and now I can't access hotmail through my main mail app. When I open it a pop up says password incorrect even after I put my password in it pops up again. How do I fix this please help

    I upgraded my 4s to 7.0.4 and now I can't acicess hotmail through my main mail app. When I open it a pop up says password incorrect even after I put my password in it pops up again. How do I fix this please help

    After I upgraded to Mavericks I was also having this message when I tried to update. There was a previous post about this problem which offered this simple solution which worked for me:
    b0n0b0
    Re: Recently upgraded to Maverick from SnowLeopard. Unable to get updates from App store.
    Mar 15, 2014 9:05 AM (in response to Terence Devlin)
    Got it! Thanx.  What I did was go to my account, check that they had my new ID and Password which they did, then hit reset button. All fixed.

  • I am currently living in Europe and using my iPhone on airplane mode only with wifi. My iMessage switched to my e-mail account and when I go to the settings to switch back to my phone number that isn't an option to click on. How do I get it back?

    I am currently living in Europe and using my iPhone on airplane mode when I have wifi. My iMessage is switched to my icloud e-mail address and when I go to my setting to switch it back to my number, it is grayed out and not an option to click. This was working before with my number so I know that it's not from being on airplane mode. How do I get it back to my number?

    They need to go into their settings>messages and make sure iMessage is on.  Also they should click on the send & receive button to make sure their phone number is selected. 

  • I clicked to open one of my mail folders and when it opened, it immediately deleted all of the items in it!  Why and can I get them back???

    In my email app, I clicked to open one of my mail folders.  When it opened, it immediately deleted all of the emails inside that folder.  This happened with all the others too.  How can I stop this and is it possible to get that mail back.

    Did you try to open teh fle by double-clicking its icon? If the file was made with an older version of Office, you may get that message. Try opeing PP and, from its "File" menu, see if you can open the ppt. I've foundthat often gets around that message and then yo ucan save the file from the newer version.
    If that doesn't work, consider asking in the Microsoft Office: Mac forums here:
    Office for Mac forums
    PowerPoint is not an Apple product and it seems a lot of people around here avoid Office.

Maybe you are looking for