2 Replies Latest reply: Jul 28, 2010 10:45 AM by Matthias Gemmel RSS

BEx workbook with query view - how to display the view name?

Andreas Appelt
Currently Being Moderated



you can display the query description and also the technical query name using a text item.

But how can I display the name of a view which is used as a data provider?


I would like to add the view name above my analysis grid because there are many analysis grids in my workbook.  It would be also nice, if the view name would be displayed in the variable screen (and not the name of the query). I can rename the logical names of the dataprovider (instead DP_1 for example "my view") and in this way at least the variable screen would show this description. But that's not really comfortable. And this would not help me to show the view names above my grids somewhere on the sheet.


Any ideas?


Thanks a lot.


BR, Andreas

  • Re: BEx workbook with query view - how to display the view name?
    Jörg Böke
    Currently Being Moderated

    Hi Andreas

    this is a funny but sad functionality within BEx workbooks.


    There is no SAP way (I found out so far) to read the name of the view.


    What you can do is as following:

    When opening a Query-View by help of the open query functionality you will select a View.

    Now BEx grabs the workbook template and in default condition runs the SAP macro CALLBACK.

    Here is exactely the point of interest.

    Just (for testing) insert a VBA Command 'STOP' in the first lnes and reopen another Query View.

    You will see that the initial name of the View (technical name) will be displayed in the Excel Caption ( the Header Line in Excel, above the menue entries).

    After finishing the CALLBACK macro Bex default functionality will change the caption back to Query name.


    The Callback macro will set the Header of the table and Chart sheet as well (see Coding)

    ' Adapt Title in Title Box

    Sheet2.Shapes("TextQueryTitle").DrawingObject.Text = Sheet2.Range("E1").Value

    Sheet3.Shapes("TextQueryTitle").DrawingObject.Text = Sheet2.Range("E1").Value


    So what I sometimes do, if View name is required ( at least the technical name ( make it human friendly) is to use the functionality of VBA to save the caption name in a hidden cell (similar to SAP coding above)


    Just use the coding: Cells(26, 4).Value = Application.Caption

    (Where (cells26,4) means row 26 and column D) and change it to a hidden cell.

    By help of VBA you can get rid of the prefix ('Microsoft Excel -' as well


    A final display could be:

      Sheet2.Shapes("TextQueryTitle").DrawingObject.Text = Mid(Application.Caption, 19, 50)

       Sheet3.Shapes("TextQueryTitle").DrawingObject.Text = Mid(Application.Caption, 19, 50)


    I know this is a workaround but at least a workarround.


    Another enhancement is to call a RFC call to retrieve the View text by help of this key.


    If you are looking for this feature as well let me know


    If this little excursion into BEx functionality helps I am pleased


    Best regards


    Joerg Boeke  BI Analyst