Child pages
  • Report to show original system of query components
Skip to end of metadata
Go to start of metadata

Purpose

To be able to find the original system of query elements with ease.

Overview

Queries can only be changed when certain conditions are true,  the user has authorization for all the components and if the setting is made "changeable in original system" then all the components need to have been created in the system.

This can be frustrating for users who cannot find which component is stopping the change access and which system it may be changed in.  Beacuse of this I have created the report below,

Use

Execute the report in SE38, In the fields enter the Query you want to check and the system that you would like to check this in (This will default to the current system)

In the Example I have enter Q93 and the query name.

 When the results appear, the query components that have a different original system than specificied appear in red.  Some additional info such as development class, element ID and a description of the data will appear.

Report

*&---------------------------------------------------------------------*

*& Report ZBK_FIND_QUERY_ELEM_ORG_SYS

*& To find the original system of all query components

*& Brian Keenan June 2012

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT ZBK_FIND_QUERY_ELEM_ORG_SYS.

************************* Types **************************************

TYPES:

BEGIN OF ls_output,

compid(30) TYPE c, "Elememt technical name

txtlg TYPE string, "Element

author TYPE xuauthor, "Author

system(20) TYPE c, "original system

devclass TYPE DEVCLASS,

END OF ls_output.

DATA: go_alv TYPE REF TO cl_salv_table,

go_columns TYPE REF TO cl_salv_columns,

go_funcs TYPE REF TO cl_salv_functions,

go_ex TYPE REF TO CX_ROOT.

************************* Internal Tables ******************************

DATA:

lt_output TYPE STANDARD TABLE OF ls_output,

lt_rszeltdir TYPE STANDARD TABLE OF RSZ_X_ELTDIR.

**************** Work Areas **********************************

DATA:

wa_output TYPE ls_output,

wa_rszeltdir TYPE RSZ_X_ELTDIR,

wa_tadir TYPE tadir.

************************************************************************

* SELECTION SCREEN DETAILS

************************************************************************

*

* Select from the char and the hierarchy name, the char is only useful

* to help locate the hierarchy, it is not obligatory.

*

SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

PARAMETERS: p_sys TYPE SYSNAME DEFAULT SY-SYSID OBLIGATORY.

PARAMETERS p_query LIKE RSZCOMPDIR-COMPID DEFAULT 'STATS_NAV' OBLIGATORY.

SELECTION-SCREEN END OF BLOCK blk1.

************************************************************************

* Get the query elements based on the in put values

************************************************************************

CALL FUNCTION 'RSZ_X_COMPONENT_GET'

EXPORTING

I_COMPID = p_query

TABLES

C_T_ELTDIR = lt_rszeltdir.

IF sy-subrc <> 0.

* No Query components found

MESSAGE 'No query components found' TYPE 'I'.

EXIT.

ENDIF.

************************************************************************

* *Add the header item

************************************************************************

CLEAR: wa_output.

wa_output-compid = 'Element ID'.

wa_output-DEVCLASS = 'Dev Class'.

wa_output-author = 'Author'.

wa_output-system = 'Original System'.

wa_output-txtlg = 'Description'.

APPEND wa_output TO lt_output.

************************************************************************

* *loop through the element updating texts and find the original system etc.

************************************************************************

LOOP AT lt_rszeltdir INTO wa_rszeltdir.

CLEAR: wa_output.

*Lets change the text depending upon the element

CASE wa_rszeltdir-DEFTP.

WHEN 'FML'.

CONCATENATE 'Formula: ' wa_rszeltdir-txtlg INTO wa_output-txtlg SEPARATED BY ' '.

WHEN 'VAR'.

CONCATENATE 'Variable: ' wa_rszeltdir-txtlg INTO wa_output-txtlg SEPARATED BY ' '.

WHEN 'SEL'.

CONCATENATE 'drilldown item: ' wa_rszeltdir-DEFAULTHINT INTO wa_output-txtlg SEPARATED BY ' '.

WHEN 'SOB'.

CONCATENATE 'Query Filter Area' wa_rszeltdir-txtlg INTO wa_output-txtlg SEPARATED BY ' '.

WHEN 'SHT'.

CONCATENATE 'Query Sheet' wa_rszeltdir-txtlg INTO wa_output-txtlg SEPARATED BY ' '.

WHEN 'STR'.

CONCATENATE 'Structure ' wa_rszeltdir-txtlg INTO wa_output-txtlg SEPARATED BY ' '.

WHEN 'REP'.

CONCATENATE 'Query Report: ' wa_rszeltdir-txtlg INTO wa_output-txtlg SEPARATED BY ' '.

WHEN OTHERS.

CONCATENATE 'Other Item: ' wa_rszeltdir-txtlg INTO wa_output-txtlg SEPARATED BY ' '.

ENDCASE.

* get the transport information of the elements

SELECT * FROM TADIR INTO wa_tadir WHERE

PGMID = 'R3TR' AND

OBJECT = 'ELEM' AND

OBJ_NAME = wa_rszeltdir-eltuid.

ENDSELECT.

IF sy-subrc = 0.

wa_output-compid = wa_tadir-OBJ_NAME.

wa_output-devclass = wa_tadir-devclass.

wa_output-author = wa_tadir-AUTHOR.

wa_output-system = wa_tadir-SRCSYSTEM.

ENDIF.

APPEND wa_output TO lt_output.

ENDLOOP.

************************************************************************

* *Output the data in a formatted list.

***********************************************************************

LOOP AT lt_output into wa_output.

IF wa_output-system = 'Original System'.

FORMAT COLOR COL_HEADING INTENSIFIED ON.

ELSEIF wa_output-system <> p_sys.

FORMAT COLOR COL_NEGATIVE INTENSIFIED ON INVERSE ON.

ELSEIF wa_output-system = p_sys.

FORMAT COLOR COL_POSITIVE INTENSIFIED ON INVERSE ON.

ENDIF.

WRITE: / wa_output-compid, wa_output-devclass, wa_output-author, wa_output-system, wa_output-txtlg.

Related Notes

Insert links to any related notes/KBA that support your topic or are related

  • No labels