Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Workflow event while updating USR02 & USH02

Former Member
0 Likes
1,370

Hi Gurus,

We have a requirement to send mail notification & SMS (new password) to user , if user id has been locked due to failed attempts.

I have code to unlock user id & reset the password . But the requirement is to trigger this code when the USR02-UFLAG is set to 128.

Please suggest me with suitable enhancement places Or workflow events (if any).

Thanks,

Narendra.

8 REPLIES 8
Read only

Former Member
0 Likes
1,202

Hi,

to check for standard workflow events activate the event trace, do your things and then check the event log to see if you can use any of the events (SWELS / SWEL)

I don't think they exist in this particular case, so then you have to see if there are badis you can use to trigger the event, or enhancement spots in the abap where the flag is set by the system.

Kind regards, Rob Dielemans

Read only

0 Likes
1,202

Hi Rob,

Thanks for reply,

  I have tried the option of event trace. but i have not observed any event while updating table.

And tried for BADI & enhancement point also. I have not observed any such option for enhancement.

May be, as it is being locked by system program (SAPMSYST) there is no such option.

Kindly suggest me , if there is any alternative.

Thanks,

Narendra.

Read only

Richa_Gupta
Contributor
0 Likes
1,202

Hi Narendra,

Can you try using TMG(Table Maintenance Generator) events for this.

Regards,

Richa

Read only

0 Likes
1,202

Hi Richa,

Thanks for reply,

Please suggest me the suitable event after save , that will get trigger from other scenarios, Like modifying (UPDATE / MODIFY stmts) table entry  by otherthan SM30 .

Thanks,

Narendra.

Read only

0 Likes
1,202

Hi Narendra,

You can know about the useful events by yourself using the transactions SWELS and SWEL.

Simply, switch on the event trace using SWELS.

Then run your process whatever you want like updating an entry or deleting an entry, etc, and save your process. Then go to SWEL and check which event of which business object is triggered there.

Hope this helps.

Regards,

Richa

Read only

0 Likes
1,202

Hello Narendra,

Based on my understanding you are trying to unlock a user via WF after approval.

There is no standard WF event that gets triggered when the user is locked.

Create a subtype of  standard BOR object USER in transaction SWO1 say ZUSER and add a custom event LOCKED. 

I suggest you to create a batch job that would run every night and picks up the user entries that are locked (select USR02-UFLAG ) and then trigger a custom event LOCKED using FM SAP_WAPI_CREATE_EVENT . You can use the USER ID as key field.Make sure that you are only triggering locked event for a user when there is no existing in process WF instance for that user ID for BOR USER and Event Locked. You can check if there is an existing WF instance of user ID using Function Module 'SAP_WAPI_WORKITEMS_TO_OBJECT

Regards

Sandy

Read only

0 Likes
1,202

Hi,

Thanks to all,

I have not observed such events while locking user id by failed attempts.

So , I have resolved it by scheduling one program to check for locked user ids , and , it will unlock & reset the password (random).

Thasnks,

Narendra.

Read only

Former Member
0 Likes
1,202

Hi,

Use Bussiness Object : USER

Regards