---
title: "Understanding Sessions"
id: "understanding-sessions"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/understanding-sessions"
updated: 2026-07-31T14:57:02Z
---

# Understanding Sessions

**Sepasoft MES Module Suite**
 Most BAPIs and RFMs are 'stateless' (requires no memory of process states between successive sessions), and using sessions are not required. However, there are certain calls to SAP, such as those related to the SAP Business Object Repository (BOR) Runtime Environment, that are 'stateful' and must be executed within the same session.

Using the SE37 T-Code within the SAP GUI, users can execute sequences of calls within the same session by using the **Test Sequences** menu option.

![](/resources/Storage/user-manual/understanding-sessions/sap_gui.png)

The **Interface for SAP ERP**module provides **Advanced Settings** for the **[SAP BAPI Action Block](/docs/display/BC/SAP-BAPI-Action-Block)** and **[SAP RFM Action Block](/docs/display/BC/SAP-RFM-Action-Block)** to achieve a similar effect, using JCo contexts under the hood.

![](/resources/Storage/user-manual/understanding-sessions/image2019-7-26_14-23-51.png)

By default, every call is stateless and executes in its own session. Only when the **Stateful** checkbox is enabled will stateful operation come into play.
 * * *
 ## Multi-Chart Sessions

It may be desirable to allow a session to span calls from multiple chart instances, such as when using the [**Enclosing Chart**](/docs/display/BC/Enclosing-Chart-Block) Block. In this case, the **Session name** field can be hard-coded or set to a Chart Parameter value (must be type String). Any **SAP BAPI** or **SAP RFM** Action Blocks that have the session name will execute in the same session.

Note

| ![Information](/resources/Storage/user-manual/user-manual/Info.png) | If a Chart Parameter is used, then its current value is used as the session name. If the value of the Chart Parameter changes, then the **SAP BAPI** or **SAP RFM** Action Block with that Chart Parameter in the **Session name** field will not be executing on the same session. |
| --- | --- |

![](/resources/Storage/user-manual/understanding-sessions/image2019-7-26_14-41-31.png)
 * * *
 ## Chart Instance Sessions

If the **Stateful** button is checked, a session will be created that is associated with the **UUID** (unique identifier) of the chart instance. That is, **SAP BAPI** and **SAP RFM** Action Blocks that are used in the same chart instance and have the **Stateful** button checked will execute in the same session.

![](/resources/Storage/user-manual/understanding-sessions/image2019-7-26_14-39-58.png)

Note

| ![Information](/resources/Storage/user-manual/user-manual/Info.png) | Note that sessions are unique to chart *instances*, not charts themselves*.* Thus, each chart execution will have its own session, unless Multi-Chart Sessions are used (selecting a specific session by name in the **Session name** field allows more than one chart to participate in the same 'stateful' transaction. The Session name is given by the **SAP BAPI** or **SAP RFM** Action Block that begins the stateful session. See the section **Multi-Chart Sessions** below). |
| --- | --- |
 * * *
 ## Ending a Session

Since sessions can span multiple charts, sessions must be manually closed by checking the **End session** box (**Stateful** must be enabled). Only the last **SAP BAPI** or **SAP RFM** Action Block in a chart to be executed with a session should have the **End session** box checked.

![](/resources/Storage/user-manual/understanding-sessions/image2019-7-26_14-49-7.png)

Warning

| ![Information](/resources/Storage/user-manual/user-manual/Info.png) | Make sure to not check the **End Session** checkbox on a block that is inside an iteration loop (that executes more than once), as the session will be closed during the first iteration.<br><br>Also, if using the [**Enclosing Chart**](/docs/display/BC/Enclosing-Chart-Block) Block, be mindful of whether the last call in a session is within the enclosed chart or within the parent chart. |
| --- | --- |
 
**Sepasoft MES Module Suite**