cancel
Showing results for 
Search instead for 
Did you mean: 

USERS_GEN

Former Member
0 Kudos

Hello i need to generate users for our new system

The Users already exists.

When i do it using the USERS_GEN everything works fine. But I have to do for many users.

So I developed a BDC. However the BDC dosent work nor give any error message.

I am not sure any more methods.

the data provided in the text Sheet, is

ORGUNIT;COUNTRY;USER

50000185;US;SRM0011

50000185;US;SRM0012

Please help.

Ster

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ster,

Any specific reason for using BDC? You should be able to upload users using USERS_GEN. Navigate through USERS_GEN, Press "Copy User and Employee Data from Template" and choose "Upload Users from File".

You can set what the delimiter is and the columns are in the upload file here.

Cheers.

former_member183819
Active Contributor
0 Kudos

hi

srm0001;muthu;50000185;dummyatc.com;FR

srm0002;peter;50000185;dummycg1atc.com;FR

try this sample format.

regards

Muthu

Former Member
0 Kudos

uploading users via TXT file in USERS_GEN is really simple

only userID, lastname and the org unit of assignment are mandatory

however you can so much extra info like country, email, role, contact details etc.

it creates SU01 user, assigns to org structure and created S, CP, BP auto in one shot.

You can also transfer the users from other SYSs via RFCs.

OR LDAP option is available.

But as muthu says TXT file is simplest

BR

Dinesh

Former Member
0 Kudos

Thanks All for the suggestions.

However I cant use the Upload Option as suggested because I have my users already created in SU01. When I use the upload option it errors saying the users already exists.

ANy suggestions.

Thanks,

Ster

Former Member
0 Kudos

The reason is that you are trying to create tds that are already available in the system. The simplest option to delete the existing ids and upload again in the file format as suggested by Muthu / Dinesh.

If there are only few ids, just assign them using the below option in USERS_GEN

USERS_GEN 
-> Copy User and Employee Data from Template
-> Create Users from Existing SU01 Users

and upload the remaining users through the CSV file.

Regards

Kathirvel

Former Member
0 Kudos

Thanks Guys for the suggestions.

I understand it would be simplier if I could Upload and run if no USERS exist in the system. However due to Securiy reasons I have to have the user ID already created and run it for existing Users.

Ster.

Former Member
0 Kudos

You can upload multiple users with the above option. When it asks for the user id, just press enter with a * there. You can select the required users from the list and upload them.

Regards

Kathirvel

Former Member
0 Kudos

Thanks Kathirvel

That is a good Idea. I have conveyed the same to my Functional Folks.

However in the intrest od data we have they still feel it a big task to select the users from the list and process.

So am wondering any short cuts,

Anyways I am pasting the program I have developed.

Thanks Ster,


REPORT zs_srm_users_gen
       NO STANDARD PAGE HEADING
       LINE-SIZE 255
       LINE-COUNT 65(0)
       MESSAGE-ID zb1.


DATA : BEGIN OF t_input OCCURS 0,
         orgunit LIKE objec-objid,
         country(2),
         user LIKE sy-uname,
       END OF t_input.

DATA: lt_file    TYPE TABLE OF bbptab WITH HEADER LINE.

DATA i_bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.

DATA i_bdcmsgcoll LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.

DATA : BEGIN OF i_error OCCURS 0,
       text(255) TYPE c,
       END OF i_error.

DATA: lv_filename     TYPE string.
DATA : gv_file        TYPE string.
*----------------------------------------------------------------------*
* Parameters
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK b_file WITH FRAME TITLE text-001.
PARAMETERS: filename TYPE text255 OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b_file.

************************************************************************
*   At Selection Screen
************************************************************************
AT SELECTION-SCREEN.

*  Validate the File Format
  lv_filename = filename.
  TRANSLATE lv_filename TO UPPER CASE.
  FIND REGEX '.TXT' IN lv_filename.
  IF sy-subrc <> 0.
    MESSAGE e015. " 'Invalid file format. Input txt file only.'(015).
  ENDIF.

************************************************************************
*   At Selection Screen On Value Request
************************************************************************
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.

