Skip to Content

Hi,

I tried to make usage of the fuction module: RSD_IOBJ_USAGE to create a where-used list for Info Objekcts that are relevant for analysis authorization.

Could be useful for some of you.

I’m thankful for any hint concerning my ABAP.

Cheers

REPORT ZIOBJ_MATRIX.
**********************************************************************
TYPES:
       BEGIN OF ls_infoobj,
          RSDIOBJNM TYPE RSDIOBJNM,
       END OF ls_infoobj,
       tt_infoobj TYPE STANDARD TABLE OF ls_infoobj,
       BEGIN OF ls_report,
        infoobj   TYPE RSDIOBJNM,
        name      TYPE RSDIOBJNM,
        typ       TYPE STRING,
        counter   TYPE n,
       END OF ls_report.
DATA: lt_infoobj TYPE tt_infoobj,
      wa_infoobj TYPE ls_infoobj,
      lt_cube TYPE TABLE OF rs_s_used_by,
      lt_multi TYPE TABLE OF rs_s_used_by,
      lt_iobj TYPE TABLE OF rs_s_used_by,
      wa_used_by TYPE rs_s_used_by,
      lt_odso TYPE RSO_T_TLOGO_ASC,
      wa_odso TYPE RSO_S_TLOGO_ASC,
      lt_iset TYPE RSO_T_TLOGO_ASC,
      wa_asc TYPE RSO_S_TLOGO_ASC,
      lt_viobj TYPE RSD_T_VIOBJ,
      wa_viobj TYPE RSD_S_VIOBJ,
      lt_report TYPE TABLE OF ls_report,
      wa_report TYPE ls_report.
**********************************************************************
START-OF-SELECTION.
* 1. Part: Collection of relevant elements
CALL FUNCTION 'RSEC_GET_AUTHREL_INFOOBJECTS'
* EXPORTING
*   I_INFOPROV                      =
*   I_IOBJNM                        =
*   I_CONVERT_ISET_NAMES            = RS_C_TRUE
 IMPORTING
    E_T_IOBJ                        = lt_viobj
* EXCEPTIONS
*   COULD_NOT_GET_INFOOBJECTS       = 1
*   OTHERS                          = 2
          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
LOOP AT lt_viobj INTO wa_viobj WHERE IOBJNM NS '0TC'.
    wa_infoobj-RSDIOBJNM = wa_viobj-IOBJNM.
    APPEND wa_infoobj TO lt_infoobj.
ENDLOOP.
* 2. Usage of relevant elements
LOOP AT lt_infoobj INTO wa_infoobj.
CLEAR: lt_cube, lt_multi, lt_iobj, lt_odso, lt_iset.
CALL FUNCTION 'RSD_IOBJ_USAGE'
  EXPORTING
    I_IOBJNM                    = wa_infoobj-RSDIOBJNM
*   p_IOBJNM
*   I_IOBJTP                    = RS_C_SPACE3
*   I_TH_TLOGO                  =
*   I_BYPASS_BUFFER             = RS_C_FALSE
    I_OBJVERS                   = 'A'
*   I_INCLUDE_ATR_IN_ISET       = RS_C_FALSE
*   I_INCLUDE_ATR_IN_REF        = RS_C_FALSE
IMPORTING
    E_T_CUBE                    = lt_cube
*   E_T_IOBC                    =
*   E_T_ISCS                    =
*   E_T_ISNEW                   =
*   E_T_TABL                    =
*   E_T_CMP_IOBJ                =
*   E_T_ATR_IOBJ                =
*   E_T_ATR_NAV_IOBJ            =
    E_T_MPRO_IOBJ               = lt_multi
*   E_T_NAIP_IOBJ               =
*   E_T_HIECHA_IOBJ             =
*   E_T_ICE_KYF                 =
*   E_T_AGGRCHA_IOBJ            =
*   E_T_CHABAS_IOBJ             =
*   E_T_UNI_IOBJ                =
    E_T_IOBJ                    = lt_iobj
*   E_T_CMP_KYF                 =
*   E_T_ISMP                    =
*   E_T_ISMP_INT                =
    E_T_ODSO                    = lt_odso
    E_T_ISET                    = lt_iset.
*   E_T_MPRO                    =
*   E_T_UPDR                    =
*   E_T_ANMO                    =
*   E_T_AQSG                    =
*   E_T_QUERY                   =
*   E_T_DAS                     =
*   E_T_KPI                     =
*   E_T_TRFN                    =
*   E_T_DTP                     =
*   E_T_HYBR                    =
*   E_T_DAP                     =
*   E_T_DMOD                    =
*   E_T_COPR                    =
*   E_T_BPF                     =
*   E_T_APPL                    =
*   E_T_FBP                     =
*   E_T_HCPR                    =
*   E_T_QPROV                   =
* EXCEPTIONS
*   ILLEGAL_INPUT               = 1
*   OTHERS                      = 2
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.
* Used in InfoCube
LOOP AT lt_cube INTO wa_used_by.
  wa_report-name = wa_used_by-tobjnm.
  wa_report-typ = 'Info Cube'.
  wa_report-infoobj = wa_infoobj.
    APPEND wa_report TO lt_report.
ENDLOOP.
* Used in MultiProvider
LOOP AT lt_multi INTO wa_used_by.
  wa_report-name = wa_used_by-tobjnm.
  wa_report-typ = 'Multi Provider'.
  wa_report-infoobj = wa_infoobj.
    APPEND wa_report TO lt_report.
ENDLOOP.
* Used in InfoObject
LOOP AT lt_iobj INTO wa_used_by.
  wa_report-name = wa_used_by-tobjnm.
  wa_report-typ = 'Info Object'.
  wa_report-infoobj = wa_infoobj.
    APPEND wa_report TO lt_report.
ENDLOOP.
* Used in DSO
LOOP AT lt_odso INTO wa_asc.
  wa_report-typ = 'DSO'.
  wa_report-name = wa_asc-objnm.
  wa_report-infoobj = wa_infoobj.
    APPEND wa_report TO lt_report.
ENDLOOP.
* Used in InfoSet
LOOP AT lt_iset INTO wa_asc.
  wa_report-typ = 'InfoSet'.
  wa_report-name = wa_asc-objnm.
  wa_report-infoobj = wa_infoobj.
    APPEND wa_report TO lt_report.
ENDLOOP.
ENDLOOP.
* 3. Part: Report
WRITE: 'Where-used list:'.
LOOP AT lt_infoobj INTO wa_infoobj.
  WRITE: / wa_infoobj.
ENdloop.
SKIP 1.
WRITE: / '',
       /(30) 'Info Objects', (30) 'Info Provider', (30) 'Typ'.
LOOP AT lt_report INTO wa_report.
  WRITE: / wa_report-infoobj, wa_report-name, wa_report-typ.
ENDLOOP.
To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply