List of BI Queries Based on Info Area and Info Provider

16
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com © 2011 SAP AG 1 List of BI Queries Based on Info Area and Info Provider Applies to: SAP BI/BW Summary During implementation and support project, we often require the list of standard and customized queries per module. This Info set Query created in SAP BW will give list of all queries based on info area and info Provider. Author: Pravin Karkhanis Company: L&T InfoTech Created on: 22 October 2011 Author Bio Pravin Karkhanis has more than 6 years of experience in SAP Business Intelligence. He has worked on multiple implementation and support project.

Transcript of List of BI Queries Based on Info Area and Info Provider

Page 1: List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 1

List of BI Queries Based on Info

Area and Info Provider

Applies to:

SAP BI/BW

Summary

During implementation and support project, we often require the list of standard and customized queries per module. This Info set Query created in SAP BW will give list of all queries based on info area and info Provider.

Author: Pravin Karkhanis

Company: L&T InfoTech

Created on: 22 October 2011

Author Bio

Pravin Karkhanis has more than 6 years of experience in SAP Business Intelligence. He has worked on multiple implementation and support project.

Page 2: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 2

Table of Contents

Need for consolidated List .................................................................................................................................. 3

Structure .......................................................................................................................................................... 3

ABAP Program ................................................................................................................................................ 4

ABAP Program Selection Text ........................................................................................................................ 8

Info set............................................................................................................................................................. 9

Info set assignment to user group ................................................................................................................. 10

SAP Query .................................................................................................................................................... 11

Addition of SAP Query in menu .................................................................................................................... 12

Using Info set Query ......................................................................................................................................... 13

List of Standard BI Queries ........................................................................................................................... 13

List of customized BI Queries ....................................................................................................................... 14

Related Content ................................................................................................................................................ 15

Disclaimer and Liability Notice .......................................................................................................................... 16

Page 3: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 3

Need for consolidated List

Many a times, we need consolidated list of BI queries along with their info provider and info area. If we are implementing a new project, then we need to check if required reports are available in business contents or not.

During the support project, we often need inventory of the reports created per info provider.

This document gives you steps to create SAP Info set query which reads BI Meta data tables and gives you list of BI queries based on info area and info provider.

The info set will be created based on the external ABAP program using structure.

Structure

Create the Data Dictionary structure ZRSQDETAIL through transaction SE 11.

Below are the details of each field in structure.

COMPUID: UID of BI query

INFOCUBE: Name of info provider

INFOP_TXTLG: used for description of info provider

COMPID: Technical name of BI query

QUERY_TXTLG: Description of BI query

INFOAREA: Info area of info provider

INFOAREA_TXTLG: Description of info provider

INF_TYPE: Type of info provider (DSO, Info Object, Standard Info cube, Remote Cube, Virtual Info provider, Multi provider etc. )

Page 4: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 4

ABAP Program

