Class SapR3BorConnector

  • All Implemented Interfaces:
    ConnectorInterface, AbapErrorCache, VersionInfoInterface

    public final class SapR3BorConnector
    extends Connector
    implements ConnectorInterface, AbapErrorCache

    The SAP R/3 Business Object Repository Connector. Version %sapborcn.release.version% Build %sapborcn.release.build.version%.

    The connector enables external applications, using IBM Tivoli Directory Integrator, to access BOR objects in SAP R/3. It supports the following IBM Tivoli Directory Integrator Connector Modes: Add Only, Delete, Update, Iterator, Lookup. The connector supports design time schema query via querySchema(java.lang.Object).

    A note about ABAP errors and warnings
    The connector invokes BAPI/RFC functions in SAP to perform the connector mode operations. In some cases, data passed to the BAPI/RFC functions from the XML input, may result in ABAP data validation failures. The BAPI/RFC functions return the results of validation checks in the "RETURN" parameter of the RFC.

    The connector has been desingned to make the RFC return status available to the Assembly Line. The connector does not interpret, or translate, ABAP errors or warnings into thrown exceptions. The connector registers a script bean named "borcAbapErrorCache". The bean is registered for all connector modes and can be accessed in connector hooks. The bean is an instance of AbapErrorCache. Script code in a connector hook can use this information to perform contingency actions as required. The cache is reset before the execution of each connector method. Example script code is shown below:

    var errs = borcAbapErrorCache.getLastErrorSet();
    if (errs.size() > 0) {
      task.logmsg("********** There were ABAP Errors *********");
      for (var i = 0; i < errs.size(); ++i) {
       var errInfo = errs.get(i);
       task.logmsg("The message is: " + errInfo.getMsg());
       task.logmsg("The message number is: " + errInfo.getMsgNum().toString());
      }
    }

    var warns = borcAbapErrorCache.getLastWarningSet();
    if (warns.size() > 0) {
      task.logmsg("********** There were ABAP Warnings *********");
      for (var i = 0; i < warns.size(); ++i) {
       var errInfo = warns.get(i);
       task.logmsg("The message is: " + errInfo.getMsg());
       task.logmsg("The message number is: " + errInfo.getMsgNum().toString());
      }
    }

    A given SAP entry is represented as XML by the connector, and is set as the value of the connector attribute named "sapXml". The value of this attribute is always an XML string. Its XSchema is defined in the user guide for the connector. The format of the XML may be altered by modifying the XSL style sheets that are configured for the connector.

    The configuration parameters of the connector are described below. The runtime parameters appear within braces ():

    R3 Client (client)
    SAP R/3 Logon client for R/3 connection (for example, 100). This is passed directly to the IBM Tivoli Directory Integrator SAP R/3 RFC Function Component.

    R3 User (user)
    SAP R/3 Logon user for R/3 connection. This is passed directly to the Tivoli Directory Integrator SAP R/3 RFC Function Component.

    Password (passwd)
    SAP R/3 Logon password for R/3 connection. This is passed directly to the IBM Tivoli Directory Integrator SAP R/3 RFC Function Component.

    R3 System Number (sysnr)
    The SAP R/3 system number for R/3 connection (for example, 100). This is passed directly to the IBM Tivoli Directory Integrator SAP R/3 RFC Function Component.

    R3 Hostname (ashost)
    SAP R/3 application server name for R/3 connection. This is passed directly to the IBM Tivoli Directory Integrator SAP R/3 RFC Function Component.

    Gateway host (gwhost)
    Gateway host name for R/3 connection. This is passed directly to the Tivoli Directory Integrator SAP R/3 RFC Function Component.

    RFC Trace (trace)
    Set to one (1) to enable RFC API tracing. If enabled, the SAP RFC API will produce separate rfc_nnnn.trc files in the working directory of Tivoli Directory Integrator. This option may be useful to help diagnose RFC invocation problems. It logs the activity and data between the Connector and SAP R/3. This should be set to zero (0) for production deployment.

    BOR Class Name (sapr3.conn.borObjName)
    The name of the BOR class that this connector will be integrating. The names of BOR classes are available using transaction BAPI in SAP R/3. This value is used to obtain the keyfield names of the BOR object when a schema query is performed.

    RFC Function Component Name (sapr3.conn.rfcFC)
    The name of the RFC Function Component registered with IBM Tivoli Directory Integrator. This option should be changed only on the advice of IBM support. The default value is: ibmdi.SapR3RfcFC

    Add Mode StyleSheets (sapr3.conn.putStylesheets)
    The list of XSLT style sheets files to be executed by the Connector when deployed in Add Only mode. Each XSLT file must be separated by a new line within the text box. At runtime, each style sheet is applied to the XML contained within the Container Entry. The XSL will be applied to the value of the attribute named sapXml. This configuration parameter should be changed only at the direction of IBM support.

    Modify Mode StyleSheets (sapr3.conn.modifyStylesheets)
    The list of XSLT style sheets files to be executed by the Connector when deployed in Modify mode. Each XSLT file must be separated by a new line within the text box. At runtime, each style sheet is applied to the XML contained within the Container Entry. The XSL will be applied to the value of the attribute named sapXml. This configuration parameter should be changed only at the direction of IBM support.

    Delete Mode StyleSheets (sapr3.conn.deleteStylesheets)
    The list of XSLT style sheets files to be executed by the Connector when deployed in Delete mode. Each XSLT file must be separated by a new line within the text box. At runtime, each style sheet is applied to the XML contained within the Container Entry. The XSL will be applied to the value of the attribute named sapXml. This configuration parameter should be changed only at the direction of IBM support.

    Lookup Mode Pre StyleSheet (sapr3.conn.findPreStylesheet)
    The XSLT style sheet file to be executed by the Connector when creating an RFC XML request able to obtain all user attributes for a given user. This configuration value must be set when the Connector is deployed in Update, Delete, and Lookup modes. This configuration parameter should be changed only at the direction of IBM support.

    Lookup Mode Post StyleSheet (sapr3.conn.findPostStylesheet)
    The XSLT style sheet file to be executed by the Connector when creating the user XML formatted response from the Connector. This configuration value must be set when the Connector is deployed in Update, Delete, and Lookup modes. The XSLT transforms the response XML from the RFC executed as a result of the XSLT from Lookup Mode Pre StyleSheet configuration. This configuration parameter should be changed only at the direction of IBM support.

    Select Entries Pre StyleSheet (sapr3.conn.selectEntriesPreStylesheet)
    The XSLT style sheet file to be executed by the Connector when creating an RFC XML request able to obtain all user names from SAP. This configuration value must be set when the Connector is deployed in Iterator mode. This configuration parameter should be changed only at the direction of IBM support.

    Select Entries Post StyleSheet (sapr3.conn.selectEntriesPostStylesheet)
    The XSLT style sheet file to be executed by the Connector when creating the user XML for the getNextEntry() processing. This configuration value must be set when the Connector is deployed in Iterator mode. The XSLT transforms the response XML from the RFC executed as a result of the XSLT from Select Entries Pre StyleSheet configuration. This configuration parameter should be changed only at the direction of IBM support.

    Iterator Mode Pre StyleSheet (sapr3.conn.getNextPreStylesheet)
    The XSLT style sheet file to be executed by the Connector when creating an RFC XML request able to obtain all user attributes for a given user. This configuration value must be set when the Connector is deployed in Iterator mode. This configuration parameter should be changed only at the direction of IBM support.

    Iterator Mode Post StyleSheet (sapr3.conn.getNextPostStylesheet)
    The XSLT style sheet file to be executed by the Connector when creating the user XML formatted response from the Connector. This configuration value must be set when the Connector is deployed in Iterator mode. The XSLT transforms the response XML from the RFC executed as a result of the XSLT from Iterator Mode Pre StyleSheet configuration. This configuration parameter should be changed only at the direction of IBM support.

    For a description of Add Only mode requirements, see putEntry(com.ibm.di.entry.Entry).

    For a description of Update mode requirements, see modEntry(com.ibm.di.entry.Entry, com.ibm.di.server.SearchCriteria).

    For a description of Delete mode requirements, see deleteEntry(com.ibm.di.entry.Entry, com.ibm.di.server.SearchCriteria).

    For a description of Lookup mode requirements, see findEntry(com.ibm.di.server.SearchCriteria).

    For a description of Iterator mode requirements, see getNextEntry() and selectEntries().

    • Constructor Detail

      • SapR3BorConnector

        public SapR3BorConnector()
        Construct the Connector.
    • Method Detail

      • getLastWarningSet

        public java.util.List getLastWarningSet()
        Allows the caller to obtain a list of ABAP warnings that might have occured during the execution of any supported Connecotor method.
        Specified by:
        getLastWarningSet in interface AbapErrorCache
        Returns:
        a list of AbapErrorInfo objects at warning severity. Minimum length will be zero.
      • getLastErrorSet

        public java.util.List getLastErrorSet()
        Allows the caller to obtain a list of ABAP errors that might have occured during the execution of any supported Connector method.
        Specified by:
        getLastErrorSet in interface AbapErrorCache
        Returns:
        a array of error severity errors. Minimum length will be zero.
      • registerScriptBeans

        public void registerScriptBeans​(ScriptEngine se)
                                 throws java.lang.Exception
        Description copied from class: Connector
        This method is called to register specific objects in the script context. If the connector has a parser, the parser's registerScriptBeans method is also called.
        Specified by:
        registerScriptBeans in interface ConnectorInterface
        Overrides:
        registerScriptBeans in class Connector
        Parameters:
        se - The script engine context
        Throws:
        java.lang.Exception - if an error occurs.
      • querySchema

        public java.lang.Object querySchema​(java.lang.Object source)
                                     throws SapR3ConnectorException

        Return the IBM Tivoli Directory Integrator Entry schema supported by this connector. The connector supports one native attribute named "sapXml". sapXml is an XML string representing the attributes of a BOR object to be operated on.

        Other attributes reflect the given BOR object keyfield names . A typical example of extra attributes would be the specification of BOR object key fields. They are supported to allow the definition of IBM Tivoli Directory Integrator "LinkCriteria" when the connector is deployed in Lookup, Delete, or Update modes.

        Specified by:
        querySchema in interface ConnectorInterface
        Overrides:
        querySchema in class Connector
        Parameters:
        source - not used.
        Returns:
        A vector containg one Entry for IBM Tivoli Directory Integrator schema display.
        Throws:
        SapR3ConnectorException - If an error occurs.
        See Also:
        Entry, Vector
      • selectEntries

        public void selectEntries()
                           throws ConnectorMethodException,
                                  SapR3ConnectorException
        Called by IBM Tivoli Directory Integrator AL when the connector operates in Iterator mode inside an assembly line. It finds all BOR object identifiers currently managed by the connected SAP R/3 instance. It stores all instance ID names and values in a cached BorInstanceIdIterator following an RFC lookup to obtain the names.

        The XML value returned from the post XSL, must have an elements named "sapBorObjIdentifier". The children of this element must be elements where the tagnames match the keyfields of the given BOR object.
        Specified by:
        selectEntries in interface ConnectorInterface
        Overrides:
        selectEntries in class Connector
        Throws:
        SapR3ConnectorException - If the attribute is missing from the entry.
        ConnectorMethodException - if the SAP network call fails, or an XSL transform error occurs.
        See Also:
        Connector.selectEntries()
      • getVersion

        public java.lang.String getVersion()
        Get the version string. Used by IBM Tivoli Directory Integrator to log version info at AL startup.
        Specified by:
        getVersion in interface VersionInfoInterface
        Returns:
        The version info string for this connector.