The information from this document will help you customize the

advertisement

The information from this document will help you customize the SapMetaData.xml file for your SAP system.

For assistance with SAP related specific questions (Functionality, Connectivity,

Environmental, etc.) please defer to your SAP Administrator.

The SapMetaData.xml configuration file, for each type of the supported SAP object classes (i.e. SAP Users and SAP Employees), comprises the Operations XML element that defines all operations supported for this SAP object class. The Operations element has the following basic child Operation elements:

The Operation element describing the Get operation: Defines the SAP connector schema (i.e. all supported attributes for this SAP object class) and

BAPI calls used to calculate those attributes. To extend the connector Schema, you must make changes to this element.

The Operation elements for other operations except the Get operation:

Each element defines an operation and a stack of BAPI calls the operation uses.

This section describes the XML configuration file format, supported XML elements (see

“XML Elements” later in this document), and provides a snippet of the

SapMetaData.xml file that illustrates how to add a new custom attribute for a SAP

Employee object (see “Extending the SAP Connector Schema” later in this paper).

Extending the SAP Connector Schema

The SAP Connector Schema defines all supported SAP object classes and attributes.

For each SAP object class, the connector schema is defined in the Operation element

(for Get operation). In the SapMetaData.xml file, there are two Operation elements describing the connector schema:

<operation name=”Get” enumerator=”GetEmployeeList”> (for SAP Employees) and

<operation name=”Get” enumerator=”GetUserList”> (for SAP Users).

To extend the connector schema, you must perform the following three basic steps:

1.

Specify the new attribute name and optionally display name.

To do this, use the attribute element. For example, the following attribute element adds the new attribute “Status”:

<attribute name="Status" displayName="Employee Status">

2.

Specify how to calculate value of a newly added attribute.

To do this, use the attributeBinding element that is the child element of the

attribute, for example:

<attributeBinding bindingType="outerParameter" sourceCall="GetEmployeeStatus" bindTo="EMP_STAT_STRING"/>

In this scenario, the “Status” attribute will be calculated using the

EMP_STAT_STRING output parameter of the GetEmployeeStatus BAPI call.

3.

Define a call used to calculate the newly created attribute.

To do this, use the call element. For example, the following call element describes the GetEmployeeStatus BAPI call:

<call name="GetEmployeeStatus" nativeName="ZHR_GET_EMPLOYEE_STATUS" callType="bapi">

Under the call element, you must use the child elements <inputParameters> and <outputParameters> that define the input and output parameters of the

call.

Let us consider detailed steps to extend the SAP connector schema.

To add a new attribute to a list of supported SAP User or SAP Employee attributes, perform the following steps:

1.

Open the delivered SapMetaData.xml file with any XML editor.

2.

To add a new attribute for SAP Employee, find the <operation name=”Get”

enumerator=”GetEmployeeList”> element

-- OR --

To add a new attribute for SAP User, find the <operation name=”Get”

enumerator=”GetUserList”> element.

3.

Under the <operation name=”Get” …> element, find the child element

attributes that describes a collection of supported attributes, and add a new child element attribute that describes the attribute you want to add.

4.

For the attribute element, add the child element attributeBinding that describes how to calculate the newly added attribute.

This element must specify the attribute binding type, the name of the BAPI call

and the BAPI call parameter used to calculate the attribute value.

5.

Add the appropriate call element that describes the BAPI call used to calculate the attribute value.

The call element has the InputParameters and OutputParameters child

elements that describe the input and output parameters of the BAPI call.

6.

For each input parameter described with the InputParameter element, add the child element parameterBinding that specifies how to calculate the input parameter value.

7.

Save changes to the SapMetaData.xml file.

To clarify the above procedure, consider the following snippet of the SapMetaData.xml file that illustrates how to add the custom attribute "Status" that contains the SAP

Employee status. In this scenario, the Status attribute value is calculated using the

EMP_STAT_STRING output parameter of the GetEmpoyeeStatus BAPI call.

For detailed description of XML elements used in this sample, refer to the “XML

Elements” section later in this paper.

<sapType name="SAP Employee">

<operations>

<operation name="Get" enumerator="GetEmployeeList">

<attributes>

<attribute name="Status" displayName="Employee Status">

<attributeBinding bindingType="outerParameter" sourceCall="GetEmployeeStatus" bindTo="EMP_STAT_STRING"/>

</attribute>

</attributes>

<calls>

<call name="GetEmployeeStatus" nativeName="ZHR_GET_EMPLOYEE_STATUS" callType="bapi">

<inputParameters>

<inputParameter name="PERNR">

<parameterBinding bindingType="outerParameterEnumerator" sourceCall="GetEmployeeList" bindTo="PERSONAL_DATA.PERNO"/>

</inputParameter>

<inputParameter name="QUERY_DATE">

<parameterBinding bindingType="currentDate"/>

</inputParameter>

<inputParameter name="LANG">

<parameterBinding bindingType="value" bindTo="E"/>

</inputParameter>

</inputParameters>

<outputParameters>

<outputParameter name="EMP_STAT_STRING"/>

</outputParameters>

</call>

</calls>

</operation>

</operations>

</sapType>

XML Elements

This section provides a list of XML elements you can use in the SapMetaData.xml file.

For each elements, the list includes the element name, element description, parent

element, child elements (if any), the element attributes (if any).

Name: sapMetaData

Description: The root XML element.

Parent element: None

Child elements: sapTypes

Attributes: None

Name: sapTypes

Description: Describes a collection of supported types (classes) of SAP objects.

Parent element: sapMetaData

Child elements: sapType

Attributes: None

Name: sapType

Description: Contains the supported SAP object type.

Parent element: sapTypes

Child elements: operations

Attributes:

Name name

Description

The SAP object type. Possible values:

 "SAP User"

 "SAP Employee"

