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

BAPI_USER_CREATE1 generate password with a certain pattern

former_member310342
Participant
0 Likes
3,145

Hey,

I'm using the BAPI_USER_CREATE1 function module to create users. I'm also generating a password for each one of them. The passwords contain multiple special signs and stuff and are pretty long. Because the users will get the passwords via a letter they can't copy paste them on their first login. So is there a option how I can generate passwords with a certain pattern like 'no specials' or something? I could find an import parameter on anything in the function module itself.

Thanks for any hints!

1 ACCEPTED SOLUTION
Read only

Former Member
1,630

Some years ago, I needed almost the same thing but found nothing. I created a password-generation class, feel free to use it. See

http://pastebin.com/ruSaRteQ (there for one month)

4 REPLIES 4
Read only

Former Member
1,631

Some years ago, I needed almost the same thing but found nothing. I created a password-generation class, feel free to use it. See

http://pastebin.com/ruSaRteQ (there for one month)

Read only

0 Likes
1,630

Hey thanks for ur help and sharing ur code 🙂

I found a function module as well after a little more search.

https://wiki.scn.sap.com/wiki/display/Snippets/Program+to+generate+random+passwords

Hope that can help someone sometime 🙂

Thanks Roland!

Read only

Former Member
1,630

You are welcome 🙂 Please note that RSEC_GENERATE_PASSWORD does not necessarily take care of your systems password rules (e.g. one capital letter, one number, one special char and so on).

Read only

0 Likes
1,630

Yes I figured that out myself because it returned some "false" password. 🙂 Now I'm checking the password and if it doesn't fit I rerun the function module with a limit how often it can executed. Not the perfect solution I think but it works fine.