Create executable ABAP program ZRSQDETAIL through transaction SE38. *&---------------------------------------------------------------------* *& Report ZRSQDETAIL *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ZRSQDETAIL. TABLES: ZRSQDETAIL. TYPES: BEGIN OF TYP_RSRREPDIR, COMPUID TYPE RSRREPDIR-COMPUID, INFOCUBE TYPE RSRREPDIR-INFOCUBE, COMPID TYPE RSRREPDIR-COMPID, END OF TYP_RSRREPDIR. DATA: IT_RSRREPDIR TYPE STANDARD TABLE OF TYP_RSRREPDIR, WA_RSRREPDIR TYPE TYP_RSRREPDIR. TYPES: BEGIN OF TYP_RSZELTTXT, ELTUID TYPE RSZELTTXT-ELTUID, TXTLG TYPE RSZELTTXT-TXTLG, END OF TYP_RSZELTTXT. DATA: IT_RSZELTTXT TYPE STANDARD TABLE OF TYP_RSZELTTXT, WA_RSZELTTXT TYPE TYP_RSZELTTXT. DATA: WA_ZRSQDETAIL TYPE ZRSQDETAIL. TYPES: BEGIN OF TYP_RSDCUBE, INFOCUBE TYPE RSDCUBE-INFOCUBE, CUBETYPE TYPE RSDCUBE-CUBETYPE, INFOAREA TYPE RSDCUBE-INFOAREA, TXTLG TYPE RSDCUBET-TXTLG, END OF TYP_RSDCUBE. DATA: IT_RSDCUBE TYPE STANDARD TABLE OF TYP_RSDCUBE, WA_RSDCUBE TYPE TYP_RSDCUBE. TYPES: BEGIN OF TYP_RSDODSO, ODSOBJECT TYPE RSDODSO-ODSOBJECT, INFOAREA TYPE RSDODSO-INFOAREA, TXTLG TYPE RSDODSOT-TXTLG, END OF TYP_RSDODSO. DATA: IT_RSDODSO TYPE STANDARD TABLE OF TYP_RSDODSO, WA_RSDODSO TYPE TYP_RSDODSO. TYPES: BEGIN OF TYP_RSQISET, INFOSET TYPE RSQISET-INFOSET, INFOAREA TYPE RSQISET-INFOAREA, TXTLG TYPE RSQISETT-TXTLG, END OF TYP_RSQISET. DATA: IT_RSQISET TYPE STANDARD TABLE OF TYP_RSQISET, WA_RSQISET TYPE TYP_RSQISET. TYPES: BEGIN OF TYP_RSDIOBJ, IOBJNM TYPE RSDIOBJ-IOBJNM, TXTLG TYPE RSDIOBJT-TXTLG, END OF TYP_RSDIOBJ. DATA: IT_RSDIOBJ TYPE STANDARD TABLE OF TYP_RSDIOBJ, WA_RSDIOBJ TYPE TYP_RSDIOBJ. TYPES: BEGIN OF TYP_RSDAREAT, INFOAREA TYPE RSDAREAT-INFOAREA, TXTLG TYPE RSDAREAT-TXTLG, END OF TYP_RSDAREAT. DATA: IT_RSDAREAT TYPE STANDARD TABLE OF TYP_RSDAREAT, WA_RSDAREAT TYPE TYP_RSDAREAT. DATA: COUNT TYPE I. * Selection Screen SELECT-OPTIONS S_ICUBE FOR WA_RSRREPDIR-INFOCUBE. SELECT-OPTIONS S_COMPID FOR WA_RSRREPDIR-COMPID.

Page 5: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 5

PARAMETERS : S_LANGU LIKE T002T-SPRAS, S_VER TYPE RSOBJVERS. *<Query_head> * Get query details SELECT COMPUID INFOCUBE COMPID FROM RSRREPDIR INTO CORRESPONDING FIELDS OF TABLE IT_RSRREPDIR WHERE OBJVERS = S_VER AND INFOCUBE IN S_ICUBE AND COMPID IN S_COMPID. DESCRIBE TABLE IT_RSRREPDIR LINES COUNT. IF SY-SUBRC = 0. * Get query description SELECT ELTUID TXTLG FROM RSZELTTXT INTO CORRESPONDING FIELDS OF TABLE IT_RSZELTTXT FOR ALL ENTRIES IN IT_RSRREPDIR WHERE ELTUID = IT_RSRREPDIR-COMPUID AND OBJVERS = S_VER AND LANGU = S_LANGU. SORT IT_RSZELTTXT BY ELTUID. DELETE ADJACENT DUPLICATES FROM IT_RSZELTTXT COMPARING ELTUID. * Infoprovider could be multi or cube, DSO, Master data iobject, Infoset * multi or cube SELECT A~INFOCUBE A~CUBETYPE A~INFOAREA B~TXTLG INTO CORRESPONDING FIELDS OF TABLE IT_RSDCUBE FROM RSDCUBE AS A INNER JOIN RSDCUBET AS B ON A~INFOCUBE = B~INFOCUBE FOR ALL ENTRIES IN IT_RSRREPDIR WHERE A~INFOCUBE = IT_RSRREPDIR-INFOCUBE AND A~OBJVERS = S_VER AND B~LANGU = S_LANGU. SORT IT_RSDCUBE BY INFOCUBE. DELETE ADJACENT DUPLICATES FROM IT_RSDCUBE COMPARING INFOCUBE. * DSO SELECT A~ODSOBJECT A~INFOAREA B~TXTLG INTO CORRESPONDING FIELDS OF TABLE IT_RSDODSO FROM RSDODSO AS A INNER JOIN RSDODSOT AS B ON A~ODSOBJECT = B~ODSOBJECT FOR ALL ENTRIES IN IT_RSRREPDIR