*  Call Function Module /SAPDMC/LSM_F4_FRONTEND_FILE
  CALL FUNCTION '/SAPDMC/LSM_F4_FRONTEND_FILE'
    CHANGING
      pathfile         = filename
    EXCEPTIONS
      canceled_by_user = 1
      system_error     = 2
      OTHERS           = 3.
  IF sy-subrc > 0.                                          "#EC NEEDED

  ENDIF.

************************************************************************
*   Start of Selection
************************************************************************
START-OF-SELECTION.

  PERFORM upload_file_data.

  PERFORM bdc.

*&---------------------------------------------------------------------*
*&      Form  upload_file_data
*&---------------------------------------------------------------------*

FORM upload_file_data .

  gv_file = filename.
* FROM PC
* Read data from file
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename              = gv_file
      has_field_separator   = ';'
      header_length         = 0
    TABLES
      data_tab              = lt_file
    EXCEPTIONS
      invalid_type          = 1
      no_authority          = 2
      access_denied         = 3
      bad_data_format       = 4
      header_not_allowed    = 5
      separator_not_allowed = 6
      OTHERS                = 7.
  IF sy-subrc <> 0.

  ENDIF.
  READ TABLE lt_file INDEX 1.

*  FIND REGEX ';' IN lv_filename.
*  IF sy-subrc <> 0.
*    MESSAGE e015. " 'Invalid format. Use comma Delimites Separator'(015).
*  ENDIF.

  LOOP AT lt_file.
    SPLIT lt_file AT ';' INTO t_input-orgunit
                              t_input-country
                              t_input-user.
    APPEND t_input.

  ENDLOOP.

ENDFORM.                    " upload_file_data
*----------------------------------------------------------------------*
*        Start new screen                                              *
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
  CLEAR i_bdcdata.
  i_bdcdata-program  = program.
  i_bdcdata-dynpro   = dynpro.
  i_bdcdata-dynbegin = 'X'.
  APPEND i_bdcdata.
ENDFORM.                    "BDC_DYNPRO

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.

  CLEAR i_bdcdata.
  i_bdcdata-fnam = fnam.
  i_bdcdata-fval = fval.
  APPEND i_bdcdata.

ENDFORM.                    "BDC_FIELD
*&---------------------------------------------------------------------*
*&      Form  FORMAT_OUTPUT
*&---------------------------------------------------------------------*

FORM format_output .
  DATA : zmsg(255) TYPE c.

  CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
      id        = sy-msgid
      lang      = '-E'
      no        = sy-msgno
      v1        = sy-msgv1
      v2        = sy-msgv2
      v3        = sy-msgv3
      v4        = sy-msgv4
    IMPORTING
      msg       = zmsg
    EXCEPTIONS
      not_found = 1
      OTHERS    = 2.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  i_error-text = zmsg.
  APPEND i_error.
  CLEAR i_error.

ENDFORM.                    " FORMAT_OUTPUT
*&---------------------------------------------------------------------*
*&      Form  BDC
*&---------------------------------------------------------------------*
FORM bdc .

  PERFORM bdc_dynpro      USING 'SAPLBBP_MASS_CREATION' '1000'.
  PERFORM bdc_field       USING 'BDC_OKCODE'
                                '=IMPORT'.
  LOOP AT t_input.

    PERFORM bdc_dynpro      USING 'SAPLBBP_MASS_CREATION' '0050'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'SU01'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=GEN_START'.
    PERFORM bdc_field       USING 'UPLOAD'
                                  ''.
    PERFORM bdc_field       USING 'SU01'
                                  'X'.

    PERFORM bdc_dynpro      USING 'SAPLBBP_MASS_CREATION' '0200'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'DEFAULT_COUNTRY'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=GENE'.
    PERFORM bdc_field       USING 'DEFAULT_ORGUNIT'
                                   t_input-orgunit.        "'50000045'.
    PERFORM bdc_field       USING 'DEFAULT_COUNTRY'
                                    t_input-country.       "'US'.

    PERFORM bdc_dynpro      USING 'SAPLSPO5' '0110'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=OK'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'SPOPLI-SELFLAG(02)'.
    PERFORM bdc_field       USING 'SPOPLI-SELFLAG(01)'
                                  ''.
    PERFORM bdc_field       USING 'SPOPLI-SELFLAG(02)'     "Area of User
                                  'X'.

    PERFORM bdc_dynpro      USING 'SAPLSPO4' '0300'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  'SVALD-VALUE(01)'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=FURT'.
    PERFORM bdc_field       USING 'SVALD-VALUE(01)'
                                  t_input-user.             "'SRM0000'.

    PERFORM bdc_dynpro      USING 'SAPMSSY0' '0120'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  '04/05'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=AMAR'.

    PERFORM bdc_dynpro      USING 'SAPMSSY0' '0120'.
    PERFORM bdc_field       USING 'BDC_CURSOR'
                                  '04/05'.
    PERFORM bdc_field       USING 'BDC_OKCODE'
                                  '=ENTR'.

    CALL TRANSACTION 'USERS_GEN' USING i_bdcdata
                  MODE 'A' "UP_MODE
                  MESSAGES INTO i_bdcmsgcoll.

    WAIT UP TO 3 SECONDS.
    PERFORM format_output.
    REFRESH i_bdcdata.
  ENDLOOP.

ENDFORM.                    " BDC

Former Member
0 Kudos

I can understand what you mean. This becomes a pain when there is huge list to org assign. Please find a code sample below which will solve your problem (This needs some cleanup, I wrote that in a hurry , hope you can manage. But the code works fine)

You can use a text file with user ids alone.

for example: user list1.txt

TEST_001
TEST_002
TEST_003

Here is the code


*&---------------------------------------------------------------------*
*& Report  ZKB_ASSIGN_USERS
*&---------------------------------------------------------------------*

REPORT  zkb_assign_users.

* Selection Screen
PARAMETERS: p_orgid TYPE pd_objid_r OBLIGATORY.
PARAMETERS: p_file  TYPE string     OBLIGATORY.


* File Open Dialog
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.

  DATA: lt_filetab TYPE filetable,
        ls_filetab TYPE file_table.

  DATA: lv_rc TYPE i.

  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
      default_extension       = '*.TXT'
    CHANGING
      file_table              = lt_filetab
      rc                      = lv_rc
    EXCEPTIONS
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      OTHERS                  = 5.
  IF sy-subrc <> 0.
    MESSAGE ID     sy-msgid
            TYPE   sy-msgty
            NUMBER sy-msgno
            WITH   sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    READ TABLE lt_filetab
         INTO ls_filetab INDEX 1.
    IF sy-subrc EQ 0.
      p_file = ls_filetab-filename.
    ENDIF.
  ENDIF.


* Start Of Selection
START-OF-SELECTION.

  TYPES: BEGIN OF lty_users_list,
          userid TYPE xubname,
         END OF lty_users_list.
  DATA: lt_users_list TYPE TABLE OF lty_users_list.
  DATA: ls_users_list TYPE lty_users_list.

  DATA: lv_def_country TYPE hri1028-land1.
  DATA: lv_dum_country TYPE bapibus1006_address-country.

  CALL FUNCTION 'BBPU_GET_DEFAULT_COUNTRY'
    IMPORTING
      default_country            = lv_dum_country
    EXCEPTIONS
      no_default_country_defined = 1
      OTHERS                     = 2.
  IF sy-subrc = 0.
    lv_def_country = lv_dum_country.
  ENDIF.

  CALL FUNCTION 'BBPU_CHECK_ORGUNIT'
    EXPORTING
      objid                     = p_orgid
      show_error_message        = 'X'
    EXCEPTIONS
      no_active_plvar           = 1
      orgunit_not_found         = 2
      orgunit_has_no_address    = 3
      bupa_of_orgunit_not_found = 4
      bupa_has_no_address       = 5
      OTHERS                    = 6.
  IF sy-subrc <> 0.
    MESSAGE 'Invalid Org Id'(001) TYPE 'I'.
    EXIT.
  ENDIF.

  CALL FUNCTION 'BBPU_CHECK_COUNTRY'
    EXPORTING
      country                = lv_def_country
      show_error_message     = 'X'
    EXCEPTIONS
      country_does_not_exist = 1
      OTHERS                 = 2.
  IF sy-subrc <> 0.
    MESSAGE 'Invalid/No Default Country'(002) TYPE 'I'.
    EXIT.
  ENDIF.

  CALL METHOD cl_gui_frontend_services=>gui_upload
    EXPORTING
      filename                = p_file
      filetype                = 'ASC'
