Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member

Generating an InfoProvider / Process Chain Cross-Reference

Below is the ABAP source code for a tool to help you identify which Process Chain(s) perform actions on which InfoProvider(s). It produces a simple report, with a clickable hotspot on the Process Chain Name through which you can view the process chain itself. This code requires three custom views. Their definitions also appear below.

This report provides filtering via its selection screen, and offers some options for how to sort the output.

DISCLAIMER: Neither I, nor my employer, nor SAP endorse or guarantee this software as fit for any particular purpose. If you implement and run this code in your SAP environment, you agree to do so at your own risk.

Selection Screen

Sample Report

Source Code

*&---------------------------------------------------------------------*

*& Report  ZBWU_INFOPROV_CHAIN_XREF

*&

*&---------------------------------------------------------------------*

*&  This program produces a report showing all the InfoProviders

*&  in the system and which Process Chains reference them. The report

*&  also identifies the type(s) of processing that a Process Chain

*&  performs on a particular InfoProvider.

*&

*&  Author: Lee E. Coursey

*&---------------------------------------------------------------------*

REPORT  zbwu_infoprov_chain_xref line-SIZE 255.

TABLES: zbwu_rspc_var,

         zbwu_ipak_target,

         zbwu_user,

         rspcchain,

         rsprocesstypes,

         rspcchainattr, rspcchaint,

         rsdcubet,

         rsdodsot,

         rsdiobjt.

TYPES: BEGIN OF t_xref,

         prov_type(4) TYPE c,

         infoprov(11) TYPE c,

         chain_id     TYPE rspc_chain,

         prcs_type    TYPE rspc_type,

         type_desc    TYPE rstxtlg,

        END OF t_xref.

DATA: it_xref TYPE STANDARD TABLE OF t_xref,

       wa_xref TYPE t_xref.

DATA: it_user TYPE HASHED TABLE OF zbwu_user WITH UNIQUE KEY bname,

       wa_user TYPE zbwu_user.

DATA: it_chainattr TYPE HASHED TABLE OF rspcchainattr WITH UNIQUE KEY chain_id,

       wa_chainattr TYPE rspcchainattr.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE b1title.

SELECT-OPTIONS: sptype FOR rsprocesstypes-type,

                 scube  FOR rsdcubet-infocube,

                 sodso  FOR rsdodsot-odsobject.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE b2title.

PARAMETERS: sprov RADIOBUTTON GROUP r2,

             sprcs RADIOBUTTON GROUP r2,

             stype RADIOBUTTON GROUP r2.

SELECTION-SCREEN END OF BLOCK b2.

*~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

INITIALIZATION.

   b2title = 'Report Sort Options'.

*~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-

START-OF-SELECTION.

   PERFORM f_get_data.

   PERFORM f_sort_and_filter.

   PERFORM f_write_report.

END-OF-SELECTION.

*---------------------------------------------------------------------

* Process line selection

*---------------------------------------------------------------------

AT LINE-SELECTION.

* Respond to Hotspot click

   IF NOT wa_xref-chain_id IS INITIAL.

     CALL FUNCTION 'RSPC_CHAIN_MAINTAIN'

       EXPORTING

         i_chain         = wa_xref-chain_id

       EXCEPTIONS

         internal_error  = 1

         aborted_by_user = 2

         OTHERS          = 3.

   ENDIF.

*==========================================================================

TOP-OF-PAGE.

   FORMAT COLOR COL_HEADING ON.

   WRITE: / 'Type', sy-vline,

            'InfoProv', AT 20 sy-vline,

            'Process Chain', AT 48 sy-vline,

            'Process Type',

            AT 114 'Process Chain Last Changed By'.

   FORMAT COLOR OFF.

   ULINE.

*&---------------------------------------------------------------------*

*&      Form  F_GET_DATA

*&---------------------------------------------------------------------*

*       Retrieve InfoProvider / Process Chain relationships

*----------------------------------------------------------------------*

