The starting point is represented by a BEx query similar to the one described in the first airline report. A remote function module is created to load the query data. Based on it, a web service is generated. This web service will be used by Xcelsius to load the query data into an Excel spreadsheet.
The BEx query rows are represented by calendar year/month entries. The columns have a two dimensional structure: CARRID (airline ids) with key figures representing total number of passengers per each flight class and total booking revenues. While this data row/column format makes perfect sense, it is not that easy to work with in Xcelsius when trying to mimic pivot table functionality. A more Xcelsius friendly data format, can have the following column structure:
Month, Airline, Economy, Business, First class, Total revenues
Rows with the above columns can be more easily used in spreadsheet functions, and do not require any more formatting in the Xcelsius environment. Year column is not present because the BEx query has a filter to only show results from 2009. Booking year is not a variable in this scenario.
To have the query data formatted in this Xcelsius friendly format, a remote function module based on RRW3_GET_QUERY_VIEW_DATA is created. It can handle multidimensional BEx query columns by getting the available dimensions from e_axis_info parameter. The list of column entries can be found in the e_axis_data parameter. Because of the multidimensional BEx column, not all column entries have a corresponding value entry in the e_cell_data parameter. The trick is to figure out which column entries have cell values and which don’t based on the column entry dimension. Think of the airline column entries as 1st level dimension and the corresponding key figures of the current airline as 2nd level dimensions. Only 2nd level column entries have corresponding cell values.
Besides correctly parsing the BEx query data, we also need to “brake” BEx query rows each time the 1st level dimension changes – each time we’re parsing a different airline key figure at a given year/month. The BEx query data has all the airlines on each row; the Xcelsius data needs only one airline per row.
With the correct code in place (attached to the main article) it’s only a matter of creating a web service from the remote function module and via SOAMANAGER get its WSDL address to be used by Xcelsius to load the query data.
Xcelsius exports reports under the SWF flash file format following flash player security policies. Latest flash player 10 security policies require a crossdomain.xml policy file to be present on the domain data is being requested from. Since we’re trying to load a web service from the abap stack, not having a crossdomain.xml file under domain’s root will result in a flash security error with a corresponding error #2032 in Xcelsius. A previous post describes ways of adding this crossdomain.xml policy file.
This post is part of SWF Airline Report.