Name: operations

Description: Describes a collection of operations supported for the appropriate SAP object type.

Parent element: sapType

Child elements: operation

Attributes: None

Name: operation

Description: Describes the operation for the SAP object type.

Parent element: operations

Child elements: attributes, calls

Attributes:

Name name enumerator

Description

The operation name.

Used only for "Get" operation. Contains the name of the BAPI call that receives the data list. For example, this attribute can take the following values:

"GetUserList" (for SAP Users)

"GetEmployeeList" (for SAP

Employees) rootcall Specifies the name of BAPI call that is an entry point for call stack.

Example of use:

<operation name="Get" enumerator="GetUserList">

--- OR ---

<operation name="Update" rootCall="UpdateUser">

Name: attributes

Description: Used only for "Get" operation. Describes the collection of SAP object attributes.

Parent element: operations

Child elements: attribute

Attributes: None

Name: attribute

Description: Describes the SAP object attribute.

Parent element: attributes

Child elements: attributeBinding

Attributes :

Name name displayName

Description

The attribute name. isSingleValued

The attribute display name.

When False, specifies that the attribute is a multi-valued attribute.

Default value: True

Example of use:

<attribute name="UserRoles" isSingleValued="False">

Name: attributeBinding

Description: Describes the attribute calculation procedure, such as the attribute binding type and the BAPI call used to calculate the attribute value.

Parent element: attribute

Child elements: None

Name bindingType sourceCall

Description

Specifies the attribute binding type.

Possible values:

"outerParameter": Dynamic binding, when the attribute value is calculated basing on an output parameter of the specified BAPI call. The BAPI call is specified in the sourceCall attribute while the output parameter name is set in the bindTo attribute.

"value": Static binding, when the attribute value is set to a constant.

Used only if bindingType is set to

"outerParameter." Specifies the name of the BAPI call used to calculate the attribute value. bindTo  If bindingType is set to

"outerParameter," specifies the parameter name.

 If bindingType is set to "value," specifies the attribute value (a string constant).

Example of use:

<attribute name="FirstName">

<attributeBinding bindingType="outerParameter" sourceCall="GetUserDetails" bindTo="FirstName"/>

</attribute>

Name: calls

Description: Describes a collection of BAPI calls available for a given operation.

Parent element: operation

Child elements: call

Attributes: None

Name: call

Description: Describes a BAPI call available for a given operation.

Parent elements: calls

Child elements: InputParameters, OutputParameters

Name name nativeName

Description

The BAPI call friendly name. callType

Used only for BAPI calls. Contains the RFC name for BAPI call.

Specifies the call type. Possible values:

 "complex": Specifies a custom call.

 "bapi": Specifies a BAPI call.

Name: InputParameters

Description: Describes input parameters of the BAPI call.

Parent element: call

Child elements: InputParameter

Attributes: None

Name: InputParameter

Description: Describes the input parameter of the BAPI call.

Parent element: InputParameters

Child elements: parameterBinding

Attributes:

Description Name name isData isKey

Specifies the parameter name.

When TRUE, specifies that this parameter is a data parameter.

Default value: TRUE.

When TRUE, specifies that this parameter is a key parameter. type

Default value: FALSE.

Specifies the parameter type. Possible values:

 "table"

 "structure"

 "string"

Default value: "string"

Name: parameterBinding

Description: Describes the input parameter calculation procedure, such as the attribute binding type and the BAPI call using which the parameter will be calculated.

Parent element: InputParameter

Child elements: None

Attributes:

Name bindingType

Description

Specifies the input parameter binding type.

Possible values:

"innerParameter": Specifies that the input parameter value is calculated basing on an input parameter of the BAPI call defined in the sourceCall attribute while the

BAPI call input parameter name is set in the bindTo attribute.

"outerParameter": Specifies that the input parameter value is calculated basing on an output parameter of the BAPI call defined in the sourceCall attribute while the

BAPI call output parameter name is set in the bindTo attribute.

"outerParameterEnumerator":

This type of binding is similar to

"outerParameter". Applies only to

BAPI calls with the Enumerator attribute set to "GetUserList" or

"GetEmployeeList"

"attributeValue": Specifies that the input parameter value is equal to the value of the SAP attribute defined in the bindTo attribute.

"attributeValuePresented":

Specifies that the input parameter value is equal to the string constant

sourceCall field set in the "value" attribute.

"value": Specifies that the input parameter value is equal to the string constant set in the "bindTo" attribute.

"currentDate": Specifies that the input parameter value is equal to the string constant representing the current date.

Used only if bindingType is set to

"outerParameter." Specifies the name of the BAPI call used to calculate the attribute value.

Used only for input parameters of the

table or structure type. Specifies the table or structure field name. bindTo value

This attribute depends on the bindingType value: it may be set to a parameter name or to a string constant.

Used only if the bindingType attribute is set to "attributeValuePresented."

Name: OutputParameters

Description: Describes output parameters of the BAPI call.

Parent element: call

Child elements: OutputParameter

Attributes: None

Name: OutputParameter

Description: Describes the output parameter of the BAPI call.

Parent element: OutputParameters

Child elements: dataFilter

Attributes:

Description Name name type

Specifies the parameter name.

Specifies the parameter type. Possible values:

 "table"

 "structure"

 "string"

Default value: "string"

Name: dataFilter

Description: Used only for parameters of the "table" type. Allows you to filter the parameter data.

Parent element: OutputParameter

Child elements: None

Attributes:

Name filterType field

Description

Specifies how to filter the table-type output parameter values. Possible values:

"fieldToValue": Filters the parameter values on the table field name.

"firstRowOnly": Ensures that the output parameter contains values only from the first row of the table of values.

Specifies the name of the table field used for the parameter values filtering.

Download