FORM f_get_data .

* Buffer master data in internal tables to speed up the program.

   SELECT * FROM zbwu_user

     INTO CORRESPONDING FIELDS OF TABLE it_user.

   SELECT chain_id tstpnm FROM rspcchainattr

     INTO CORRESPONDING FIELDS OF TABLE it_chainattr

    WHERE objvers = 'A'.

* Get direct references to InfoProviders from Process Chains

   SELECT fnam low chain_id type type_desc

     INTO (zbwu_rspc_var-fnam,

           wa_xref-infoprov,

           wa_xref-chain_id,

           wa_xref-prcs_type,

           wa_xref-type_desc)

     FROM zbwu_rspc_var

    WHERE fnam LIKE 'DTA%'

      AND type IN sptype

      AND objvers = 'A'.

     wa_xref-prov_type = zbwu_rspc_var-fnam+4(4).

     APPEND wa_xref TO it_xref.

   ENDSELECT.

   IF sy-subrc > 4.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.

   ENDIF.

* Get indirect references to InfoProviders, based on Transformations

* contained in process chains

   SELECT tgttlogo tgt chain_id type type_desc

     INTO (wa_xref-prov_type,

           wa_xref-infoprov,

           wa_xref-chain_id,

           wa_xref-prcs_type,

           wa_xref-type_desc)

     FROM zbwu_rspc_dtp

    WHERE type    IN sptype

      AND objvers = 'A'.

     APPEND wa_xref TO it_xref.

   ENDSELECT.

   IF sy-subrc > 4.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.

   ENDIF.

* Get indirect references to InfoProviders, based on InfoPackages

* contained in process chains

   wa_xref-prov_type = 'CUBE'.

   SELECT a~infocube

          a~chain_id a~type a~description

     INTO (wa_xref-infoprov,

           wa_xref-chain_id,

           wa_xref-prcs_type,

           wa_xref-type_desc)

     FROM zbwu_rspc_ipak AS a

          INNER JOIN

          rsdcube AS b ON a~infocube = b~infocube

    WHERE b~objvers = 'A'.

     APPEND wa_xref TO it_xref.

   ENDSELECT.

   IF sy-subrc > 4.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.

   ENDIF.

   wa_xref-prov_type = 'ODSO'.

   SELECT a~infocube

          a~chain_id a~type a~description

     INTO (wa_xref-infoprov,

           wa_xref-chain_id,

           wa_xref-prcs_type,

           wa_xref-type_desc)

     FROM zbwu_rspc_ipak AS a

          INNER JOIN

          rsdodso AS b ON a~infocube = b~odsobject

    WHERE b~objvers = 'A'.

     APPEND wa_xref TO it_xref.

   ENDSELECT.

   IF sy-subrc > 4.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.

   ENDIF.

   wa_xref-prov_type = 'CUBE'.

   SELECT b~infocube

          a~chain_id a~type t~description

     INTO (wa_xref-infoprov,

           wa_xref-chain_id,

           wa_xref-prcs_type,

           wa_xref-type_desc)

     FROM rsprocesstypest AS t

          INNER JOIN

          rspcchain AS a ON t~type = a~type

          INNER JOIN

          zbwu_ipak_target AS b ON a~variante = b~logdpid

          INNER JOIN

          rsdcube AS c ON b~infocube = c~infocube

    WHERE a~objvers = 'A'

      AND t~langu   = sy-langu

      AND c~objvers = 'A'.

     APPEND wa_xref TO it_xref.

   ENDSELECT.

   IF sy-subrc > 4.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.

   ENDIF.

   wa_xref-prov_type = 'ODSO'.

   SELECT b~infocube

          a~chain_id a~type t~description

     INTO (wa_xref-infoprov,

           wa_xref-chain_id,

           wa_xref-prcs_type,

           wa_xref-type_desc)

     FROM rsprocesstypest AS t

          INNER JOIN

          rspcchain AS a ON t~type = a~type

          INNER JOIN

          zbwu_ipak_target AS b ON a~variante = b~logdpid

          INNER JOIN

          rsdodso AS c ON b~infocube = c~odsobject

    WHERE a~objvers = 'A'

      AND t~langu   = sy-langu

      AND c~objvers = 'A'.

     APPEND wa_xref TO it_xref.

   ENDSELECT.

   IF sy-subrc > 4.

     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.

   ENDIF.