*      has_field_separator     = ' '
    CHANGING
      data_tab                = lt_users_list
    EXCEPTIONS
      file_open_error         = 1
      file_read_error         = 2
      no_batch                = 3
      gui_refuse_filetransfer = 4
      invalid_type            = 5
      no_authority            = 6
      unknown_error           = 7
      bad_data_format         = 8
      header_not_allowed      = 9
      separator_not_allowed   = 10
      header_too_long         = 11
      unknown_dp_error        = 12
      access_denied           = 13
      dp_out_of_memory        = 14
      disk_full               = 15
      dp_timeout              = 16
      not_supported_by_gui    = 17
      error_no_gui            = 18
      OTHERS                  = 19.
  IF sy-subrc <> 0.
    MESSAGE ID     sy-msgid
            TYPE   sy-msgty
            NUMBER sy-msgno
            WITH   sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    EXIT.
  ENDIF.

  LOOP AT lt_users_list INTO ls_users_list.

    CALL FUNCTION 'BP_CENTRALPERSON_GET'
      EXPORTING
        iv_username         = ls_users_list-userid
      EXCEPTIONS
        no_central_person   = 1
        no_business_partner = 2
        no_id               = 3
        OTHERS              = 4.
    IF sy-subrc = 0.
      WRITE:/ 'User Id', ls_users_list-userid, 'is already assigned'.
      CONTINUE.
    ENDIF.

    PERFORM assign_user USING ls_users_list-userid
                              space
                              p_orgid
                              lv_def_country
                              'X'.

  ENDLOOP.
