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.

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:

SAP RFM Action Block Properties Pane

PropertyDescription
Name

Name of the SAP RFM Action Block (for local use within the chart).

Naming Characters Allowed

Information

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.

DescriptionDescription of the block's function (optional, helpful for documentation purposes)
DestinationSelected 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 for details on creating a Destination for use with a SAP RFM Action Block.
Remote Function Call Settings
Function Group FilterFilters by available SAP groups. If not using a filter term, place an asterisk ("*") in this field.
Function Module FilterFilters 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).

Query Button

Note 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.
Function ModuleA drop-down list of all SAP Function Modules within the selected Function Group that passed through the Function Module Filter (see above).
Selected RFMClicking 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:

  • sRFC — Synchronous RFC (most basic RFC function call. The receiving system must be available at the time the call is made)
  • tRFC — Transactional RFC (called function module is executed using the Exactly Once method. The call remains in a local queue if the receiving system is not currently available to respond)
  • qRFC — Queued RFC (similar to tRFC but instead of allowing exactly one call, the method Exactly Once In Order is used. Responses are provided in the order called)
Queue NameFixed queue name or chart parameter.
Context - StatefulCheckbox to indicate the session is 'stateful' (remembers states between sessions).
Context - End SessionCheckbox to indicate that the current 'stateful' session is to be terminated after execution of the block.
Session NameThe name of the 'stateful' session (can be a directly-entered string value or a Chart Parameter (e.g. @SAP_session_name).


Stateful Sessions

Information

For stateful sessions with BAPI Action or RFM Action Blocks, refer to Understanding Sessions.

Non XML 1.0 Characters

Information

Only XML 1.0 character codes are allowed with Business Connector. Characters that are returned from an ERP by the SAP BAPI Action Block and 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 ) 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.



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:


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

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.



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 SettingDescription
maxRowsInteger 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:

PropertySample SettingDescription
NameGet MaterialsName of the Block (available, if needed, for local use within the chart by other Blocks).
DestinationMy SAP ServerSelected 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_getlistSAP 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 ModuleBAPI_MATERIAL_GETLISTRetrieve 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 TypesRFCSynchronous Remote Function Call (expects an immediate answer from the receiving system, else an error will be reported).
Queue NameN/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).

PropertySample SettingDescription
TargetGet 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