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:releaseSession
 
pub.sap.client:releaseSession
Releases a locked session o n an SAP system.
Input Parameter
serverName
SAP system alias on which the locked session is located. 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 client specified in the SAP system alias settings 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
Example1
The service will release a session after a commit work or rollback work command has been triggered inside the SAP system.
Note:
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.
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 a 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.
Example2
You also need this service if you want to lock and change a certain database object. To do this, please proceed as follows:
1. Call the pub.client:lockSession service in order to get an exclusive connection to an SAP system.
2. Lock an object by calling a BAPI_ *_ENQUEUE.
3. Make your changes by invoking other BAPIs.
4. Release the object by calling a BAPI_*_DEQUEUE.
5. Call the pub.client:releaseSession service.