Berechtigungen inklusive erlaubter Aktivitäten

Ich habe keinen Report gefunden, der mir zu den Berechtigungsobjekten anzeigt, welche Aktivitäten erlaubt sind. Kurzerhand habe ich diesen natürlich schnell selbst geschrieben.

Der Report kann zur Dokumentation eigener Objekte oder als Information zu Standardobjekten dienen.

2015-08-11_17-02-48

Viel Spaß. Soweit das mit Berechtigungen möglich ist…

Code

REPORT z_disp_auth_activity.
*== Daten
DATA gt_tobj  TYPE STANDARD TABLE OF tobj.
DATA gs_tobj  TYPE tobj.

DATA gt_actz  TYPE STANDARD TABLE OF tactz.
DATA gs_actz  TYPE tactz.

DATA gv_ltext TYPE text30.
DATA gv_ttext TYPE xutext.
DATA gv_stext TYPE scrtext_l.

FIELD-SYMBOLS <feld> TYPE any.

*== Selektionsbild
PARAMETERS p_oclss TYPE xuobjclass DEFAULT 'MDG'.

START-OF-SELECTION.

*== Berechtigungsobjekte lesen
 SELECT * FROM tobj INTO TABLE gt_tobj WHERE oclss = p_oclss.
 CHECK sy-subrc = 0.

*== Aktivitäten zu den Berechtigungsobjekten
 SELECT * FROM tactz INTO TABLE gt_actz FOR ALL ENTRIES IN gt_tobj WHERE brobj = gt_tobj-objct.

 LOOP AT gt_tobj INTO gs_tobj.
*== Berechtigungsobjekt + Text
   FORMAT COLOR COL_GROUP.
   WRITE: / gs_tobj-objct.
   SELECT SINGLE ttext FROM tobjt INTO gv_ttext WHERE langu = sy-langu AND object = gs_tobj-objct.
   IF sy-subrc = 0.
     WRITE gv_ttext.
   ENDIF.
   WRITE AT sy-linsz space.
   FORMAT COLOR OFF.

 DO.
*== Berechtigungsfelder
   ASSIGN gs_tobj-objct INCREMENT sy-index TO <feld> RANGE gs_tobj.
   IF sy-subrc > 0 OR <feld> IS INITIAL.
     EXIT.
   ELSE.
     WRITE: /3 <feld>.
*== Text zum Berechtigungsfeld
     SELECT SINGLE dd04t~scrtext_l
       FROM dd04t
      INNER JOIN authx ON authx~rollname = dd04t~rollname
       INTO gv_stext
      WHERE dd04t~ddlanguage = sy-langu
        AND authx~fieldname = <feld>
        AND dd04t~as4local = 'A'
        AND as4vers = space.
     IF sy-subrc = 0.
       WRITE gv_stext.
     ENDIF.
   ENDIF.
 ENDDO.

*== Aktivitäten zum Berechtigungsobjekt
   LOOP AT gt_actz INTO gs_actz WHERE brobj = gs_tobj-objct.
     WRITE: /6 gs_actz-actvt.
     SELECT SINGLE ltext FROM tactt INTO gv_ltext WHERE spras = sy-langu AND actvt = gs_actz-actvt.
     IF sy-subrc = 0.
       WRITE gv_ltext.
     ENDIF.
   ENDLOOP.
   SKIP 1.
 ENDLOOP.
image_pdfimage_print