Monday, February 1, 2016

How to look up COMPID for BEx Query based on GENUNIID ?

While dealing with BEx query there may several scenarios occurred based on which we do not have real technical name of BEx query but we have some other identificator of the query. In very common case we have so called technical ID of the query. This is the ID that is visible in BEx Query Designer. BEx developer gives this ID while query is being created. The query technical name is stored as field COMPID (Name (ID) of a reporting component) in table RSRREPDIR. The field COMPID is 25 characters long.

Other unique indentificators which are stored in the same table are:
COMPUID     CHAR  25      UUID in compressed form 
GENUNIID    CHAR  25      Internal display of the report identifier

The COMPUID is unique identificator. This is very important to be noted as one query can have same technical name (COMPID) but COMPUID must be always unique. The COMPUID as well as GENUNIID serve as links between RSRREPDIR table and other BW tables which are related to BEx query.

Sometimes it may happed that we know only GENUNIID value for particular query. Based on this we want to look up COMPID for the query. Following function module can be used for this:
CONVERSION_EXIT_GENID_INPUT- Conversion Exit: InfoCube/Compid -> Genuniid

Imagine we have query with following record in the table RSRREPDIR:

By using mentioned FM we can lookup GENUNIID of the query by providing the COMPID of the query. Of course one can say that we can directly see the GENUNIID in table RSRREPDIR by providing COMPID value so no need to go for the FM. The SE11 for the RSRREPDIR is faster. However if it needs to be done programmatically perhaps call of the FM from ABAP can serve the purpose better.

Another option is to go to SE11 and on selection screen to enter value of GENUNIID:

Once it is entered by ENTER key we get COMPID as the GENUNIID is converted (by the same FM) to COMPID:

However there are cases when we only know the GENUNIID and we need to lookup COMPID. Here we use FM: CONVERSION_EXIT_GENID_OUTPUT

No comments: