Skip to Content

Usage


  • This tool can be used to compare Cube structures across different systems. e.g. Compare a cube’s structure in Dev v/s Prod/QA.
  • Essential pre-check before staring any development.
  • Prevent possible Go-live sync issues.
  • Prod sync checks in parallel-dev environments.
  • Works for Multi Providers as well.

User Interface

1. Compare Cube between Dev & Prod

Specify the Cube names along with RFC Connection. F4 help is available for choosing the RFC connection.

01_01_Remote System_IP.jpg

Login to the remote system:

01_02_Remote System_Login.jpg

  • The output displays the list of Info objects and its presence/absence in cubes.
  • The list also shows the position of the info object in the cube structure.

01_03_Remote System_OP.jpg

2. Compare two different cubes in the same system.

Give the cube name

02_01_Same_system_IP.jpg

Output:

Info objects missing in Cube 1:

02_02_Same System_OP.jpg

Info objects missing in Cube 2:

02_03_Same System_OP.jpg

Code

Copy paste this code in an executable program.

Code

*&———————————————————————*

*& Report  ZBW_CUBE_CHECK_V2

*&

*&———————————————————————*

*& Author : Rahul R Nair

*& Date   : 03 Aug 2012

*&———————————————————————*

REPORT  ZBW_CUBE_CHECK_V2.

TYPE-POOLS : SLIS, ICON.

TYPES :

   BEGIN OF TY_CUB_COMP,

     STATUS     TYPE CHAR4,

     IOBJNM     TYPE RSDCUBEIOBJIOBJNM,

     S_POSIT    TYPE RSDCUBEIOBJPOSIT,

     S_IOBJNM   TYPE RSDCUBEIOBJIOBJNM,

     T_POSIT    TYPE RSDCUBEIOBJPOSIT,

     T_IOBJNM   TYPE RSDCUBEIOBJIOBJNM,

   END OF   TY_CUB_COMP.

DATA :

   IT_S_CUBE TYPE STANDARD TABLE OF RSDCUBEIOBJ,

   IT_T_CUBE TYPE STANDARD TABLE OF RSDCUBEIOBJ.

DATA :

   WA_S_CUBE TYPE RSDCUBEIOBJ,

   WA_T_CUBE TYPE RSDCUBEIOBJ.

DATA :

   LV_S_LINE TYPE N,

   LV_T_LINE TYPE N.

DATA :

   CV_METADATA_TAB TYPE DD02LTABNAME VALUE ‘RSDCUBEIOBJ’.

DATA :

   IT_OPTIONS TYPE STANDARD TABLE OF RFC_DB_OPT. “72 CHAR per line

DATA :

   WA_OPTIONS TYPE RFC_DB_OPT. “72 CHAR per line

DATA :

   IT_CUB_COMP TYPE STANDARD TABLE OF TY_CUB_COMP.

DATA :

   WA_CUB_COMP TYPE TY_CUB_COMP.

FIELD-SYMBOLS :

   <FS_CUB_COMP> TYPE TY_CUB_COMP.

DATA :

   IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

   WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.    “FIELD CATALOG

DATA :

   IT_SORT TYPE SLIS_T_SORTINFO_ALV ,

   WA_SORT TYPE SLIS_SORTINFO_ALV.

DATA :

   LV_ERR_MSG  TYPE STRING,

   CV_SRC      TYPE STRING VALUE ‘Source Cube :’,

   CV_TGT      TYPE STRING VALUE ‘Target Cube :’.

*$***********************************************************************

*$*$  SELECTION SCREEN FOR SOURCE CUBE

*$*$*********************************************************************

SELECTION-SCREEN : BEGIN OF BLOCK ssb1 WITH FRAME TITLE TEXT001.