*&---------------------------------------------------------------------*
*&      Form  ASSIGN_USER
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_LS_USERS_LIST_USERID  text
*      -->P_SPACE  text
*      -->P_P_ORGID  text
*      -->P_LV_DEF_COUNTRY  text
*      -->P_0348   text
*----------------------------------------------------------------------*
FORM assign_user  USING p_bname
                        p_rfc
                        p_orgunit
                        p_country
                        p_no_su01_user_creation LIKE bbpsapnew-customized.

  TABLES: tsad2, tsad3t.

  DATA: email_dummy LIKE bapiadsmtp.
  DATA: actgroups2 LIKE bapiagr OCCURS 0 WITH HEADER LINE.
  DATA: cp_inhouse_address LIKE bapibus1006002_address.
  DATA: cpadtel LIKE bapiadtel.
  DATA: cpadfax LIKE bapiadfax.
  DATA: cpadsmtp LIKE bapiadsmtp.
  DATA: password(8) TYPE c.
  DATA  ls_employee_data TYPE  bbps_om_usr_employee_data.
  DATA  ls_workplace_address TYPE  bbps_om_usr_addr3.
  DATA  lv_flag TYPE xflag.
  DATA  lv_usr_password TYPE  bapipwd.
  DATA: length_diff TYPE i.
  DATA: lead_initials_length TYPE i.
  DATA: start_number_length TYPE i.
  DATA: start_number_str TYPE string.
  DATA: fill TYPE string.
  DATA: correct_file_data LIKE bbp_ustru OCCURS 0 WITH HEADER LINE.
  DATA: l_bbp_cust LIKE bbp_cust.
  DATA: logondata LIKE  bapilogond,
        defaults LIKE  bapidefaul,
        address LIKE  bapiaddr3,
        company LIKE  bapiuscomp,
        snc LIKE  bapisncu.
  DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
  DATA: parameter LIKE bapiparam OCCURS 0 WITH HEADER LINE,
        profiles LIKE  bapiprof OCCURS 0 WITH HEADER LINE ,
        activitygroups LIKE  bapiagr OCCURS 0 WITH HEADER LINE,
        addtel LIKE  bapiadtel OCCURS 0 WITH HEADER LINE ,
        addfax LIKE  bapiadfax OCCURS 0 WITH HEADER LINE ,
        addttx LIKE  bapiadttx OCCURS 0 WITH HEADER LINE ,
        addtlx LIKE  bapiadtlx OCCURS 0 WITH HEADER LINE ,
        addsmtp LIKE  bapiadsmtp OCCURS 0 WITH HEADER LINE ,
        addrml LIKE  bapiadrml OCCURS 0 WITH HEADER LINE ,
        addx400 LIKE  bapiadx400 OCCURS 0 WITH HEADER LINE ,
        addrfc LIKE bapiadrfc OCCURS 0 WITH HEADER LINE ,
        addprt LIKE bapiadprt OCCURS 0 WITH HEADER LINE ,
        addssf LIKE bapiadssf OCCURS 0 WITH HEADER LINE ,
        adduri LIKE bapiaduri OCCURS 0 WITH HEADER LINE ,
        addpag LIKE bapiadpag OCCURS 0 WITH HEADER LINE ,
        addcomrem LIKE bapicomrem OCCURS 0 WITH HEADER LINE ,
        parameter1 LIKE bapiparam1 OCCURS 0 WITH HEADER LINE ,
        groups LIKE bapigroups OCCURS 0 WITH HEADER LINE.
  DATA: generated_password(8) TYPE c.
  DATA: debug_mode LIKE bbpsapnew-customized.
  DATA: use_pw_mode LIKE bbpsapnew-customized.
  DATA  iv_position_stext TYPE stext.

  CLEAR generated_password.

  SELECT SINGLE * FROM bbp_cust INTO l_bbp_cust
                        WHERE id = 'RFC_READ_USE_PW'.
  IF sy-subrc = 0 AND l_bbp_cust-path = 'YES'.
    use_pw_mode = 'X'.
  ENDIF.
  SELECT SINGLE * FROM bbp_cust INTO l_bbp_cust
                        WHERE id = 'DEBUG_UPLOAD_GEN'.
  IF sy-subrc = 0 AND l_bbp_cust-path = 'YES'.
    debug_mode = 'X'.
  ENDIF.

  REFRESH return. CLEAR return.
  CALL FUNCTION 'BAPI_USER_GET_DETAIL' DESTINATION p_rfc
    EXPORTING
      username       = p_bname
    IMPORTING
      logondata      = logondata
      defaults       = defaults
      address        = address
      company        = company
      snc            = snc
    TABLES
      parameter      = parameter
      profiles       = profiles
      activitygroups = activitygroups
      return         = return
      addtel         = addtel
      addfax         = addfax
      addttx         = addttx
      addtlx         = addtlx
      addsmtp        = addsmtp
      addrml         = addrml
      addx400        = addx400
      addrfc         = addrfc
      addprt         = addprt
      addssf         = addssf
      adduri         = adduri
      addpag         = addpag
      addcomrem      = addcomrem
      parameter1     = parameter1
      groups         = groups
    EXCEPTIONS
      OTHERS         = 1.
  IF sy-subrc <> 0.
    return-type   = 'E'.
    return-id     = 'BBPU_MESSAGES'.
    return-number = '035'.
    APPEND return.
  ENDIF.
  LOOP AT return WHERE type = 'E' OR type = 'A'.
  ENDLOOP.
  IF sy-subrc = 0.
    LOOP AT return WHERE type = 'E' OR type = 'A'.
      WRITE:/ return-message.
    ENDLOOP.
    EXIT.
  ENDIF.
  CLEAR: defaults-stcod,
         defaults-spld,
         defaults-splg,
         defaults-spdb,
         defaults-spda,
         defaults-cattkennz,
         defaults-kostl,
         defaults-start_menu.

  IF NOT address-title_aca1 IS INITIAL.
    SELECT SINGLE * FROM tsad2 WHERE title_text = address-title_aca1.
    IF sy-subrc <> 0.
      CLEAR tsad2.
    ENDIF.
  ELSE.
    CLEAR tsad2.
  ENDIF.
  IF NOT address-title_p IS INITIAL.
    SELECT SINGLE * FROM tsad3t WHERE title_medi = address-title_p.
    IF sy-subrc <> 0.
      CLEAR tsad3t.
    ENDIF.
  ELSE.
    CLEAR tsad3t.
  ENDIF.
  IF address-lastname IS INITIAL.
    address-lastname = p_bname.
  ENDIF.
  IF ( address-e_mail IS INITIAL )
     OR ( address-e_mail EQ '@' ).
    MOVE 'email@dummy' TO cpadsmtp-e_mail.
  ELSE.
    MOVE address-e_mail TO cpadsmtp-e_mail.
    CALL FUNCTION 'RSEC_GENERATE_PASSWORD'
      EXPORTING
        alphabet      = 'ABCDEFGHIJKLMNOPQUVWXYZ1234567890'
        output_length = 8
      IMPORTING
        output        = generated_password
      EXCEPTIONS
        some_error    = 1
        OTHERS        = 2.
    IF sy-subrc <> 0.
      CLEAR generated_password.
    ENDIF.
  ENDIF.
  IF generated_password IS INITIAL.
    password = 'abcd1234'.
  ELSE.
    password = generated_password.
  ENDIF.
  IF use_pw_mode = 'X'.
    password = 'abcd1234'.
  ENDIF.

  ls_employee_data-firstname   = address-firstname.
  ls_employee_data-lastname    = address-lastname.
  ls_employee_data-title_key   = tsad3t-title.
  ls_employee_data-title_aca1  = tsad2-title_key.
  ls_employee_data-searchterm1 = address-firstname.
  ls_employee_data-searchterm2 = address-lastname.

  ls_workplace_address-standardaddress = 'X'.
  ls_workplace_address-building_p      = address-building_p.
  ls_workplace_address-room_no         = address-room_no_p.
  ls_workplace_address-inhouse_ml      = address-inhouse_ml.
  ls_workplace_address-comm_country    = p_country.
  ls_workplace_address-e_mail_address  = cpadsmtp-e_mail.
  ls_workplace_address-tel_number      = address-tel1_numbr.
  ls_workplace_address-tel_extension   = address-tel1_ext.
  ls_workplace_address-fax_number      = address-fax_number.
  ls_workplace_address-fax_extension   = address-fax_extens.
  MOVE correct_file_data-manager TO lv_flag.
  MOVE password TO lv_usr_password.

  CALL FUNCTION 'BBPU_CHECK_FLOOR_FIELD_ACTIVE'
    EXCEPTIONS
      field_not_active = 1.
  IF sy-subrc = 0.
    MOVE address-floor_p TO ls_workplace_address-floor.
  ENDIF.

  TRY.
      CLEAR iv_position_stext.
      CONCATENATE ls_employee_data-firstname
                  ls_employee_data-lastname
                  INTO iv_position_stext SEPARATED BY space.
      CALL FUNCTION 'BBP_OM_USR_CREATE_EMPLOYEE_EXT'
        EXPORTING
          is_employee_data     = ls_employee_data
          is_workplace_address = ls_workplace_address
          iv_orgunit_id        = p_orgunit
          iv_position_short    = p_bname
          iv_position_stext    = iv_position_stext
          iv_is_mgr_position   = lv_flag
          iv_username          = p_bname
          iv_usr_password      = lv_usr_password
          iv_usr_email         = cpadsmtp-e_mail
          is_usr_defaults      = defaults
          iv_user_exists       = p_no_su01_user_creation.
    CATCH cx_bbp_om_internal_error.
      MESSAGE e001(bbpu_messages).
    CATCH cx_bbp_om_not_found.
      MESSAGE e001(bbpu_messages).
    CATCH cx_bbp_om_conflict.
      MESSAGE e001(bbpu_messages).
    CATCH cx_bbp_om_no_authorization.
      MESSAGE e003(bbpu_messages).
  ENDTRY.
  CALL FUNCTION 'BBPU_USER_ACTGROUPS_ASSIGN_ZBV'
    EXPORTING
      username          = p_bname
      send_notification = space
    TABLES
      activitygroups    = activitygroups
      return            = return.

  WRITE:/ 'User Id', p_bname, 'is assigned successfully'.

ENDFORM.                    " ASSIGN_USER

Former Member
0 Kudos

Thank You so Much.

I was debugging the Standard Transaction and found we can manage using this include as well.


LBBP_MASS_CREATIONF01

    PERFORM create_single_user_by_rfc USING
                                      selected_users-bname
                                      rfcdest
                                      default_orgunit
                                      default_country
                                      ' '.

Anyways I will use the program that you already developed.

Thanks again.

Ster

Answers (0)