Showing posts with label RSZCOMPDIR. Show all posts
Showing posts with label RSZCOMPDIR. Show all posts

Sunday, January 7, 2018

More than one query with the same technical name?

In BW systems it is not a rare case when there can be multiple BW objects with same technical name. This is especially related to BEx Queries (plus other query components like (REP, CKF, RKF, STR, VAR and SOB can be similarly effected too). Normally one would expect that the technical name is unique identifier of the query. However it is not the case. The technical name (COMPID in table RSZCOMPDIR and others) is not unique similarly as a description of the BEx query is not unique. It just represents language-independent name for the query element. This is in contrary to other objects in SAP systems where the technical name is really unique.

Technically it is not a problem to have duplicate technical names because other field (COMPUID) is used to uniquely distinguish between them. But it may cause problems while using tools like BEx where user needs to specify the query name in OPEN/SAVE dialogs. Only one query will be processed in these tools – whichever is found first in the database.

There can be several cases which may lead to situation causing having more than one query with the same technical name. Some of them can be:

Transports: When one query is imported from system A to system B. Technical name is the same in both systems. Later the query is deleted in the system A and recreated with same name. In case deletion of the query wasn’t transported to system B there will be 2 queries with the same technical name in the B system once recreated query gets transported to system B.

Several dev/test systems used to import objects to one prod systems: of query with the same technical mane is created in both source systems and they are imported to target system the query in there will have the same technical name.
It is very advisable to prevent into running issues like this. However when they occurs there are some possibilities how to deal with this situation.

1. Situation first needs to be analyzed e.g. by ABAP report ANALYZE_RSZ_TABLES.

2. Query can be copied to completely new name with help of t-code RSZC and then re-transported. Query with old tech name shall be deleted (e.g. t-code RSZDELETE).

3. If query (or it parts) needs to be preserved a ABAP report RENAME_DUPLICATE_ELEMENTS can be used to rename the query and/or its components. 

4. While transporting the query a parameter of RSADMIN table called QDEF_NO_DUPLICATE can be defined in order to prevent a situation when query component with the same technical name and different UID that already exit in the target systems is written.

More information:
907025 - Duplicated technical names (COMPID) for query components
1551586 - Duplicated technical names of query components
5541024 - Duplicate query names in the BW system (BW 3.x related Note)
1765828 - Unique technical names for SAP Business Content queries
2061998 - Deletion of a query during transport does not delete an entry in RSRREPDIR

Thursday, August 31, 2017

Was BEx query changed directly in production system?

Sometime s it may become useful to check whether BEx query wasn’t changes directly in production system. Some eager user may just did it perhaps by accident? Also BW admin may need to do it to fix hot production issue when it was really urgent.

I’m not going to discuss here what are all pitfalls of doing changes to the BEx queries directly in production systems. Just to mention few: systems in landscape are out of sync, duplicates query elements (GUIDs      ) when using same name for query (or its elements) when is recreated in development and transported to the production, etc.

Anyhow query changed directly in the production system can be seen in many BW systems. Basically how to find out whether particular query was changed directly in the production? This information is stored in table RSZCOMPDIR. It stores data about query components so called - directory of reporting components. Here an field CHANGED_WITH is available. It can have below values for particular query:

VALUE                    MEANING
                 BEx Query Designer
1                           Web Item for Ad-Hoc Query Design
2                           Design Planning Selection Object
C                           Activate SAP Content
F                           Function RSZ_DB_ELT_COPY_INTO_OBJVERS
R                           Program COMPONENT_RESTORE
T                            Transport
N                           Transient element, requires processing (not persisted)
3                           Java Query Designer (Eclipse based BW Modeling Tools - BWMT)

Whenever you get T value of the field for the query you know it is just fine. The query was transported. In case there is a blank value it is obvious that the query was changed directly in that system.

While I’m writing about the RSZCOMPDIR table there are couple more of useful fields in there:

OWNER         User who created the query
TSTPNM        Last changed by user
LASTUSED     Time Stamp of when a component (queries and filters) was executed as a part of corresponding query object
TSTPDAT       Date when the component was changed on
TSTPTIM        Time when the component was changed at
CREATED       Time Stamp when the component was created
TIMESTMP      Time Stamp the component was changed at


More information:
1760688 - Update of the LASTUSED timestamp for query components

2020974 - Facts about the "Last Changed Time" for a BW Query