Collecting Environmental Data Automatically via RFC Services
Use
The standard environment management system delivers functionality that enables you to set up automatic import of environmentally-relevant data into the system of compliance. This functionality includes a Business Add-In (BAdI) implementation for automatic data collection, an import interface, an RFC service, and an enhancement spot that enables further development of business logic. By default, the function group EHENV_ADC_IMPORT is exposed as an RFC service for automatic data collection of environmental data.
The standard system is delivered with a restriction on the number of imported data records with their corresponding number of external source tags, per single run of the automatic data import. If you try to import more than 1.000.000 data records with up to 1.000 external source tags in a single run of the automatic import, the system will stop the import with a warning message.
The RFC service enables a call to the middleware SAP Manufacturing Integration and Intelligence (SAP MII) and through it to the system of records. SAP MII pulls the environmental data from the system of record, arranges that data accordingly, and sends it to the system of compliance. The data is delivered at the environment management system in a way to be consumed and processed in the corresponding business object (EHFND_AMOUNTS). If for some reason, the environment management system cannot process or store the delivered data from the system of record, it returns a message. The message is not handled internally and therefore the environment management system does not log any erroneous behavior related to the automatic data collection. Instead, the system sends the message to the middleware and thus, the potential erroneous behavior can be controlled (stored or monitored) there.
The functionality for automatic data collection that is delivered with the standard system enables the environmental manager to schedule automatic import of data at the system of compliance.
Procedure
Configuring the RFC Service
The RFC service is used in the environmental management component to enable and control the import of data from an external source (system of records) into the environment management system. The data records (amounts) are imported into the EHFND_AMOUNTS business object according to the following data structure.
|
Component |
Description |
|---|---|
|
TAG_ID |
Alphanumeric identifier of the imported amounts from an external source. |
|
AMOUNT_TIMESTAMP |
Date and time of the amounts in UTC format (YYYYMMDDhhmmss). |
|
AMOUNT_VALUE |
Numeric value of the amounts. |
|
AMOUNT_UNIT |
Unit of measurement of the imported amounts. |
|
FAULT_IND |
Indicates that there is a validation error or other check error with the imported amounts. |
|
CALIBRATION_IND |
Indicates that a calibration value is used. This means that either the original amount was replaced by a calibration value, or the calibration value is used since the very beginning of the amount processing. |
|
OUTOFPRECISENESS_OPERATOR |
Indicates that the imported amount is outside the scale of the device. |
|
NOTAVAILABLE_IND |
Indicates that the amount does not contain a value and the imported data record is preset as Data Not Available. This means that either the value was not available (for example, due to a device malfunction), or it was omitted on purpose during the import. |
|
REMARK |
Explanatory description of the imported amounts. |
You can extend the data structure by using the delivered Business Add-In (BAdI) BADI_EHENV_ADC_IMPORT and enhancement spot. Alternatively, you can enhance the business logic directly by enhancing the provided function module BAPI_EHENV_ADC_IMPORT.
By default, the provided function module BAPI_EHENV_ADC_IMPORT, does not handle a potential erroneous behavior internally but instead uses a standard return parameter. The return parameter used in the function module invokes and uses the standard BAPIRET2 structure that is organized as follows:
|
Component |
Description |
|---|---|
|
TYPE |
Message type: S Success, E Error, W Warning, I Info, A Abort |
|
ID |
Message Class |
|
NUMBER |
Message Number |
|
MESSAGE |
Message Text |
|
LOG_NO |
Application log: log number |
|
LOG_MSG_NO |
Application log: Internal message serial number |
|
MESSAGE_V1 |
Message Variable |
|
MESSAGE_V2 |
Message Variable |
|
MESSAGE_V3 |
Message Variable |
|
MESSAGE_V4 |
Message Variable |
|
PARAMETER |
Parameter Name |
|
ROW |
Lines in parameter |
|
FIELD |
Field in parameter |
|
SYSTEM |
Logical system from which message originates |
Configuring SAP Manufacturing Integration and Intelligence
-
Start and log on to SAP MII.
-
Open the Content Development section and then start the SAP MII Workbench.
-
Create a new project in the workbench.
-
Add the following actions and transactions to the project:
-
Transactions
Transactions in SAP MII control the sequence of the actions that you add to the project. This way, by creating and organizing the transactions you establish an automatic process that is executed by SAP MII (for example, automatic data collection).
-
Data Queries
You can add various data queries into your project (PCoQuery, SQLQuery, TagQuery, and so on). The queries that you add depend on the system of record from where SAP MII pulls environmental data.
-
Java Connectivity Interfaces (SAP JCo Interface)
SAP JCo Interfaces in SAP MII control the connectivity and RFC settings that you wish to use in the project for the connection to the system of compliance. In the interface, you specify the details of the system of compliance, as well as the details of the RFC service that you wish to use for the import of the data.
-
Tracers
The tracers control the messages related to the overall process that are logged in the SAP MII. You can use the tracers to catch any return messages from the system of compliance (environment management) and handle any potential errors related to the automatic data collection.
-
-
Organize the transaction by inserting or adding sequence entries.
-
By using drag and drop, add the created actions into the transaction sequence entries.
-
Open the actions that you added into the transaction and configure them as follows:
-
Configure the object.
Depending on the action that you wish to configure, the following options are available:
-
Data Queries
In this section, you can configure the parameters of the data queries.
-
SAP JCO Interfaces
In this section, you can configure the connectivity and RFC details of the added JCo Interfaces. In the interface you enter the details that uniquely specify the system of compliance, such as, R/3 link to the system, server name, client number, credentials for automatic communication, and so on. In the interface you also specify the details of the RFC service that you wish to use for the import of the data.
-
Tracers
In this section, you can configure the level of logging (severity) and the messages for the tracers. Depending on the information delivered by the return message (the standard BAPIRET2 structure), you can configure the tracers in SAP MII and log the needed information. For example, you can configure the logging of only messages of type Error or Warning and omit logging the other.
-
-
Configure the links.
In this section you can configure the mapping between the parameters of the action.
-
-
Save your entries.
Scheduling Automatic Data Collection
For more information, see: Scheduling Automatic Data Collection