Page 6: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 6

WHERE A~ODSOBJECT = IT_RSRREPDIR-INFOCUBE AND A~OBJVERS = S_VER AND B~LANGU = S_LANGU. SORT IT_RSDODSO BY ODSOBJECT. DELETE ADJACENT DUPLICATES FROM IT_RSDODSO COMPARING ODSOBJECT. * Infoset SELECT A~INFOSET A~INFOAREA B~TXTLG INTO CORRESPONDING FIELDS OF TABLE IT_RSQISET FROM RSQISET AS A INNER JOIN RSQISETT AS B ON A~INFOSET = B~INFOSET FOR ALL ENTRIES IN IT_RSRREPDIR WHERE A~INFOSET = IT_RSRREPDIR-INFOCUBE AND A~OBJVERS = S_VER AND B~LANGU = S_LANGU. SORT IT_RSQISET BY INFOSET. DELETE ADJACENT DUPLICATES FROM IT_RSQISET COMPARING INFOSET. * InfoObject SELECT A~IOBJNM B~TXTLG INTO CORRESPONDING FIELDS OF TABLE IT_RSDIOBJ FROM RSDIOBJ AS A INNER JOIN RSDIOBJT AS B ON A~IOBJNM = B~IOBJNM FOR ALL ENTRIES IN IT_RSRREPDIR WHERE A~IOBJNM = IT_RSRREPDIR-INFOCUBE AND A~OBJVERS = S_VER AND B~LANGU = S_LANGU. SORT IT_RSDIOBJ BY IOBJNM. DELETE ADJACENT DUPLICATES FROM IT_RSDIOBJ COMPARING IOBJNM. * Infoarea description SELECT INFOAREA TXTLG INTO CORRESPONDING FIELDS OF TABLE IT_RSDAREAT FROM RSDAREAT WHERE LANGU = S_LANGU AND OBJVERS = S_VER . SORT IT_RSDAREAT BY INFOAREA. DELETE ADJACENT DUPLICATES FROM IT_RSDAREAT COMPARING INFOAREA. ENDIF. LOOP AT IT_RSRREPDIR INTO WA_RSRREPDIR. * Get query description READ TABLE IT_RSZELTTXT INTO WA_RSZELTTXT WITH KEY ELTUID = WA_RSRREPDIR-COMPUID BINARY SEARCH.

Page 7: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 7

