Adapter for SAP 10.1 | webMethods Adapter for SAP Documentation | webMethods Adapter for SAP Installation and User’s Guide Documentation | Built-in Services | SAP Client Services | pub.sap.client:lockSession
 
pub.sap.client:lockSession
Locks an RFC connection to your Integration Server session so that you will always exclusively use this RFC connection for subsequent calls.
x
Input Parameter
serverName
Alias of the SAP system to which the connection is established. The name must match a configured RFC connection alias at Adapter for SAP.
$client
Optional. Client for the session. If no client is specified, the default client is used.
$user
Optional. User name for the session. If no user is specified, the default user is used.
$pass
Optional. Password for the session. If the password is not specified, then the user and password will be looked up in the SAP User store.
$language
Optional. Language used during the session. If no language is specified, the default language is used.
Return Values
None
Example
Note:
This service locks a session to trigger a commit work command inside the SAP system. This causes a database commit. This service only works with SAP systems version 4.0A and higher because BAPIs do not write data directly to the database but use the posting engine inside the SAP system and the start of the processing of posted data.
The data will not be written to the database until the client triggers a commit work command. In order to call a BAPI that writes data, you must perform the following steps on Integration Server:
1. Call the pub.sap.client:lockSession service in order to get an exclusive connection to the SAP system.
2. Perform the BAPI calls.
3. Call the pub.sap.bapi:commit or pub.sap.bapi:rollback service
4. Call the pub.sap.client:releaseSession service in order to release the exclusive connection to the SAP system and clean up used resources on Integration Server.