---
title: "SAP RFM Action Block"
id: "sap-rfm-action-block"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/sap-rfm-action-block"
updated: 2026-07-31T14:57:08Z
---

# SAP RFM Action Block

**Sepasoft MES Module Suite**

# SAP RFM Action Block

The **SAP RFM Action Block** is specifically designed to interact with SAP. It can filter from a list of available schemas and map the required property fields to property fields in the selected B2MML schema (MES Objects, such as Operations Schedule, Operations Definition, Process Segment or Material). The resulting array can be accessed by other Blocks for modification via custom scripting, iterating through on a row by row basis or creating MES Objects.

![](/resources/Storage/user-manual/sap-rfm-action-block/Block%20Icons%20-%20SAP%20RFM%20Action.png)

## Connections

Two connections are required:

**Input** — (input) Receives execution control from the previous Block in the sequence. Unlimited input connections are allowed (spread across up to three available edges).

**Output** — (output) Passes execution control to the next Block in the sequence (typically an Iteration Block or a Save MES Object Block).

## Properties

The optional **Name** and **Description** fields are included on most Blocks for clarity and documentation benefit. Note: The text in the **Name** field will also appear on the Block's icon on the Design Grid.

The Properties pane is used to configure the SAP data source and filtering parameters:

![](/resources/Storage/user-manual/sap-rfm-action-block/SAP%20RFM%20Action%20Block%20-%20Properties%20Pane.PNG)

### SAP RFM Action Block Properties Pane

