Skip to Content

In this document, we will see about QUERY_VIEW_DATA webservice and the methods and input and output parameters required for this Web service. Also the testing procedure will be explained.

Web Service for Accessing Query Data:

Please note the tables and information here are taken from help.sap.com.

QUERY_VIEW_DATA webervice is mainly used to extract the data from the result set for a query or query view in XML format. The Web service has to be released with the SAP Web Service Infrastructure.

In the following table, the methods and input and output parameters required for the Web service are shown:

Methods

Description

GetQueryViewData

This method serves to request the query or query view data.

Input Parameter

Description

Infoprovider

Query

ViewId

Parameter (optional)

To specify the query use the parameters InfoProvider and Query. To specify the query view, use the parameter ViewId.

The Parameter parameter allows you to set Data Provider Commands  from the Web API reference (for example, filters or setting a navigation status) as a name/value pair.

Output Parameter

Description

AxisData

AxisInfo

CellData

TextSymbols

You will find a detailed description of the output parameters under

Datasets – SAP Business Information Warehouse – SAP Library

Definition of  Output Parameter

AXIS_DATA

The component AXIS_DATA describes the contents of the axis. AXIS_DATA is a table with the following structure:

AXIS_DATA Description
AXIS Axis ID
0 : Columns
1 : Rows
255 : Filters
SET Axis contents

AXIS_INFO

This component describes the properties of the structures, characteristics, and attributes, and how they are distributed between the axes. The AXIS_INFO is a table of axes (rows, columns, and filters) with the appropriate axes components.

AXIS_INFO Description
AXIS Axis ID
0 : Columns
1 : Rows
255 : Filters
NCHARS Value cells
The cells are arranged by row first, and then by column.
NCOORDS Number of objects on the axis (number of rows / columns / filter values)
CHARS Characteristics with their attributes and structures on the axis.

CELL_DATA

The CELL_DATA component describes the value cells.

The number cells of the query view are given as the assigned table of rows for BAPI type BAPI6111CD. If you display the query view data as a table, the assignment of cells corresponds to that of the data block, in which the assignment is run first using the rows and then using the columns.

The index of a specific value is therefore calculated as follows:

Index = Column position + (row position – 1)* number of columns

TXT_SYMBOLS

The component TXT_SYMBOLS describes the text elements of the query. The text elements are available as a table made up of RRX_TXT_SYMBOLS rows.

Scenario :

We will see how to execute the webservice in internally in BW system and will see how the data is being fetched from the query or query view.

1. Go to the tcode SOAMANAGER and select the tab Business Administration.

Web Service 1.jpg

2. Click on Web Service Administration and search for QUERY_VIEW_DATA webservice.

Web Service 1.jpg

3. Select the werbservice QUERY_VIEW_DATA and click on Apply Selection button. Now it will show the properties of the webservice. Select the option “Open WSDL document for selected binding”

Web Service 1.jpg

4. Login to the system and click on queryviewdata webservice navigator.

Web Service 1.jpg

Web Service 1.jpg

Web Service 1.jpg

5. Here we need to enter the appropriate inputs to request the data from the qweu view data webservice. Below the sample input request.

<tns1:GetQueryViewData

      xmlns:tns1=”urn:sap-com:document:sap:soap:functions:mc-style”>

  <Infoprovider>ZZ_SAMPLE_INFOCUBE</Infoprovider> ** Enter the info provider name which is the source of the query

  <Parameter>

    <item>

      <Name>FILTER_IOBJNM_1</Name> ** Enter the info object name which would be the filter for the query to restrict the values.

      <Value>0DOC_NUMBER</Value>

    </item>

    <item>

      <Name>FILTER_VALUE_LOW_1</Name> ** From and To range for the mentioned info object

      <Value>10000000</Value>

    </item>

    <item>

      <Name>FILTER_VALUE_HIGH_1</Name>

      <Value>10000025</Value>

    </item>

  </Parameter>

  <Query>ZZ_SAMPLE_QUERY</Query> ** Technical name of the query

</tns1:GetQueryViewData>

6. After clicking on SEND button the input values will be passed to the query and data will be extracted. You can be able to see the response the right side.

Web Service 1.jpg

7. Data will be stored in the pre defined output parameters as discussed above. We can view and check the data quality be checking inside the parameters Axis Data, Axis Info, Cell Data and Text Symbols. In the output parameters, column values will be stored under the axis 0, and row values will be stored under 1. What ever filter used to restrict the query results would be visible under the axis 255.

Hope this document will be useful.

BR

Dinesh

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply