data: C_PROFILE type table of BAPIPROF ."STANDARD TABLE OF
DATA: wa_profiles LIKE LINE OF C_PROFILE.
data it_prof type BAPIPROF occurs 0.
DATA: it_roles TYPE TABLE OF bapiagr,
wa_roles LIKE LINE OF it_roles.
F_USERNAME = SY-UNAME.
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
USERNAME = F_USERNAME
IMPORTING
ADDRESS = S_ADDRESS
TABLES
RETURN = TAB_RETURN
profiles = C_PROFILE
activitygroups = it_roles.
LOOP AT it_roles INTO wa_roles.
write: /,'Roles:',wa_roles-AGR_NAME.
ENDLOOP.
LOOP AT C_PROFILE INTO wa_profiles.
write: /,'Profile::',wa_profiles-BAPIPROF,wa_profiles-BAPIPTEXT.
ENDLOOP.