IF SY-SUBRC = 0. WA_ZRSQDETAIL-QUERY_TXTLG = WA_RSZELTTXT-TXTLG. ENDIF. WA_ZRSQDETAIL-COMPUID = WA_RSRREPDIR-COMPUID. WA_ZRSQDETAIL-INFOCUBE = WA_RSRREPDIR-INFOCUBE. WA_ZRSQDETAIL-COMPID = WA_RSRREPDIR-COMPID. WA_ZRSQDETAIL-INFOP_TXTLG = ''. WA_ZRSQDETAIL-INFOAREA = ''. WA_ZRSQDETAIL-INF_TYPE = ''. WA_ZRSQDETAIL-INFOAREA_TXTLG = ''. * Get cube/multi details READ TABLE IT_RSDCUBE INTO WA_RSDCUBE WITH KEY INFOCUBE = WA_RSRREPDIR-INFOCUBE BINARY SEARCH. IF SY-SUBRC = 0 . WA_ZRSQDETAIL-INFOP_TXTLG = WA_RSDCUBE-TXTLG. WA_ZRSQDETAIL-INFOAREA = WA_RSDCUBE-INFOAREA. IF WA_RSDCUBE-CUBETYPE = 'M'. WA_ZRSQDETAIL-INF_TYPE = 'Multiprovider'. ELSEIF WA_RSDCUBE-CUBETYPE = 'B'. WA_ZRSQDETAIL-INF_TYPE = 'Standard Infocube'. ELSEIF WA_RSDCUBE-CUBETYPE = 'R'. WA_ZRSQDETAIL-INF_TYPE = 'Remote Infocube'. ELSEIF WA_RSDCUBE-CUBETYPE = 'V'. WA_ZRSQDETAIL-INF_TYPE = 'Virtual Infoprovider'. ENDIF. ENDIF. * Get DSO details READ TABLE IT_RSDODSO INTO WA_RSDODSO WITH KEY ODSOBJECT = WA_RSRREPDIR-INFOCUBE BINARY SEARCH. IF SY-SUBRC = 0 . WA_ZRSQDETAIL-INFOP_TXTLG = WA_RSDODSO-TXTLG. WA_ZRSQDETAIL-INFOAREA = WA_RSDODSO-INFOAREA. WA_ZRSQDETAIL-INF_TYPE = 'DSO'. ENDIF. * Get Infoset details READ TABLE IT_RSQISET INTO WA_RSQISET WITH KEY INFOSET = WA_RSRREPDIR-INFOCUBE BINARY SEARCH. IF SY-SUBRC = 0 . WA_ZRSQDETAIL-INFOP_TXTLG = WA_RSQISET-TXTLG. WA_ZRSQDETAIL-INFOAREA = WA_RSQISET-INFOAREA. WA_ZRSQDETAIL-INF_TYPE = 'Infoset'. ENDIF. * Get iobject details READ TABLE IT_RSDIOBJ INTO WA_RSDIOBJ WITH KEY IOBJNM = WA_RSRREPDIR-INFOCUBE BINARY SEARCH. IF SY-SUBRC = 0 . WA_ZRSQDETAIL-INFOP_TXTLG = WA_RSDIOBJ-TXTLG. WA_ZRSQDETAIL-INF_TYPE = 'InfoObject'. ENDIF. * Get infoarea details READ TABLE IT_RSDAREAT INTO WA_RSDAREAT

Page 8: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 8

WITH KEY INFOAREA = WA_ZRSQDETAIL-INFOAREA BINARY SEARCH. IF SY-SUBRC = 0. WA_ZRSQDETAIL-INFOAREA_TXTLG = WA_RSDAREAT-TXTLG. ENDIF. MOVE-CORRESPONDING WA_ZRSQDETAIL TO ZRSQDETAIL. * <Query_body>

ENDLOOP.

ABAP Program Selection Text

Maintain selection text for selection text elements.

Page 9: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 9

Info set

Create info set ZRSQDETAIL through transaction SQ02 in either global or standard environment.

Select data retrieval by program; provide data structure and external program name. Save and generate info set.

Correct the header for predefined fields in the structure. Change the technical name of header to correct description e.g. Infoprovider Type.

Page 10: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 10

Info set assignment to user group

For assigning the info set to user group, select Role/User group assignment in transaction SQ02

Page 11: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 11

SAP Query

Create SAP Query ZRSQDETAIL through transaction SQ01 by selecting user group BWUSER in the respective environment.

In the basic list select the sequence and sort order.

Page 12: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 12

Addition of SAP Query in menu

Below section gives guidelines to add SAP query to the menu “BW Support”

Create node “BW Support Tool” ZBW_TOOL through transaction SE43

Select “Add entry as sub node” and click on add report

Select generate automatically to get system generated T code

The menu is created.

Page 13: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 13

You can now execute the query created from the menu.

Using Info set Query

List of Standard BI Queries

If we require list of delivered BI queries related to Sales and Distribution info area , then run info set query with below selections

Below output list would be generated.

Page 14: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 14

List of customized BI Queries

If we require list of customized BI queries related to info provider then give selection for your info provider and run query.

Below output list would be generated.

Page 15: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 15

Related Content

SAP Business Intelligence help page

Important Tables in SAP BI

Creating T code for area menu

Page 16: List of BI Queries Based on Info Area and Info Provider

List of BI Queries Based on Info Area and Info Provider

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com

© 2011 SAP AG 16

Disclaimer and Liability Notice

This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.