Tuesday, February 2, 2016

BEx Query where used program

An ABAP program I’m writing about originated in one requirement I had today. I needed to evaluate where a bunch of BEx queries are being used. Place where particular BEx query can be used comprises of: workbooks, web templates, query views, broadcast setting, BW transformation etc.


As I had bunch of the queries to evaluate I wrote simple ABAP report which extracted “where used” information for me. Here I’m posting a fragment of my program which does the thing. A list of where used objects are provided in internal table lt_where_used.



REPORT zmm_bex_query_where_used.
 
PARAMETERS: p_compid TYPE rszcompid,
            p_obv    TYPE rszhelp-objvers OBLIGATORY DEFAULT 'A'.
 
DATA:  lv_compuid         TYPE rsz_uid,
       lt_where_used_info TYPE rzd1_t_where_used_info.
 
SELECT SINGLE compuid FROM rsrrepdir INTO lv_compuid WHERE objvers = 'ACT' AND compid EQ p_compid.
 
CALL FUNCTION 'RSZ_DB_COMP_WHERE_USED'
  EXPORTING
    i_compuid           = lv_compuid
    i_objvers           = p_obv
  IMPORTING
    e_t_where_used_info = lt_where_used_info.

Source code available at: github.com/softy12/BEX_QUERY_WHERE_USED

2 comments:

Unknown said...

Hi!
How does it differ from RSA1 repository information, where I can see all information about query - its "Required objects" and "Relays data to"?

Martin Maruskin said...

Hi Constantine,

my "BEx Query where used program" does the same as "Required Objects" section of "BW Metadata Repository - Object Details" if you run it for BEx query.

Reasons for creation of my small report was to have a possibility to quickly look up the where-used information for many queries without exhausting need to drill and search for query in Metadata repository.

cheers,