cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to programmatically set SAP BW Query Variables in BEx Analyzer via VBA (BEx 7.x / SAP GUI 7.6)

andzessi
Discoverer
0 Likes
260

Hello everyone,

I’m facing the following issue and have not been able to find an officially supported solution.

Problem Description:

I am using BEx Analyzer 7.x (SAP GUI 7.60, BW 7.x) to execute BW queries from Excel.

I need to programmatically set BW Query variables before running or refreshing a workbook.

The workbook is opened either through:

BEx Analyzer → Open Workbook → Roles → “Standard Price: Creation”, or through a VBA call: application.run “BExAnalyzer.xla!xBEXapi.OpenWorkbook”, "technical_workbook_name"

Immediately after opening, the Variable Screen appears, and only after manually entering the parameters, the BEx Analyzer workbook (“Standard Price List”) is generated.

Normally, the user fills in the Variable Screen manually.

I need to automatically set several BW Query variables using a VBA macro, either:

  • before the Variable Screen appears, or
  • by programmatically filling in the Variable Screen.

However, I cannot find a reliable or documented way to set variables via VBA.

Question:

What is the correct and officially supported way to programmatically set BW Query variables in BEx Analyzer 7.x using VBA?

Any clarification on:

  • which COM/OCX interfaces support variable assignment,
  • whether it is possible to pass variable values before the Variable Screen is triggered,
  • whether the Variable Screen can be filled programmatically,
  • how the variables structure (Range/array) should look,
  • and where to find documentation for SetVariables, AddVariables, VariableTable, and ExcelInterface

would be greatly appreciated.

P.S.

I am just starting with SAP BEx automation.

I found the technical names of variables through Variable Screen settings and Query Designer. Tracing is limited due to role restrictions.

Thank you in advance!

Accepted Solutions (0)

Answers (0)