Skip to Content
author's profile photo Former Member
Former Member

SAPBEXshowTextElements not working properly.

My goal is to show text elements on a separate worksheet in a BW workbook.

I have implemented the following code in a VBA user exit in BEx. This doesn't work when I have both selectGroup, and myRangeA is parameters to the standard SAPBEXshowTextElements function which is described in the online documentation. It is supposed to accept two arguments. If I leave out the second argument, the text elements do display. I want them to display on another worksheet and am going to pass that as the active sheet. This second argument should allow me to do that. I believe this function isn't working properly. Can anyone advise.

Sub SAPBEXonRefresh(queryID As String, resultArea As Range)

Run (Get_text_ElemA)

End Sub

Function Get_text_ElemA()

Dim selectGroup As String

Dim myRangeA As Range

selectGroup = "C"

Set myRangeA = ActiveSheet.Range("F7")

If Run("SAPBEXshowTextElements", selectGroup, myRangeA) = 0 Then


MsgBox "Error in Textelements"

End If

End Function

I know that I can cut and paste text elements. The reason I'm trying to do this is we want a global workbook template (similar to 0QUERY_TEMPLATE on the web). This way, workbook maintenance is centralized. There is a table RSRWBTEMPLATE which has the list of users and the assigned workbook. I can update this with a simple ABAP program:


parameter wbid like rsrwbindex-workbookid.

tables: rsrwbtemplate, usr01.

select * from usr01.

rsrwbtemplate-templateuser = usr01-bname.

rsrwbtemplate-workbookid = wbid.

update rsrwbtemplate.

if sy-subrc <> 0. insert rsrwbtemplate. endif.


After that, we need to update the registry of each user's machine to use this workbook template which we are going to do with a network logon script (or include it as part of the GUI install on new machines). I have created a registry update file to distribute. A user can just run this to update their machine, or it can be done via a logon script. Anyway, they want text elements on the second page, and I want it to happen on the refresh of a query using this standard workbook template.

Any thoughts?

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Jul 28, 2004 at 05:53 AM


    what is the error, which is returned?

    -1 or >1

    if -1 (in my opinion thats the most likely case): This indicates, that your cell F7 is not the correct context. You should verify this.

    (The cell should indicate to the query title, to the result area, or to the navigation/filter area).

    If > 1 then use function SAPBEXgetErrorText() to get the error text.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      The error is -1. What is the syntax to specify in relation to the query title? Also, does this mean that I can't move the text elements to the second worksheet?