Show TOC

Mapping File for BW ModeLocate this document in the navigation structure

The mapping file for an RFC input adapter running in BW mode contains entries for specifying how columns of the flattened data result set map to ESP streams.

You can also use the schema discovery functionality in ESP Studio to automatically create a mapping file. See Discovering Schema and Creating a Mapping File for the SAP RFC Adapter in the SAP Event Stream Processor: Studio Users Guide for detailed instructions on creating a mapping file in Studio. If you use Studio to create the mapping file, edit the generated mapping file by adding the <variables> element as this is not included.

A sample mapping file for BW mode is located in the $STREAMING_HOME/adapters/rfc/examples/bw directory.

In this mode, a mapping entry starts with a <bwQuery> element and contains a name attribute that indicates the name of the BW query executed against. The mapping definition is listed underneath the <mapping> element, with each <fieldMapping> element representing a mapping between a result set table column and the ESP column. The attribute name of the <fieldMapping> element is the name of the result set table name column (the unique name of the dimension) or CELL_VALUE for the measure/cell value, and an espField attribute. For example:
<bwQuery name="Z_BOBJ/QRY_VAR_M_MDT">
	<!-- sign values: including, excluding -->
	<!-- options values: eq, gt, ge, lt, le, ne -->
	<variables>
		<variable name="[Z_VAR004]" sign="including" options=”eq”>[Z_COUNTRY].[000000000000000000000000000015]</variable>
		<variable name="[Z_VAR004]" sign="including" options=”eq”>[Z_COUNTRY].[000000000000000000000000000067]</variable>
	</variables>
	<!-- field mapping name is the dimension unique name -->
	<!-- for measure/cell value, use name "CELL_VALUE" -->
	<mapping>
		<fieldMapping name="[Measures]" espField="Column1"/>
		<fieldMapping name="[Z_REGION]" espField="Column3"/>
		<fieldMapping name="CELL_VALUE" espField="Column4"/>
	</mapping>
</bwQuery>

The usage of the <variable> definition in BW mode is different from its usage in generic RFC mode. In BW mode, use the <variable> element to define all the SAP variables declared on the BW query, along with their details and values. The name and sign attribute are mandatory. The name attribute specifies the name of the SAP variable, and the sign attribute can either have a value of “including” or “excluding” based on the usage of the variable. The options attribute can have any of the following values: “eq”, “gt”, “ge”, “lt”, “le”, “ne”, and correspond to the operators allowed in the SAP variable clause (=, >, >=, <, <=, <>).

When queries are created in BW, you can define variables as part of the query and use them in data evaluation. You can provide values to these variables at runtime when MDX statements are being executed against the query. This is similar to running a parameterized SQL query in a relational database.

The adapter uses these <variable> definitions to create the appropriate SAP variable clause and append it to the MDX statement that you specify in the adapter configuration file.