PARAMETERS :

   P_S_CUBE TYPE RSDCUBEIOBJINFOCUBE DEFAULT ‘CUBENAME’ OBLIGATORY,

   P_S_VER  TYPE C LENGTH DEFAULT ‘A’ OBLIGATORY,

   P_S_SYS(32TYPE C OBLIGATORY

     LOWER CASE MATCHCODE OBJECT F4_RFCDESTYPEALL

     DEFAULT ‘DEVRFC’.

SELECTION-SCREEN END OF BLOCK ssb1 .

*$***********************************************************************

*$*$  SELECTION SCREEN FOR SOURCE CUBE

*$*$*********************************************************************

SELECTION-SCREEN : BEGIN OF BLOCK ssb2 WITH FRAME TITLE TEXT002.

PARAMETERS :

   P_T_CUBE TYPE RSDCUBEIOBJINFOCUBE DEFAULT ‘CUBENAME’ OBLIGATORY,

   P_T_VER  TYPE C LENGTH DEFAULT ‘A’ OBLIGATORY,

   P_T_SYS(32TYPE C OBLIGATORY

     LOWER CASE MATCHCODE OBJECT F4_RFCDESTYPEALL

     DEFAULT ‘PRODRFC’.

SELECTION-SCREEN END OF BLOCK ssb2 .

“**********************************************************

“Source System

CLEAR IT_OPTIONS.

CLEAR IT_OPTIONS[].

CLEAR WA_OPTIONS.

CONCATENATE ‘ INFOCUBE = ‘

             P_S_CUBE

            

    INTO     WA_OPTIONSTEXT.

    “SEPARATED BY SPACE.

APPEND WA_OPTIONS TO IT_OPTIONS.

CLEAR WA_OPTIONS.

CONCATENATE ‘ AND OBJVERS = ‘

             P_S_VER

            

    INTO     WA_OPTIONSTEXT.

APPEND WA_OPTIONS TO IT_OPTIONS.

“RFC_READ_TABLE

CALL FUNCTION ‘RFC_READ_TABLE’  DESTINATION P_S_SYS

   EXPORTING

     QUERY_TABLE                = CV_METADATA_TAB

   TABLES

     OPTIONS                    = IT_OPTIONS

     DATA                       = IT_S_CUBE

   EXCEPTIONS

     TABLE_NOT_AVAILABLE        = 1

     TABLE_WITHOUT_DATA         = 2

     OPTION_NOT_VALID           = 3

     FIELD_NOT_VALID            = 4

     NOT_AUTHORIZED             = 5

     DATA_BUFFER_EXCEEDED       = 6

     OTHERS                     = 7

           .

IF SYSUBRC <> 0.

   CASE SYSUBRC.

     WHEN 1.

       CONCATENATE ‘Table Not Available :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_S_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 2.

       CONCATENATE ‘Table Without Data :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_S_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 3.

       CONCATENATE ‘Option Not Valid. Table :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_S_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 4.

       CONCATENATE ‘Field Not Valid. Table :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_S_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 5.

       CONCATENATE ‘Not Authorized. Table :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_S_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 6.

       CONCATENATE ‘Data Buffer Exceeded. Table :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_S_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 7.

       CONCATENATE ‘RFC Connection Not Maintained for System :’

                   P_S_SYS

                   ‘. Or Unknown Error.’

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

   ENDCASE.

   MESSAGE LV_ERR_MSG TYPE ‘E’.

ENDIF.

“Source System

“**********************************************************

“**********************************************************

“Target System

CLEAR IT_OPTIONS.

CLEAR IT_OPTIONS[].

CLEAR WA_OPTIONS.

CONCATENATE ‘ INFOCUBE = ‘

             P_T_CUBE “‘ZXMSC03’ “P_CUBE  “Here

            

    INTO     WA_OPTIONSTEXT.

    “SEPARATED BY SPACE.

APPEND WA_OPTIONS TO IT_OPTIONS.

CLEAR WA_OPTIONS.

CONCATENATE ‘ AND OBJVERS = ‘

             P_T_VER

            

    INTO     WA_OPTIONSTEXT.

APPEND WA_OPTIONS TO IT_OPTIONS.

“RFC_READ_TABLE

CALL FUNCTION ‘RFC_READ_TABLE’  DESTINATION P_T_SYS

   EXPORTING

     QUERY_TABLE                = CV_METADATA_TAB

   TABLES

     OPTIONS                    = IT_OPTIONS

     DATA                       = IT_T_CUBE

   EXCEPTIONS

     TABLE_NOT_AVAILABLE        = 1

     TABLE_WITHOUT_DATA         = 2

     OPTION_NOT_VALID           = 3

     FIELD_NOT_VALID            = 4

     NOT_AUTHORIZED             = 5

     DATA_BUFFER_EXCEEDED       = 6

     OTHERS                     = 7

           .

IF SYSUBRC <> 0.

   CASE SYSUBRC.

     WHEN 1.

       CONCATENATE ‘Table Not Available :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_T_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 2.

       CONCATENATE ‘Table Without Data :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_T_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 3.

       CONCATENATE ‘Option Not Valid. Table :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_T_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 4.

       CONCATENATE ‘Field Not Valid. Table :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_T_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 5.

       CONCATENATE ‘Not Authorized. Table :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_T_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 6.

       CONCATENATE ‘Data Buffer Exceeded. Table :’

                   CV_METADATA_TAB

                   ‘System :’

                   P_T_SYS

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

     WHEN 7.

       CONCATENATE ‘RFC Connection Not Maintained for System :’

                   P_T_SYS

                   ‘. Or Unknown Error.’

              INTO LV_ERR_MSG

              SEPARATED BY SPACE.

   ENDCASE.

   MESSAGE LV_ERR_MSG TYPE ‘E’.

ENDIF.

“Target System

“**********************************************************

“Get all IOs

CLEAR WA_CUB_COMP.

LOOP AT IT_S_CUBE INTO WA_S_CUBE.

   WA_CUB_COMPIOBJNM = WA_S_CUBEIOBJNM.

   APPEND WA_CUB_COMP TO IT_CUB_COMP.

ENDLOOP.

CLEAR WA_CUB_COMP.

LOOP AT IT_T_CUBE INTO WA_T_CUBE.

   WA_CUB_COMPIOBJNM = WA_T_CUBEIOBJNM.

   APPEND WA_CUB_COMP TO IT_CUB_COMP.

ENDLOOP.

SORT IT_CUB_COMP BY IOBJNM.

DELETE ADJACENT DUPLICATES

   FROM        IT_CUB_COMP

   COMPARING   IOBJNM.

SORT IT_S_CUBE BY IOBJNM ASCENDING.

DELETE ADJACENT DUPLICATES

   FROM        IT_S_CUBE

   COMPARING   IOBJNM.

SORT IT_T_CUBE BY IOBJNM ASCENDING.

DELETE ADJACENT DUPLICATES

   FROM        IT_T_CUBE

   COMPARING   IOBJNM.

LOOP AT IT_CUB_COMP ASSIGNING <FS_CUB_COMP>.

   CLEAR WA_S_CUBE.

   CLEAR WA_T_CUBE.

   “Read Source

   READ TABLE IT_S_CUBE

     INTO  WA_S_CUBE

     WITH KEY IOBJNM = <FS_CUB_COMP>IOBJNM.

   “Assign independent of Read Sucess or failure

   <FS_CUB_COMP>S_IOBJNM = WA_S_CUBEIOBJNM.

   <FS_CUB_COMP>S_POSIT  = WA_S_CUBEPOSIT.

   “Read Target

   READ TABLE IT_T_CUBE

     INTO  WA_T_CUBE

     WITH KEY IOBJNM = <FS_CUB_COMP>IOBJNM.

   “Assign independent of Read Sucess or failure

   <FS_CUB_COMP>T_IOBJNM = WA_T_CUBEIOBJNM.

   <FS_CUB_COMP>T_POSIT  = WA_T_CUBEPOSIT.

   IF <FS_CUB_COMP>S_IOBJNM = <FS_CUB_COMP>T_IOBJNM.

     <FS_CUB_COMP>STATUS = ICON_GREEN_LIGHT.“‘S’.

   ELSE.

     <FS_CUB_COMP>STATUS = ICON_RED_LIGHT.“‘D’.

   ENDIF.

ENDLOOP.

SORT IT_CUB_COMP BY IOBJNM.

“COMPARISON

“**********************************************************

“**********************************************************

“DISPLAY

   WA_FIELDCATCOL_POS = 1.

   WA_FIELDCATKEY = ‘X’.

   WA_FIELDCATFIELDNAME = ‘STATUS’.

   WA_FIELDCATREPTEXT_DDIC = ‘Status’.

   WA_FIELDCATICON = ‘X’.

   WA_FIELDCATOUTPUTLEN = 6.

   WA_FIELDCATTABNAME = ‘IT_CUB_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 2.

   WA_FIELDCATKEY = ‘X’.

   WA_FIELDCATFIELDNAME = ‘IOBJNM’.

   WA_FIELDCATREPTEXT_DDIC = ‘Info Object’.

   WA_FIELDCATOUTPUTLEN = 30.

   WA_FIELDCATTABNAME = ‘IT_CUB_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 3.

   WA_FIELDCATFIELDNAME = ‘S_POSIT’.

   CONCATENATE P_S_CUBE

               ‘- Position :’

               P_S_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 8.

   WA_FIELDCATTABNAME = ‘IT_CUB_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 4.

   WA_FIELDCATFIELDNAME = ‘S_IOBJNM’.

   CONCATENATE P_S_CUBE

               ‘- Info Object :’

               P_S_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 30.

   WA_FIELDCATTABNAME = ‘IT_CUB_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 5.

   WA_FIELDCATFIELDNAME = ‘T_POSIT’.

   CONCATENATE P_T_CUBE

               ‘- Position :’

               P_T_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 8.

   WA_FIELDCATTABNAME = ‘IT_CUB_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 6.

   WA_FIELDCATFIELDNAME = ‘T_IOBJNM’.

   CONCATENATE P_T_CUBE

               ‘- Info Object :’

               P_T_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 30.

   WA_FIELDCATTABNAME = ‘IT_CUB_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_SORTSPOS = 1.

   WA_SORTFIELDNAME = ‘S_POSIT’.

   WA_SORTTABNAME = ‘IT_CUB_COMP’.

   WA_SORTUP = ‘X’.

   APPEND WA_SORT TO IT_SORT.

   CLEAR WA_SORT.

CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’

   EXPORTING

     I_CALLBACK_PROGRAM                = SYREPID

     I_GRID_TITLE                      = ‘Cube Info Object Assignment Comparision’

     IT_FIELDCAT                       = IT_FIELDCAT

     IT_SORT                           = IT_SORT

   TABLES

     T_OUTTAB                          = IT_CUB_COMP

   EXCEPTIONS

     PROGRAM_ERROR                     = 1

     OTHERS                            = 2

           .

IF SYSUBRC <> 0.

   CASE SYSUBRC.

     WHEN 1.

       LV_ERR_MSG = ‘Program error during list generation.’.

     WHEN 2.

       LV_ERR_MSG = ‘Unknown error during list generation.’.

   ENDCASE.

   MESSAGE LV_ERR_MSG TYPE ‘E’.

ENDIF.

“DISPLAY

“**********************************************************

Text Elements

Selection Text

P_S_CUBE Cube
P_S_SYS System
P_S_VER Version
P_T_CUBE Cube
P_T_SYS System
P_T_VER Version

Text Elements

001 Source Cube :
002 Target Cube :


Pre-Requisites

  • RFC connection must be available between systems.
  • Check with your basis team for details regarding RFC connection

Acknowledgments

I would like to thank all my team mates and managers at Infosys for their constant support & encouragement.

Future Development

  • Compare Dimensional dimensional details.
To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply