Application Development 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: 

How to create a random SU01 user name?

Former Member
0 Kudos

Hello ABAP experts,

how can I create a random SU01 user name which is not yet existing in a system?

I found function module SUSR_GENERATE_PASSWORD to create a new password, but couldn't find a FM to create a random SU01 user name.

Thanks and best regards,

Oliver

3 REPLIES 3

awin_prabhu
Active Contributor
0 Kudos

Check FM BAPI_USER_CREATE

Former Member
0 Kudos

Hi,

For Mass creation of User Names you can use LSMW and do a recording.

You can go for BAPI_User_Create

Input Parameters you have to specify are Username, Logondata (valid from and valid until), Password and Address (Lastname).

This is also mentioned in the documentation which can be retrieved by using transaction Bapi.

Thanks

Arbind

PedroGuarita
Active Contributor
0 Kudos

You don't have a specific FM for user but you can use FM RANDOM_C_BY_SET.


CALL FUNCTION 'RANDOM_C_BY_SET'
  EXPORTING
   LEN_MIN         = 12
   LEN_MAX         = 12
   CHAR_MIN        = 1
   CHAR_MAX        = 36
    charset         = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 IMPORTING
   RND_VALUE       = username.

Depending on the chars you want in the user name you can include them in parameter charset.