ENDFORM.                    " F_GET_DATA

*&---------------------------------------------------------------------*

*&      Form  F_SORT_AND_FILTER

*&---------------------------------------------------------------------*

*       Sort and filter the data for the report

*----------------------------------------------------------------------*

FORM f_sort_and_filter .

   DELETE it_xref WHERE prcs_type NOT IN sptype.

   IF scube[] IS NOT INITIAL.

     DELETE it_xref WHERE prov_type <> 'CUBE'.

     DELETE it_xref WHERE infoprov NOT IN scube.

   ELSEIF sodso[] IS NOT INITIAL.

     DELETE it_xref WHERE prov_type <> 'ODSO'.

     DELETE it_xref WHERE infoprov NOT IN sodso.

   ENDIF.

   SORT it_xref BY infoprov prov_type chain_id prcs_type .

   DELETE ADJACENT DUPLICATES FROM it_xref COMPARING ALL FIELDS.

   IF sprov = 'X'.

   ELSEIF sprcs = 'X'.

     SORT it_xref BY chain_id infoprov type_desc.

   ELSEIF stype = 'X'.

     SORT it_xref BY prcs_type infoprov chain_id.

   ENDIF.

ENDFORM.                    " F_SORT_AND_FILTER

*&---------------------------------------------------------------------*

*&      Form  F_WRITE_REPORT

*&---------------------------------------------------------------------*

*       Write the report

*----------------------------------------------------------------------*

FORM f_write_report .

   LOOP AT it_xref INTO wa_xref.

     IF sprov = 'X'.

       ON CHANGE OF wa_xref-infoprov.

         ULINE.

       ENDON.

     ELSEIF sprcs = 'X'.

       ON CHANGE OF wa_xref-chain_id.

         ULINE.

       ENDON.

     ELSEIF stype = 'X'.

       ON CHANGE OF wa_xref-prcs_type.

         ULINE.

       ENDON.

     ENDIF.

     WRITE: / wa_xref-prov_type, sy-vline,

              wa_xref-infoprovsy-vline.

     FORMAT HOTSPOT ON COLOR 7.

     WRITE: wa_xref-chain_id.

     FORMAT HOTSPOT OFF COLOR OFF.

     HIDE wa_xref-chain_id.

     WRITE: sy-vline,

            wa_xref-prcs_type, '-', wa_xref-type_desc(50).

     CLEAR rspcchainattr-tstpnm.

     CLEAR zbwu_user-name_text.

     READ TABLE it_chainattr INTO wa_chainattr WITH TABLE KEY chain_id = wa_xref-chain_id.

     IF sy-subrc = 0.

       WRITE: wa_chainattr-tstpnm.

       READ TABLE it_user INTO wa_user WITH TABLE KEY bname = wa_chainattr-tstpnm.

       IF sy-subrc = 0.

         WRITE: wa_user-name_text.

       ENDIF.

     ENDIF.

   ENDLOOP.

ENDFORM.                    " F_WRITE_REPORT



View Definitions


VIEW:  ZBWU_IPAK_TARGET               - BW: 3.x InfoPackages and Data Targets

Tables:

       0001 RSLDPIO

       0002 RSUPDINFO

Table Join Criteria:

       RSLDPIO-SOURCE                       EQ RSUPDINFO-ISOURCE

Table Selection Criteria:

       RSLDPIO-OBJVERS                      EQ 'A'                                    AND

       RSUPDINFO-OBJVERS                    EQ 'A'

View Fields:

       0001 LOGDPID                        RSLDPIO                        LOGDPID

       0002 SOURCE                         RSLDPIO                        SOURCE

       0003 TYP                            RSLDPIO                        TYP

       0004 LOGSYS                         RSLDPIO                        LOGSYS

       0005 UNAME                          RSLDPIO                        UNAME

       0006 OWNER                          RSLDPIO                        OWNER

       0007 OLTPSOURCE                     RSLDPIO                        OLTPSOURCE

       0008 UPDID                          RSUPDINFO                      UPDID

       0009 INFOCUBE                       RSUPDINFO                      INFOCUBE

       0010 ISOURCE                        RSUPDINFO                      ISOURCE

       0011 TSTPNM                         RSUPDINFO                      TSTPNM

       0012 TIMESTMP                       RSUPDINFO                      TIMESTMP


VIEW:  ZBWU_RSPC_VAR                  - BW: Process Chain Steps and Variants

Tables:

       0001 RSPCCHAIN

       0002 RSPCVARIANT

       0003 RSPROCESSTYPEST

Table Join Criteria:

       RSPCCHAIN-OBJVERS                    EQ RSPCVARIANT-OBJVERS

       RSPCCHAIN-TYPE                       EQ RSPCVARIANT-TYPE

       RSPCCHAIN-VARIANTE                   EQ RSPCVARIANT-VARIANTE

       RSPROCESSTYPEST-TYPE                 EQ RSPCVARIANT-TYPE

Table Selection Criteria:

       RSPROCESSTYPEST-LANGU                EQ 'E'

View Fields:

       0001 CHAIN_ID                       RSPCCHAIN                      CHAIN_ID

       0002 OBJVERS                        RSPCCHAIN                      OBJVERS

       0003 TYPE                           RSPCVARIANT                    TYPE

       0004 VARIANTE                       RSPCVARIANT                    VARIANTE

       0005 LNR                            RSPCVARIANT                    LNR

       0006 FNAM                           RSPCVARIANT                    FNAM

       0007 SIGN                           RSPCVARIANT                    SIGN

       0008 OPT                            RSPCVARIANT                    OPT

       0009 LOW                            RSPCVARIANT                    LOW

       0010 HIGH                           RSPCVARIANT                    HIGH

       0011 TYPE_ICON_TEXT                 RSPROCESSTYPEST                ICON_TEXT

       0012 TYPE_DESC                      RSPROCESSTYPEST                DESCRIPTION


VIEW:  ZBWU_USER                      - SAP User ID and Name Information

Tables:

       0001 USR21

       0002 ADRP

Table Join Criteria:

       ADRP-PERSNUMBER                      EQ USR21-PERSNUMBER

       ADRP-CLIENT                          EQ USR21-MANDT

View Fields:


       0001 MANDT                          USR21                          MANDT

       0002 BNAME                          USR21                          BNAME

       0003 PERSNUMBER                     USR21                          PERSNUMBER

       0004 TITLE                          ADRP                           TITLE

       0005 NAME_FIRST                     ADRP                           NAME_FIRST

       0006 NAME_LAST                      ADRP                           NAME_LAST

       0007 NAME2                          ADRP                           NAME2

       0008 NAMEMIDDLE                     ADRP                           NAMEMIDDLE

       0009 NAME_LAST2                     ADRP                           NAME_LAST2

       0010 NAME_TEXT                      ADRP                           NAME_TEXT

       0011 CONVERTED                      ADRP                           CONVERTED

       0012 PREFIX1                        ADRP                           PREFIX1

       0013 PREFIX2                        ADRP                           PREFIX2

       0014 NICKNAME                       ADRP                           NICKNAME

       0015 INITIALS                       ADRP                           INITIALS

       0016 MC_NAMEFIR                     ADRP                           MC_NAMEFIR

       0017 MC_NAMELAS                     ADRP                           MC_NAMELAS

       0018 MC_NAME2                       ADRP                           MC_NAME2

1 Comment
Labels in this area