Skip to Content

Usage


  • This tool can be used to compare DSO structures across different systems. e.g. Compare a DSOs 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.

User Interface

1. Compare DSO between Dev & Prod

Specify the DSO 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 DSO.
  • The list also shows the position of the info object in the DSO structure.
  • It also hows if the info object is a key field.

01_03_Remote_System_OP_InfoObj.jpg


2. Compare two different DSOs in the same system.

Give the DSO name

02_01_Same_System_IP.jpg

Output:

Info objects missing in DSO 1:

02_03_Same_System_OP_InfoObj.jpg

Code

Copy paste this code in an executable program.

ABAP Code

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

*& Report  ZBW_DSO_CHECK_V2

*&

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

*& Author : Rahul Rajagoapalan Nair

*& Date   : 03 Aug 2012

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

REPORT  ZBW_DSO_CHECK_V2.

TYPE-POOLS : SLIS, ICON.

TYPES :

   BEGIN OF TY_DSO_COMP,

     STATUS     TYPE CHAR4,

     IOBJNM     TYPE RSDODSOIOBJIOBJNM,

     S_POSIT    TYPE RSDODSOIOBJPOSIT,

     S_IOBJNM   TYPE RSDODSOIOBJIOBJNM,

     S_KEYFLAG  TYPE RSDODSOIOBJKEYFLAG,

     T_POSIT    TYPE RSDODSOIOBJPOSIT,

     T_IOBJNM   TYPE RSDODSOIOBJIOBJNM,

     T_KEYFLAG  TYPE RSDODSOIOBJKEYFLAG,

   END OF   TY_DSO_COMP.

DATA :

   IT_S_DSO TYPE STANDARD TABLE OF RSDODSOIOBJ,

   IT_T_DSO TYPE STANDARD TABLE OF RSDODSOIOBJ.

DATA :

   WA_S_DSO TYPE RSDODSOIOBJ,

   WA_T_DSO TYPE RSDODSOIOBJ.

DATA :

   LV_S_LINE TYPE N,

   LV_T_LINE TYPE N.

DATA :

   CV_METADATA_TAB TYPE DD02LTABNAME VALUE ‘RSDODSOIOBJ’.

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_DSO_COMP TYPE STANDARD TABLE OF TY_DSO_COMP.

DATA :

   WA_DSO_COMP TYPE TY_DSO_COMP.

FIELD-SYMBOLS :

   <FS_DSO_COMP> TYPE TY_DSO_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 DSO :’,

   CV_TGT      TYPE STRING VALUE ‘Target DSO :’.

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

*$*$  SELECTION SCREEN FOR SOURCE DSO

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

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

PARAMETERS :

   P_S_DSO TYPE RSDODSOIOBJODSOBJECT DEFAULT ‘DSONAME’ 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 TARGET DSO

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

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

PARAMETERS :

   P_T_DSO TYPE RSDODSOIOBJODSOBJECT DEFAULT ‘DSONAME’ 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 ‘ ODSOBJECT = ‘

             P_S_DSO

            

    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_DSO

   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 ‘ ODSOBJECT = ‘

             P_T_DSO

            

    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_DSO

   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_DSO_COMP.

LOOP AT IT_S_DSO INTO WA_S_DSO.

   WA_DSO_COMPIOBJNM = WA_S_DSOIOBJNM.

   APPEND WA_DSO_COMP TO IT_DSO_COMP.

ENDLOOP.

CLEAR WA_DSO_COMP.

LOOP AT IT_T_DSO INTO WA_T_DSO.

   WA_DSO_COMPIOBJNM = WA_T_DSOIOBJNM.

   APPEND WA_DSO_COMP TO IT_DSO_COMP.

ENDLOOP.

SORT IT_DSO_COMP BY IOBJNM.

DELETE ADJACENT DUPLICATES

   FROM        IT_DSO_COMP

   COMPARING   IOBJNM.

SORT IT_S_DSO BY IOBJNM ASCENDING.

DELETE ADJACENT DUPLICATES

   FROM        IT_S_DSO

   COMPARING   IOBJNM.

SORT IT_T_DSO BY IOBJNM ASCENDING.

DELETE ADJACENT DUPLICATES

   FROM        IT_T_DSO

   COMPARING   IOBJNM.

