Skip to Content

Another way to find the variables used in a query using query name without using any abap program.

Tip to find the queries which has external data access settings enabled in the Bex Query Designer.


Transaction – SE 16,

Tables Used

RSRREPDIR

RSZCOMPDIR

RSZELTDIR

RSZELTTXT

RSZELTXREF

RSZELTPROP


  1. In RSRREPDIR – Input the query name in COMPID , can use info cube input too.
  2. Input 1.COMPUID in RSZCOMPDIR.COMPUID to check the query Tech Name.
  3. Input 2.COMPUID in RSZELTDIR.ELTUID
  4. Input 3.ELTUID in RSZELTTXT.ELTUID to get the TXTLG – Query Description
  5. Input 4.ELTUID in RSZELTXREF.SELTUID to get the TELTUID (Variable UID) and Info Cube Technical Name. LAYTP says if its Variable or Sheet or SOB.
  6. Input 5.TELTUID in RSZELTTXT.ELTUID  to get the Variable Description – TXTLG

                Output of 5 which has SOB/SHT is ignored in this output.

   7. To find the type of variable input the output got from 6.ELTUID into RSZCOMPDIR.COMPUID , COMPID will give the Variable Type if Naming Conventions are followed.


/wp-content/uploads/2013/12/1_341474.png


/wp-content/uploads/2013/12/2_341475.png


/wp-content/uploads/2013/12/3_341476.png


5.PNG


/wp-content/uploads/2013/12/4_341478.png


6.PNG



7.PNG


Note : If the naming convention is followed for the variable types it can be easily identified.

eg : ZV_SV_O_FISCYR_CV – Characteristic Variable with selections and its Optional.




Finding queries has external data access settings


  1. Get COMPUID from RSRREPDIR

   2. Input 1.COMPUID = RSZELTPROP.ELTU ID with RFCSUPPORT = X and get the Query Tech Name.

   3. Input 2.ELTUID = RSZELTTXT.ELTUID get the Query Description

Thanks for reading, hope this helps a bit …

To report this post you need to login first.

9 Comments

