Sepasoft MES Module Suite
This example chart collects a list of Material Definitions from an SAP database and creates a MES Material Definition object for each.
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).
| Sample Setting | Description |
|---|---|
| maxRows | Integer type. It will become available for mapping in the SAP RFM Action Block. |
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:

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.

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).

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). |
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).
Executing the Chart
This example chart is being executed from a script within a Button component on an Ignition Designer window:
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 not 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:
Sepasoft MES Module Suite