LOOP AT IT_DSO_COMP ASSIGNING <FS_DSO_COMP>.

   CLEAR WA_S_DSO.

   CLEAR WA_T_DSO.

   “Read Source

   READ TABLE IT_S_DSO

     INTO  WA_S_DSO

     WITH KEY IOBJNM = <FS_DSO_COMP>IOBJNM.

   “Assign independent of Read Sucess or failure

   <FS_DSO_COMP>S_IOBJNM    = WA_S_DSOIOBJNM.

   <FS_DSO_COMP>S_POSIT     = WA_S_DSOPOSIT.

   <FS_DSO_COMP>S_KEYFLAG   = WA_S_DSOKEYFLAG.

   “Read Target

   READ TABLE IT_T_DSO

     INTO  WA_T_DSO

     WITH KEY IOBJNM = <FS_DSO_COMP>IOBJNM.

   “Assign independent of Read Sucess or failure

   <FS_DSO_COMP>T_IOBJNM    = WA_T_DSOIOBJNM.

   <FS_DSO_COMP>T_POSIT     = WA_T_DSOPOSIT.

   <FS_DSO_COMP>T_KEYFLAG   = WA_T_DSOKEYFLAG.

   IF <FS_DSO_COMP>S_IOBJNM = <FS_DSO_COMP>T_IOBJNM.

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

   ELSE.

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

   ENDIF.

   IF <FS_DSO_COMP>S_KEYFLAG NE <FS_DSO_COMP>T_KEYFLAG.

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

   ENDIF.

ENDLOOP.

SORT IT_DSO_COMP BY IOBJNM.

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

“DISPLAY

   WA_FIELDCATCOL_POS = 1.

   WA_FIELDCATKEY = ‘X’.

   WA_FIELDCATFIELDNAME = ‘STATUS’.

   WA_FIELDCATREPTEXT_DDIC = ‘Status’.

   WA_FIELDCATICON = ‘X’.

   WA_FIELDCATOUTPUTLEN = 6.

   WA_FIELDCATTABNAME = ‘IT_DSO_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_DSO_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 3.

   WA_FIELDCATFIELDNAME = ‘S_POSIT’.

   CONCATENATE P_S_DSO

               ‘- Position :’

               P_S_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 8.

   WA_FIELDCATTABNAME = ‘IT_DSO_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 4.

   WA_FIELDCATFIELDNAME = ‘S_IOBJNM’.

   CONCATENATE P_S_DSO

               ‘- Info Object :’

               P_S_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 30.

   WA_FIELDCATTABNAME = ‘IT_DSO_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 5.

   WA_FIELDCATFIELDNAME = ‘S_KEYFLAG’.

   CONCATENATE P_S_DSO

               ‘- Key :’

               P_S_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 10.

   WA_FIELDCATTABNAME = ‘IT_DSO_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 6.

   WA_FIELDCATFIELDNAME = ‘T_POSIT’.

   CONCATENATE P_T_DSO

               ‘- Position :’

               P_T_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 8.

   WA_FIELDCATTABNAME = ‘IT_DSO_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 7.

   WA_FIELDCATFIELDNAME = ‘T_IOBJNM’.

   CONCATENATE P_T_DSO

               ‘- Info Object :’

               P_T_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 30.

   WA_FIELDCATTABNAME = ‘IT_DSO_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_FIELDCATCOL_POS = 8.

   WA_FIELDCATFIELDNAME = ‘T_KEYFLAG’.

   CONCATENATE P_T_DSO

               ‘- Key :’

               P_T_SYS

        INTO   WA_FIELDCATREPTEXT_DDIC

        SEPARATED BY SPACE.

   WA_FIELDCATOUTPUTLEN = 10.

   WA_FIELDCATTABNAME = ‘IT_DSO_COMP’.

   APPEND WA_FIELDCAT TO IT_FIELDCAT.

   CLEAR WA_FIELDCAT.

   WA_SORTSPOS = 1.

   WA_SORTFIELDNAME = ‘S_POSIT’.

   WA_SORTTABNAME = ‘IT_DSO_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                      = ‘DSO Info Object Assignment Comparision’

     IT_FIELDCAT                       = IT_FIELDCAT

     IT_SORT                           = IT_SORT

   TABLES

     T_OUTTAB                          = IT_DSO_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_DSO DSO
P_S_SYS System
P_S_VER Version
P_T_DSO DSO
P_T_SYS System
P_T_VER Version

Text Elements

001 Source DSO :
002 Target DSO :

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.

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