Reading data from existing SAP BW Queries is done by using standard functions from SAP. The best part is that you don’t need to change anything on the existing Queries in SAP BW. You just fetch the data needed with a set of selection criteria and in return you get data from SAP BW. ready to use in Charting or Tables with Neptune.

It can be done with remote function call from ERP or directly on SAP BW. Doing it from ERP means you can merge real-time data with data from SAP BW. F.eks ordering goods for your store (purchase order/store order) you can easily show sales statistics for the last week/month. In-store computing on your tablet could be made easy.

Example code

data: it_parameter   type rrxw3tquery,
      it_axis_info   type rrws_thx_axis_info,
      it_cell_data   type rrws_t_cell,
      it_axis_data   type rrws_thx_axis_data,
      it_txt_symbol  type rrws_t_text_symbols,

      wa_parameter   like line of it_parameter,
      wa_axis_info   like line of it_axis_info,
      wa_cell_data   like line of it_cell_data,
      wa_axis_data   like line of it_axis_data,
      wa_txt_symbol  like line of it_txt_symbol.

* lv_matnr and lv_werks is just an example.
* Important to get the parameter structure correct
* a bit different than normal select ranges in ABAP

* Set Parameters - Example PLANT
  wa_parameter-name  = 'VAR_NAME_1'.
  wa_parameter-value = '0SWERKS'.
  append wa_parameter to it_parameter.

  wa_parameter-name  = 'VAR_SIGN_1'.
  wa_parameter-value = 'I'.
  append wa_parameter to it_parameter.

  wa_parameter-name  = 'VAR_OPERATOR_1'.
  wa_parameter-value = 'EQ'.
  append wa_parameter to it_parameter.

  wa_parameter-name  = 'VAR_VALUE_LOW_EXT_1'.
  wa_parameter-value = lv_werks. 
  append wa_parameter to it_parameter.

* Set Parameters - Example MATERIAL
  wa_parameter-name  = 'VAR_NAME_2'.
  wa_parameter-value = '0SMATERIAL'.
  append wa_parameter to it_parameter.

  wa_parameter-name  = 'VAR_SIGN_2'.
  wa_parameter-value = 'I'.
  append wa_parameter to it_parameter.

  wa_parameter-name  = 'VAR_OPERATOR_2'.
  wa_parameter-value = 'EQ'.
  append wa_parameter to it_parameter.

  wa_parameter-name  = 'VAR_VALUE_LOW_EXT_2'.
  wa_parameter-value = lv_matnr.
  append wa_parameter to it_parameter.

* Get BW Data
  call function 'RRW3_GET_QUERY_VIEW_DATA'
    destination 'Your remote SAP BW destination from SM59'
    exporting
      i_infoprovider                = 'Your BW Infoprovider'
      i_query                       = 'Your BW Query'
      i_t_parameter                 = it_parameter
    importing
      e_axis_info                   = it_axis_info
      e_cell_data                   = it_cell_data
      e_axis_data                   = it_axis_data
      e_txt_symbols                 = it_txt_symbol
    exceptions
      no_applicable_data            = 1
      invalid_variable_values       = 2
      no_authority                  = 3
      abort                         = 4
      invalid_input                 = 5
      invalid_view                  = 6
      others                        = 7.

* Data is now available in it_cell_data for your further processing