Reply from sviszt on Feb 4 at 7:42 AM Hi, The table you are looking for is probably RSZELTXREF which contains the links between the structure elements. The below code should more or less display the main elements of a query in the technical hierarchy how it is stored. By the way, for structures you can use the where used list in query designer, you could trace what function is called in the background when executing the where used list. *&-----------* *& Report Z_QUERY_OVERVIEW *& *&--------------* *& *& *&--------------------* REPORT z_query_overview. PARAMETERS p_query TYPE rszcompid. PARAMETERS p_langu TYPE sy-langu DEFAULT sy-langu. DATA lv_compuid TYPE sysuuid_25. DATA lt_eltdir TYPE STANDARD TABLE OF rsz_x_eltdir. DATA lt_elttxt_ui TYPE STANDARD TABLE OF rsz_x_elttxt_ui. DATA lt_eltprop TYPE STANDARD TABLE OF rsz_x_eltprop. DATA lt_eltprio TYPE STANDARD TABLE OF rsz_x_eltprio. DATA lt_eltprio_2 TYPE STANDARD TABLE OF rsz_x_eltprio_2. DATA lt_eltattr TYPE STANDARD TABLE OF rsz_x_eltattr. DATA lt_eltxref TYPE STANDARD TABLE OF rsz_x_eltxref. DATA lt_compdir TYPE STANDARD TABLE OF rsz_x_compdir. DATA lt_compic TYPE STANDARD TABLE OF rsz_x_compic. DATA lt_select TYPE STANDARD TABLE OF rsz_x_select. DATA lt_range TYPE STANDARD TABLE OF rsz_x_range. DATA lt_calc TYPE STANDARD TABLE OF rsz_x_calc. DATA lt_cell TYPE STANDARD TABLE OF rsz_x_cel. DATA lt_var TYPE STANDARD TABLE OF rsz_x_var. DATA lt_uid_server TYPE STANDARD TABLE OF rsz_x_uid_server. DATA lt_elttxt TYPE STANDARD TABLE OF rszelttxt. DATA lt_hier_info TYPE STANDARD TABLE OF rsz_x_hier_info. DATA ls_eltdir TYPE rsz_x_eltdir. DATA ls_elttxt_ui TYPE rsz_x_elttxt_ui. DATA ls_eltprop TYPE rsz_x_eltprop. DATA ls_eltprio TYPE rsz_x_eltprio. DATA ls_eltprio_2 TYPE rsz_x_eltprio_2. DATA ls_eltattr TYPE rsz_x_eltattr. DATA ls_eltxref TYPE rsz_x_eltxref. DATA ls_compdir TYPE rsz_x_compdir. DATA ls_compic TYPE rsz_x_compic. DATA ls_select TYPE rsz_x_select. DATA ls_range TYPE rsz_x_range. DATA ls_calc TYPE rsz_x_calc. DATA ls_cell TYPE rsz_x_cel. DATA ls_var TYPE rsz_x_var. DATA ls_uid_server TYPE rsz_x_uid_server. DATA ls_elttxt TYPE rszelttxt. DATA ls_hier_info TYPE rsz_x_hier_info. START-OF-SELECTION. CALL FUNCTION 'RSZ_X_COMPONENT_GET' EXPORTING * I_GENUNIID = i_compid = p_query * I_COMPUID = i_objvers = 'A' * I_WITH_TEMPLATES = ' ' * I_BY_INFOCUBE = * I_TEMPLATE_TYPE = 'NIL' * I_VARIABLE_TYPES = * I_VARIABLE_INFOOBJECT = i_language = p_langu * I_USE_BUFFER = * I_QD_VERSION = ' ' i_designtime_call = 'X' IMPORTING e_compuid = lv_compuid * E_SUBRC = * E_BACKUP_EXISTS = TABLES c_t_eltdir = lt_eltdir c_t_elttxt_ui = lt_elttxt_ui c_t_eltprop = lt_eltprop c_t_eltprio = lt_eltprio c_t_eltprio_2 = lt_eltprio_2 c_t_eltattr = lt_eltattr c_t_eltxref = lt_eltxref c_t_compdir = lt_compdir c_t_compic = lt_compic c_t_select = lt_select c_t_range = lt_range c_t_calc = lt_calc c_t_cell = lt_cell c_t_var = lt_var c_t_uid_server = lt_uid_server c_t_elttxt = lt_elttxt e_t_hier_info = lt_hier_info. SORT lt_eltxref BY posn. CLEAR ls_eltxref. PERFORM print_element_information USING ls_eltxref lv_compuid 0. PERFORM print_subelements_recursive USING lv_compuid 0. *&------------* *& Form print_element_information *&------------* * text *------------* * -->UV_ELTXREF text * -->UV_ELTDIR text * -->UV_INDENT text *--------------* FORM print_element_information USING uv_eltxref TYPE rsz_x_eltxref uv_eltuid TYPE sysuuid_25 uv_indent TYPE i. DATA lv_indent TYPE i. DATA lv_string TYPE string. lv_indent = uv_indent + 25 + 2. "Read relevant records CLEAR ls_elttxt. READ TABLE lt_elttxt INTO ls_elttxt WITH KEY eltuid = uv_eltuid. CLEAR ls_elttxt_ui. READ TABLE lt_elttxt_ui INTO ls_elttxt_ui WITH KEY eltuid = uv_eltuid. CLEAR ls_eltdir. READ TABLE lt_eltdir INTO ls_eltdir WITH KEY eltuid = uv_eltuid. CLEAR ls_cell. READ TABLE lt_cell INTO ls_cell WITH KEY eltuid = uv_eltuid. CLEAR ls_eltprop. READ TABLE lt_eltprop INTO ls_eltprop WITH KEY eltuid = uv_eltuid. CLEAR ls_eltattr. READ TABLE lt_eltattr INTO ls_eltattr WITH KEY eltuid = uv_eltuid. CLEAR ls_var. READ TABLE lt_var INTO ls_var WITH KEY varuniid = uv_eltuid. "Leading node line WRITE: /uv_indent ls_eltdir-eltuid, 'type', ls_eltdir-deftp, 'subtype', ls_eltdir-subdeftp, 'as', ls_eltxref-laytp. "From here on subinformation with higher indent "Text WRITE: /lv_indent 'Description:', ls_elttxt_ui-txtlg. "Role of object within subobject CALL FUNCTION 'RSD_DOMA_FVAL_TXT_GET' EXPORTING i_domanm = 'RSZLAYTP' i_fval = uv_eltxref-laytp i_langu = sy-langu IMPORTING e_fval_txt = lv_string. WRITE: /lv_indent 'in role', lv_string. "Extra information for cells IF uv_eltxref-laytp = 'CEL'. CALL FUNCTION 'RSD_DOMA_FVAL_TXT_GET' EXPORTING i_domanm = 'RSZCELLTP' i_fval = ls_cell-celltp i_langu = sy-langu IMPORTING e_fval_txt = lv_string. WRITE: /lv_indent 'Cell type', lv_string. WRITE: /lv_indent 'Cell in junction of row', ls_cell-memuid1, ' and column ', ls_cell-memuid2. ENDIF. "Extra information for variables IF ls_eltdir-deftp = 'VAR'. WRITE: /lv_indent 'Variable name', ls_var-vnam. ENDIF. "Common information IF ls_eltprop-hienm IS NOT INITIAL. WRITE: /lv_indent 'Display Hierarchy:', ls_eltprop-hienm. ENDIF. "Formatting information WRITE: /lv_indent 'Formatting:', 'scaling:', ls_eltprop-num_scale, 'precision:', ls_eltprop-num_prec, 'signinversion:', ls_eltprop-signinv. "Selections and ranges WRITE: /lv_indent 'Selections: (iobj, type, const sel)'. LOOP AT lt_select INTO ls_select WHERE eltuid = uv_eltuid. WRITE: /lv_indent ' - ', ls_select-iobjnm, ls_select-contype, ls_select-constsel. ENDLOOP. WRITE: /lv_indent 'Ranges:'. LOOP AT lt_range INTO ls_range WHERE eltuid = uv_eltuid. WRITE: /lv_indent ' - ', ls_range-iobjnm, ls_range-attrinm, ls_range-seltp, ls_range-sign, ls_range-opt, ls_range-low(15), ls_range-high(15), '[', ls_range-hienm(15), ']', ls_range-hienmflag. ENDLOOP. ENDFORM. "print_element_information *&-----------* *& Form print_subelements_recursive *&-----------* * text *------------* * -->UV_ELTUID text * -->UV_INDENT text *-----------------* FORM print_subelements_recursive USING uv_eltuid TYPE sysuuid_25 uv_indent TYPE i. DATA lv_subindent TYPE i. lv_subindent = uv_indent + 6. LOOP AT lt_eltxref INTO ls_eltxref WHERE seltuid = uv_eltuid. PERFORM print_element_information USING ls_eltxref ls_eltxref-teltuid lv_subindent. PERFORM print_subelements_recursive USING ls_eltdir-eltuid lv_subindent. ENDLOOP. ENDFORM. "init_tree Von: SimonCrowder [mailto:email@removed] Gesendet: Dienstag, 04. Februar 2014 13:09 An: Sviszt Oliver Betreff: [sap-bw] Find Query using KF Structure ID Question from SimonCrowder on Feb 4 at 7:10 AM I have a UID of a Key Figure Structure (as you would see on the Proporties->Advanced section in BEx Query Designer). However I would like to know what RS* Tables I would use to identify which query (or queries) use this Key Figure Structure? I have tried the normal RS* Tables I know of and the only table I can see which references this UID is RSZELTDIR which seems to me just to indicate this is a structure, not which queries use this structure. Can anyone help? Regards Simon
| | | ---------------Original Message--------------- From: SimonCrowder Sent: Tuesday, February 04, 2014 7:10 AM Subject: Find Query using KF Structure ID I have a UID of a Key Figure Structure (as you would see on the Proporties->Advanced section in BEx Query Designer). However I would like to know what RS* Tables I would use to identify which query (or queries) use this Key Figure Structure? I have tried the normal RS* Tables I know of and the only table I can see which references this UID is RSZELTDIR which seems to me just to indicate this is a structure, not which queries use this structure. Can anyone help? Regards Simon | | Reply to this email to post your response. __.____._ | _.____.__ |