Skip to Content

BAPI_USER_CREATE1 generate password with a certain pattern

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!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 10, 2017 at 03:40 PM

    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)

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Feb 22, 2017 at 02:00 PM

    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).

    Add comment
    10|10000 characters needed characters exceeded

    • 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.