Skip to Content
avatar image
Former Member

Pass the Parameter Bex Analyzer With the Help of VBA

Hi All,

I have to run more than 1000 reports every month, Now I am entering criteria to the variable manually in pop up window. Now, how I can pass the parameter i.e. month/Year and some ID in the Bex Analyzer with the help of VBA so that I don't have to manually enter it in the pop up window?

And where is the variable values actually stored in workbook?

Thanks in advance guys.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Jul 08, 2013 at 03:21 PM
    Add comment
    10|10000 characters needed characters exceeded

  • Jul 08, 2013 at 04:39 PM

    Hi Mohamed,

    Can you please let us know the reason for executing 1000 reports manually? Why are you not using broadcast techniques? You can make use of the TVARVC tables if you can save variants for your input variables.

    Benedict

    Add comment
    10|10000 characters needed characters exceeded

    • Mohamed,

      I would definitively explore the BEx broadcasting option as suggested above by Benedict. You have several options like using variants or using control query to apply filters as explained here http://help.sap.com/saphelp_nw73/helpdata/en/64/c674402a71d162e10000000a155106/content.htm. With broadcasting, you can distribute reports by mail or publish them in a portal.

      If you want to use VBA, please follow the instructions in the blog mentioned above. Once you have inserted a button to execute the PROCESS_VARIABLE command, just start recording a macro and do the following: modify variable values in the Excel sheet that contains the PROCESS_VARIABLE commands (e.g. cells C7 and C8 in the blog) and then click on the button you inserted to refresh the report.

      When you stop recording, you'll end up with VBA code that looks like that (obviously filename are going to be different as well as cell references. Don't forget to add single quote in front of variable values like month):

      Sheets("Sheet1").Select

      Range("C7").Select

      ActiveCell.FormulaR1C1 = "'05.2013"

      Range("C8").Select

      ActiveCell.FormulaR1C1 = "'06.2013"

      Application.Run "TEST.xls!Sheet4.BUTTON_33_Click"

      You can now adapt this VBA code to pass variable values from another Excel sheet or whatever technique you'd like to use.

      Hope this helps.

      François.

  • avatar image
    Former Member
    Jul 10, 2013 at 11:22 AM

    Why don´t you save these selections as "favorite selection" in your BEx-Analyzer variable screen for this characteristic ?

    Add comment
    10|10000 characters needed characters exceeded