Retrieving the details of a user from the SAP User-id

REPORT ztest.
 
PARAMETERS: p_usr     TYPE usr21-bname DEFAULT sy-uname OBLIGATORY.
 
DATA:  i_bapiret2     TYPE TABLE OF bapiret2 WITH HEADER LINE,
            wa_address     TYPE bapiaddr3,
            g_iderror(20)  TYPE c.
 
  CALL FUNCTION 'BAPI_USER_GET_DETAIL'
    EXPORTING
      username = p_usr
    IMPORTING
      address  = wa_address
    TABLES
      return   = i_bapiret2.
 
  IF i_bapiret2[] IS INITIAL.
    MESSAGE s000(su) WITH wa_address-firstname
                          wa_address-lastname.
  ELSE.
    LOOP AT i_bapiret2 WHERE NOT id IS INITIAL.
      CONCATENATE i_bapiret2-type
                  i_bapiret2-number
                  '(' i_bapiret2-id ')'
      INTO g_iderror.
      CONDENSE g_iderror.
      CONDENSE i_bapiret2-message.
      WRITE: /,g_iderror,
               space,
               i_bapiret2-message.
    ENDLOOP.
  ENDIF.

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image