Benutzer anlegen

Mit dem folgenden Coding k├Ânnen Sie per ABAP einen Benutzer im System anlegen. Zur Anlage des Benutzers wird der Standard-Funktionsbaustein BAPI_USER_CREATE1 verwendet.

  DATA: ps_logondata LIKE	bapilogond,
        ps_adress    LIKE	bapiaddr3,
        pt_addtel    TYPE TABLE OF bapiadtel,
        ps_addtel    LIKE bapiadtel,
        ps_defaults  LIKE	bapidefaul,
        ps_password  LIKE	bapipwd,
        pv_uname     TYPE bapibname-bapibname,
        ps_addsmtp   LIKE bapiadsmtp,
        pt_addsmtp   LIKE TABLE OF bapiadsmtp.


  ps_logondata-gltgv  = '99991231'.
  ps_logondata-gltgb  = '20140101'.
  ps_logondata-ustyp  = 'A'.
  ps_adress-title_p   = 'Herr'.
  ps_adress-firstname = 'Test'.
  ps_adress-lastname  = 'Tester'.
  ps_defaults-spld    = 'SP01'.
  ps_password-bapipwd = 'Sommer2014'.
  pv_uname = ps_upload-bname.
  ps_addtel-country = 'DE'.
  ps_addtel-countryiso = 'DE'.
  ps_addtel-consnumber = 001.
  ps_addtel-std_no = 'X'.
  ps_addtel-telephone = '06192 – 922 93'.
  ps_addtel-extension = '30'.
  APPEND ps_addtel TO pt_addtel.


  ps_addsmtp-std_no = 'X'.
  ps_addsmtp-e_mail = 'info@exxsens.de'.
  ps_addsmtp-consnumber = 001.
  APPEND ps_addsmtp TO pt_addsmtp.

  CALL FUNCTION 'BAPI_USER_CREATE1'
    EXPORTING
      username                = pv_uname
      logondata               = ps_logondata
      password                = ps_password
      defaults                = ps_defaults
      address                 = ps_adress
    TABLES
      return                  = pt_return
      addtel                  = pt_addtel
      addsmtp                 = pt_addsmtp.