| Property | Description |
| --- | --- |
| Name | Name of the SAP RFM Action Block (for local use within the chart).<br> <br>Naming Characters Allowed<br> <br><br>| ![Information](/resources/Storage/user-manual/user-manual/Info.png) | Names must begin with a letter, digit or underscore. Subsequent characters may also include spaces, dashes, underscores and parentheses. All other special characters, such as period, comma, colon, semicolon, all slashes, brackets and braces, as well as the special characters on the 1-8 keys, are not allowed. |<br>| --- | --- | |
| Description | Description of the block's function (optional, helpful for documentation purposes) |
| Destination | Selected **Destination** instance in the **Interface for SAP ERP** section of the Ignition Project Browser. The Destination is pre-configured to connect to an SAP hosting server. See [SAP Destinations](/articles/user-manual/sap-destinations) for details on creating a Destination for use with a SAP RFM Action Block. |
| **Remote Function Call Settings** |
| Function Group Filter | Filters by available SAP groups. If not using a filter term, place an asterisk ("\*") in this field. |
| Function Module Filter | Filters by available SAP modules. If not using a filter term, place an asterisk ("\*") in this field. |
| Function Group | A drop-down list of all SAP Function Groups that passed through the Function Group Filter (see above).<br><br>Query Button<br>
<br><br>| ![Note](/resources/Storage/user-manual/user-manual/Note.png) | Press the Query button to query the selected SAP database against the filter settings above. The filtered list of available groups and modules becomes available in the drop-down menus for Function Group and Function Module. |<br>| --- | --- | |
| Function Module | A drop-down list of all SAP Function Modules within the selected Function Group that passed through the Function Module Filter (see above). |
| Selected RFM | Clicking the **Select** button will populate the **Selected RFM** field with the RFM option selected in the **Function Module** row above. |
| **Advanced Settings** |
| RFC Type | Type of Remote Function Call to be performed:<br><ul><li><span style="color: #000000;">sRFC — Synchronous RFC (most basic RFC function call. The receiving system must be available at the time the call is made)</span></li><li><span style="color: #000000;">tRFC — Transactional RFC (called function module is executed using the <em>Exactly Once</em> method. The call remains in a local queue if the receiving system is not currently available to respond)</span></li><li><span style="color: #000000;">qRFC — Queued RFC (similar to tRFC but instead of allowing exactly one call, the method <em>Exactly Once In Order</em> is used. Responses are provided in the order called)</span></li></ul> |
| Queue Name | Fixed queue name or chart parameter. |
| Context - Stateful | Checkbox to indicate the session is 'stateful' (remembers states between sessions). |
| Context - End Session | Checkbox to indicate that the current 'stateful' session is to be terminated after execution of the block. |
| Session Name | The name of the 'stateful' session (can be a directly-entered string value or a Chart Parameter (e.g. ***@SAP\_session\_name***). |

Stateful Sessions

| ![Information](/resources/Storage/user-manual/user-manual/Info.png) | For stateful sessions with **BAPI Action** or **RFM Action** Blocks, refer to [Understanding Sessions](/articles/user-manual/understanding-sessions). |
| --- | --- |

Non XML 1.0 Characters

| ![Information](/resources/Storage/user-manual/user-manual/Info.png) | Only XML 1.0 character codes are allowed with Business Connector. Characters that are returned from an ERP by the [SAP BAPI Action Block](/articles/user-manual/sap-bapi-action-block) and [SAP RFM Action Block](/articles/user-manual/sap-rfm-action-block) that are not included in XML 1.0 will be replaced with “□” (U-25A0 Black Square Unicode). The squares will be passed along with the data (including being saved with MES Object data), so it is up to the user to clean them from data being sent by the ERP. |
| --- | --- |

### Schema Refreshing and Changes
Clicking the **Refresh** ( ![](/resources/Storage/user-manual/refresh-button-for-action-blocks/Refresh%20Button%20for%20Action%20Blocks.PNG)) button will cause a re-fetch of both the input and output schemas. If both schemas still match what is currently selected for each in the Block, then a "**Confirm**" dialog box will appear.

* Clicking **Yes** will cause the Block to fetch fresh data.
* Clicking **No** will abort the refresh.

If either schema has been edited, an "**Outdated Mapping**" dialog box will immediately appear (without the need to press **Refresh**), with two choices on how to handle the schema mismatch, plus **Cancel**.

* Clicking **Continue** will apply all the mappings that are still valid and clean up the outdated mappings.
* Clicking **Reset** will clear all the saved data and mapping connections and then fetch a fresh copy of both schemas.
* Clicking **Cancel** will abort the refresh, allowing the user to manually fix the schema without losing saved data.
![](/resources/Storage/user-manual/refresh-button-for-action-blocks/Refresh%20Confirmation%20Dialog%20Box.PNG)

![](/resources/Storage/user-manual/refresh-button-for-action-blocks/Continue-Reset-Cancel%20Dialog%20Box.PNG)
 Usage

## Connecting the SAP RFM Action Block

1. Drag an **SAP RFM Action Block** onto the Design Grid (position to be the next block in the chart sequence).
2. Click on the previous Block in the sequence and draw a Connector to the SAP RFM Action Block (any available edge). This becomes the **Input** connection. Repeat for any additional input Blocks, if applicable (unlimited connections are allowed on up to three edges).
3. Click on the SAP RFM Action Block and draw a Connector (from any available edge) to the next Block in the sequence. This becomes the **Output** connection.

## Configuring the RFM Properties

To configure the SAP RFM Action Block properties, use the **SAP BAPI Action Block Properties Pane** table above, as well as information from the following pages:

* [SAP Connectivity](/articles/user-manual/sap-connectivity)
* [SAP BAPIs](/articles/user-manual/sap-bapis)
* [SAP RFMs](/articles/user-manual/sap-rfms)
* [SAP Destinations](/articles/user-manual/sap-destinations)

Basic steps to configure:

1. **Name** the SAP RFM Action Block.
2. Choose a previously-created **SAP Destination** (see link above). The search tree area should populate with all available BAPIs/RFMs from your selected SAP Destination (if not, then the connection to SAP has not been properly established).
3. Enter the **Function Group Filter** (asterisk is for 'all' available function groups) and **Function Module Filter**. Press **Query**. You should see one or more groups and functions listed (if not, then the connection to SAP has not been properly established, or you have selected an empty group or function list).
![](/resources/Storage/user-manual/sap-rfm-action-block/image2019-3-25_10-25-43.png)
4. Select the function group from the **Function Group** drop-down list (choose "**(Any Function Group)**" to cause all the function modules from all the function groups to populate into the Function Module drop-down below). Select the desired function module in the **Function Module** drop-down list.
Press **Select** to retain the selection.
![](/resources/Storage/user-manual/sap-rfm-action-block/image2019-3-25_10-29-10.png)
 Example

## Create Material Definitions

 This example chart collects a list of Material Definitions from an SAP database and creates a MES Material Definition object for each.

![](/resources/Storage/user-manual/example-create-material-definitions/SAP%20RFM%20Action%20Block%20-%20Example%20Chart.PNG)
 * * *
 ### Start Block

A Chart Parameter called **maxRows** is used to limit the number of SAP entries to fetch from the SAP database. The number will be input into the chart during the chart execution function [executeChart(chartPath, chartParameters)](/docs/display/BC/system.mes.bc.executeChart).

 | Sample Setting | Description |
| --- | --- |
| maxRows | Integer type. It will become available for mapping in the SAP RFM Action Block. |

![](/resources/Storage/user-manual/example-create-material-definitions/Start%20Block%20-%20Example%20Chart%20-%20Properties.PNG)

 * * *

 ### SAP RFM Action Block - Properties

This block fetches the Material Definitions from the specified SAP database. It is configured as follows:

A Destination called **My SAP Server** was previously configured in the **Interface for SAP ERP** section of the Global area in Designer:

![](/resources/Storage/user-manual/example-create-material-definitions/image2019-3-20_11-53-31.png)

![](/resources/Storage/user-manual/example-create-material-definitions/SAP%20RFM%20Action%20Block%20-%20Properties%20Pane%202.PNG)

 The **Remote Function Call** section is configured to filter down to just the **BAPI\_MATERIAL\_GETLIST** module where the Material Definitions are stored:

 | Property | Sample Setting | Description |
| --- | --- | --- |
| Name | Get Materials | Name of the Block (available, if needed, for local use within the chart by other Blocks). |
| Destination | My SAP Server | Selected SAP Connector Destination (created in the Interface for SAP section of the Global area in Designer). |
| Function Group Filter | \* | All SAP Groups will pass through the filter (asterisk is a wildcard). |
| Function Module Filter | \*material\_getlist | SAP function call to retrieve the list of material group objects. |
| Function Group | (Any Function Group) | The Function Modules for all SAP Function Groups will be available in the Function Module drop-down list. |
| Function Module | BAPI\_MATERIAL\_GETLIST | Retrieve only the BAPI Materials list. |
| Selected RFM | (shows the selected Function Module) | Display only. Shows the selected Function Module after the **Select** button is pushed. |
| RFC Type | sRFC | Synchronous Remote Function Call (expects an immediate answer from the receiving system, else an error will be reported). |
| Queue Name | N/A |  |

 ### SAP RFM Action Block - Mapping

The **Input** tab of the SAP RFM Action Block includes mapping for the Chart Parameter **maxRows** to be passed into the RFM function call that the block makes to the SQL database (limits the number of entries fetched). There is also a requirement that **MATNRSELECTION** in **BAPI\_MATERIAL\_GETLIST** be restricted to positive integer values only.

![](/resources/Storage/user-manual/example-create-material-definitions/SAP%20RFM%20Action%20Block%20-%20Input%20Mapping_1x.png)

The **Output** tab of the SAP RFM Action Block includes mapping for **MATERIAL → ID** and **MATL\_DESC → Description**. Note that it must first include a mapping connector at the parent level, to provide the block with a means of knowing the array sizes on both sides so it can map the connections properly. Each member of the **BAPI\_MATERIAL\_GETLIST** will be mapped into a B2MML array that includes Material Definition properties of **ID** and **Description**. These will be turned into MES Material Definition objects by the SAVE MES Object Block (see below).

![](/resources/Storage/user-manual/example-create-material-definitions/Sample%20Chart%20-%20Basic%20Materials%20-%20Output%20Mapping.png)

 * * *

### Save MES Object Block

This block creates an MES Object for each entry in the selected RFM (the drop-down list **Target** will list all of the Action Blocks in the chart. The filtered RFM in the selected Action Block will be used to create the list of MES Objects). For this example, one MES Material Definition object will be created for each entry in the RFM selected in the "Get Materials" SAP RFM Action Block (up to the limit defined by the Chart Parameter **maxRows**).

 | Property | Sample Setting | Description |
| --- | --- | --- |
| Target | Get Materials | "Get Materials" is the data source selected from the drop-down list of blocks with available data (it's the only choice in this example). |

![](/resources/Storage/user-manual/example-create-material-definitions/Save%20MES%20Object%20Block%20-%20example.PNG)

 * * *

 ### End Block

The End Block has no properties. When control passes to this block, it returns control to the script that executed the chart execution function [executeChart(chartPath, chartParameters)](/docs/display/BC/system.mes.bc.executeChart).

![](/resources/Storage/user-manual/example-create-material-definitions/End%20Block%20-%20no%20Properties.PNG)

 * * *

 ### Executing the Chart

This example chart is being executed from a script within a Button component on an Ignition Designer window:

![](/resources/Storage/user-manual/example-create-material-definitions/Button%20Script.PNG)

If "**10**" is entered into the **Rows to Fetch** text field, then when the Button is pressed:

* The number in the text field is loaded into **numRows**.
* "***Fetching 10 rows from BAPI\_MATERIAL\_GETLIST***" is printed to the Output Console.
* The chart is executed, passing in **numRows** to the Chart Parameter **maxRows** in the Start Block. Script execution in the Button script will  wait for the chart to complete its execution, allowing the chart to run independently in the background.

The result of the chart execution is that ten rows are fetched from **BAPI\_MATERIAL\_GETLIST** in the SAP database and ten **MES Material Definition** objects are created:

![](/resources/Storage/user-manual/example-create-material-definitions/MES%20Object%20Editor%20results.PNG)

![](/resources/Storage/user-manual/example-create-material-definitions/Button%20in%20Window.PNG)

![](/resources/Storage/user-manual/example-create-material-definitions/Output%20Console%20results.PNG)

**Sepasoft MES Module Suite**