You must be Logged on to comment or reply to a post.

  1. Mike Howles

    If you are curious to find the technical names of BEx Variables for a given query, you could also just execute the query and look at the tooltips on the selection screen, as an alternative:

    variable tech naem.png

    (0) 
  2. Mohammed Naveed

    Hi Suresh,

    Nice information. It could have been more self explainatory if you would have provided detalis like those are tables or tcodes and how to access them( for newbies).

    Nonetheless, good work!

    regards,

    Mohammed.

    (0) 
  3. Shanthi Bhaskar

    Here is the Corresponding Program for getting where used list of that variable…

    I thought this program would fit in this topic of interest.

    *&———————————————————————*
    *& Report  ZVARIABLEWHEREUSED
    *&
    *&———————————————————————*
    *&
    *&
    *&———————————————————————*

    REPORT  ZVARIABLEWHEREUSED.

    data: varid type SYSUUID_25.

    *Variable Information
    data: vname type RSZVNAM,
          variabletyp type RSZVARTYP,
          variobj type RSIOBJNM,
          varproctyp type RSZVPROCTP,
          varselection type RSZVPARSEL,
          varinput type RSZINPUT,
          varentry type RSRENTRYTP,
          varchange type RSZDYNCHANGE.

    CONSTANTS : c_program  LIKE sy-repid VALUE sy-repid.

    data: begin of queryuid occurs 1000,
    queryID type SYSUUID_25,
    end of queryuid.

    data: begin of viewtab occurs 1000,
      viewtechname type RSZWVIEWID,
      end of viewtab.

    data: querydets like line of queryuid,
          viewdetails like line of viewtab.

    data: begin of querydet occurs 1000,
    querytechname type RSZCOMPID,
    querydesc type RSTXTLG,
    end of querydet.

    data:querydetail like line of querydet.

    *Variable descriptions
    data: variabletype type string,
          varprocesstyp type string,
          varselectiontyp type string,
          varinputtyp type string,
          varentrytyp type string,
          varchangeable type string,
          variabledescription type string,
          viewdesc type string.

    *data: queryids type queryuid.

    ** Selection Screen
    SELECTION-SCREEN: BEGIN OF BLOCK blk1 WITH FRAME TITLE aaa.
    parameters: vnam type RSZVNAM.
    SELECTION-SCREEN: END   OF BLOCK blk1.

    AT SELECTION-SCREEN ON VALUE-REQUEST FOR vnam.

    ***F4 HELP
    data: begin of gt_display OCCURS 100,
          vnam like rszglobv-vnam,
          IOBJNM like rszglobv-IOBJNM,
          end of gt_display.

    select DISTINCT vnam IOBJNM from rszglobv into TABLE gt_display where objvers = ‘A’.

    CALL FUNCTION ‘F4IF_INT_TABLE_VALUE_REQUEST’
      EXPORTING
        retfield               =  ‘VNAM’
        dynpprog               =  c_program
        dynprofield            = ‘VNAM’
        dynpnr                 = sy-dynnr
       WINDOW_TITLE           =  ‘Report Variable’
        value_org       = ‘S’
      tables
        value_tab              = gt_display
    EXCEPTIONS
       PARAMETER_ERROR        = 1
       NO_VALUES_FOUND        = 2
       OTHERS                 = 3
              .
    ***
    START-OF-SELECTION.
    select single vnam vartyp iobjnm vproctp vparsel varinput entrytp dynchange
      into (vname, variabletyp, variobj, varproctyp, varselection, varinput, varentry, varchange)
      from rszglobv where vnam = vnam and objvers = ‘A’.

      case variabletyp.
        when 1.
          variabletype = ‘Characteristic Value’.
        when 2.
          variabletype = ‘Hierarchy Node’.
        when 3.
          variabletype = ‘Text’.
        when 4.
          variabletype = ‘Formula’.
        when 5.
          variabletype = ‘Hierarchy’.
        endcase.

    case varproctyp.
      when 1.
        varprocesstyp = ‘Replacement Path’.
      when 3.
        varprocesstyp = ‘Customer Exit’.
      when 4.
        varprocesstyp = ‘SAP Exit’.
      when 5.
        varprocesstyp = ‘User Entry / Default Value’.
      endcase.

    case varselection.
      when ‘P’.
        varselectiontyp = ‘Single Value (Parameters)’.
      when ‘S’.
        varselectiontyp = ‘Selection option’.
      when ‘I’.
        varselectiontyp = ‘Interval’.
      when ‘M’.
        varselectiontyp = ‘Multiple Single Values’.
      when others.
        varselectiontyp = ‘Default’.
      endcase.

    if varinput = ‘X’.
      varinputtyp = ‘Yes’.
      else.
      varinputtyp = ‘ No’.
      endif.

    case varentry.
      when 1.
        varentrytyp = ‘Mandatory Variable Entry’.
      when 0.
        varentrytyp = ‘Optional Variable Entry’.
       when 2.
         varentrytyp = ‘Mandatory , Initial Value Not Allowed’.
      endcase.

      if varchange = ‘X’.
      varchangeable = ‘Yes’.
      else.
        varchangeable = ‘No’.
        endif.

      write ‘Variable Name:’.
      write vname.
      write /.
      write ‘Variable Type:’.
      write variabletype.
      write /.
      write ‘Based on Infoobject:’.
      write variobj.
      write /.
      write ‘Variable Processing Type:’.
      write varprocesstyp.
      write /.
      write ‘Variable Select Parameters:’.
      write varselectiontyp.
      write /.
      write ‘Variable Ready for Input:’.
      write varinputtyp.
      write /.
      write ‘Variable Entry criteria:’.
      write varentrytyp.
      write /.
      write ‘Variable can be changed during navigation:’.
      write varchangeable.
      write /.
    *  write

    Select single varuniid from rszglobv into varid where vnam = vnam.

    select single TXTLG from RSZELTTXT into variabledescription where ELTUID = varid and OBJVERS = ‘A’.

    write ‘Variable Description:’.
    write variabledescription.
    write /.
    write /.
    querydet-querytechname = ‘Query Technical Name’.
    querydet-querydesc = ‘Query Description’.
    write querydet-querytechname.
    write querydet-querydesc.
    write /.

    Select SELTUID from RSZELTXREF into table queryuid where TELTUID = varid and laytp = ‘VAR’ and OBJVERS = ‘A’.

    loop at queryuid into querydets.

    select single compID from rszcompdir into querydet-querytechname where COMPUID = querydets-queryid and OBJVERS = ‘A’.
    select single txtlg from RSZELTTXT into querydet-querydesc where ELTUID = querydets-queryid and objvers = ‘A’.

      write querydet-querytechname.
      write querydet-querydesc.
      write /.
    *update querydet from querydetail.

    endloop.

    write ‘Query View Details for affected queries’.
    write /.
    viewtab-viewtechname = ‘View Technical Name’.
    viewdesc = ‘View Description’.
    write viewtab-viewtechname.
    write viewdesc.
    write /.

    clear viewtab.
    clear viewdesc.

    loop at queryuid into querydets.
    select single compID from rszcompdir into querydet-querytechname where COMPUID = querydets-queryid and OBJVERS = ‘A’.
    select viewid from rszwview into table viewtab where compid = querydet-querytechname and objvers = ‘A’.

    loop at viewtab into viewdetails.
      select single TXTLG from RSZWOBJTXT into viewdesc where objid = viewdetails-viewtechname.

        write viewdetails-viewtechname.
        write viewdesc.
        write /.
       endloop.
      endloop.

    *loop at querydet.
    *  write querydet-querytechname.
    *  write querydet-querydesc.
    *  endloop.

    (0) 
  4. Gilbert Seidel

    Hi all,

    to get variable Definition for a query you can use function module

    RSRD_MS_GET_VARIABLE_DEF.

    Take QU as object type and your technical Query-Name(not UID!) as ID.

    Thats it.

    Best

    Gilbert

    (0) 

Leave a Reply