Adapter for SAP 10.1 | webMethods Adapter for SAP Documentation | webMethods Adapter for SAP Installation and User’s Guide Documentation | Adapter Connections | Dynamically Changing a Service's Connection at Run Time
 
Dynamically Changing a Service's Connection at Run Time
For Adapter for SAP, you can change the service's connection in one of two ways.
The adapter services that ship with Adapter for SAP in the WmSAP package in the pub.sap namespace include a field called serverName. By using this field, you can specify at run time the SAP system to be updated.
Additionally, Integration Server enables you to override the default connection associated with the service at design time. To override the default, you must code your flow to pass a value through the pipeline into a service's $connectionName field.
For example, you have a flow whose primary purpose is to create an entry on the production SAP system. However, you want the flow to have the capability to create the entry on the test server, with the decision of which SAP system to update to be made programmatically at run time. The output signature of the flow's first service contains a field called Target. The flow could branch based on the value in Target.
*If Target contains the value "production," the second service in the flow would ignore $connectionName-thus using its default connection to connect to (and then update) the production SAP system.
*However, if Target contains the value "test," the second service in the flow would use the value in the $connectionName from the pipeline and connect to (and then update) the test SAP system.
Keep in mind that both connections-the default and override-must have the same SAP classes and methods metadata, RFCs, and BAPIs.
For more information, see Changing the Connection Associated with an Adapter Service at Run Time.