Details zu einem Benutzer lesen

Bei der Programmierung im Berechtigungsumfeld geht es oftmals darum, alle Informationen zu einem Benutzer zu ermitteln. Von der SAP wird hierfür ein BAPI zur Verfügung gestellt. Das folgende Coding enthält den Aufruf des BAPIs.

In den Rückgabestrukturen und internen Tabellen sind nach dem Aufruf alle Informationen zum Benutzer enthalten.

DATA: ls_logondata      TYPE  bapilogond,
        ls_defaults       TYPE  bapidefaul,
        ls_address        TYPE  bapiaddr3,
        ls_company        TYPE  bapiuscomp,
        ls_snc            TYPE  bapisncu,
        ls_ref_user       TYPE  bapirefus,
        ls_alias          TYPE  bapialias,
        ls_uclass         TYPE  bapiuclass,
        ls_lastmodified   TYPE  bapimoddat,
        ls_islocked       TYPE  bapislockd,
        lt_parameter      TYPE TABLE OF bapiparam,
        lt_profiles       TYPE TABLE OF bapiprof,
        lt_activitygroups TYPE TABLE OF bapiagr,
        lt_return         TYPE TABLE OF bapiret2,
        lt_addtel         TYPE TABLE OF bapiadtel,
        lt_ddfax          TYPE TABLE OF bapiadfax,
        lt_addttx         TYPE TABLE OF bapiadttx,
        lt_addtlx         TYPE TABLE OF bapiadtlx,
        lt_addsmtp        TYPE TABLE OF bapiadsmtp,
        lt_addrml         TYPE TABLE OF bapiadrml,
        lt_addx400        TYPE TABLE OF bapiadx400,
        lt_addrfc         TYPE TABLE OF bapiadrfc,
        lt_addprt         TYPE TABLE OF bapiadprt,
        lt_addssf         TYPE TABLE OF bapiadssf,
        lt_adduri         TYPE TABLE OF bapiaduri,
        lt_addpag         TYPE TABLE OF bapiadpag,
        lt_addcomrem      TYPE TABLE OF bapicomrem,
        lt_parameter1     TYPE TABLE OF bapiparam1,
        lt_groups         TYPE TABLE OF bapigroups,
        lt_uclasssys      TYPE TABLE OF bapiuclasssys,
        lt_extidhead      TYPE TABLE OF bapiusextidhead,
        lt_extidpart      TYPE TABLE OF bapiusextidpart,
        lt_systems        TYPE TABLE OF bapircvsys.



  CALL FUNCTION 'BAPI_USER_GET_DETAIL'
    EXPORTING
      username       = 'EXXSENS'
    IMPORTING
      logondata      = ls_logondata
      defaults       = ls_defaults
      address        = ls_address
      company        = ls_company
      snc            = ls_snc
      ref_user       = ls_ref_user
      alias          = ls_alias
      uclass         = ls_uclass
      lastmodified   = ls_lastmodified
      islocked       = ls_islocked
    TABLES
      parameter      = lt_parameter
      profiles       = lt_profiles
      activitygroups = lt_activitygroups
      return         = lt_return
      addtel         = lt_addtel
      addfax         = lt_ddfax
      addttx         = lt_addttx
      addtlx         = lt_addtlx
      addsmtp        = lt_addsmtp
      addrml         = lt_addrml
      addx400        = lt_addx400
      addrfc         = lt_addrfc
      addprt         = lt_addprt
      addssf         = lt_addssf
      adduri         = lt_adduri
      addpag         = lt_addpag
      addcomrem      = lt_addcomrem
      parameter1     = lt_parameter1
      groups         = lt_groups
      uclasssys      = lt_uclasssys
      extidhead      = lt_extidhead
      extidpart      = lt_extidpart
      systems        = lt_systems.