VeloX Docs

Client-side plugins

Specification plugin

Create SAP EHS specifications or add data to existing ones with the BAPI_BUS1077 function modules.

Overview

Specification plugin can be found in SAP Targets tab on the left panel of Designer Section. It creates SAP EHS specifications (substances) or adds new data to existing specifications. The plugin header shows SPC.

It is a Client-type plugin: it runs as a step of a VeloXi project and receives its data from the server plugin or from other plugins mapped to its fields. Each run processes one specification with all the objects mapped to it (identifiers, value assignments, material assignments and so on) and returns the SAP messages and the key data of the specification.

The plugin uses the standard SAP business object BUS1077 (Specification) BAPIs. No custom function modules are required.

Configuration

Click Connection on the plugin to open the Connection Parameters panel.

Connecting with Password Manager

To configure the plugin:

  1. On the Password Manager tab, select the SAP System saved in the Password Manager.
  2. Select the Server Type:
    • Application Server
    • Message Server
  3. Optionally select Simulate.
  4. Optionally select Phrase Conversion.
  5. Select the action (see Actions).
  6. Optionally select Set Initial Header Status.
  7. Optionally select Use Request Credentials.
  8. Specify the LogLevel.
  9. Finally click Connect.
Finally click Connect

Connecting with Application Server

To configure the plugin, on the Application Server tab fill the following fields:

  1. Server Host.
  2. System Number.
  3. SAPRouter - optional.
  4. User.
  5. Password.
  6. Client.
  7. Language.
  8. Set the options as described above: Simulate, Phrase Conversion, the action, Set Initial Header Status, Use Request Credentials and LogLevel.
  9. Finally click Connect.
Finally click Connect

When you click Connect, the plugin logs on to SAP, reads the interface of BAPI_BUS1077_CREATE and builds the field list from it. The SID field is filled in from the connected system. After a successful connection the connection fields are locked.

Options

Option Description
Simulate Runs the BAPIs in test mode. Nothing is saved in SAP. You can also map the Simulate only import field (FLG_TESTRUN) to control test mode per record. See Test mode.
Phrase Conversion For phrase-related characteristics, converts the phrase text you send into the phrase key that SAP expects. If no phrase or more than one phrase matches the text, an error is returned for that record. Selected by default.
Set Initial Header Status Sets the initial status of the specification header after it is created. Enter the Tab Position (1-N) (CG02) of the status tab in transaction CG02 (1-99, default 8). The plugin uses a hidden SAP GUI session for this step.
Use Request Credentials Logs on to SAP with the user name and password received by the server plugin instead of the stored credentials.

Actions

Action Description
Create New Specification Creates a new specification with BAPI_BUS1077_CREATE. This is the default action.
Add New Attributes Adds new data (identifiers, value assignments, material assignments and other objects) to an existing specification. Data that already exists on the specification is not changed.

How Add New Attributes finds new data

The plugin first reads the existing specification with BAPI_BUS1077_GETDETAIL and compares the incoming rows with the existing data. Only rows that do not exist yet are sent to SAP. Rows are matched as follows:

Object Matched on
Restrictions to specification header Rating (RATING) and validity area (VAL_AREA)
Reference specification data Reference specification (REF_RECNRH)
Identifier data Identification type (ID_TYPE), identification category (ID_CATEGRY) and instance (INSTANCE, compared with the existing sequence number)
Value assignment types Value assignment type (SUBCHACAT)
Value assignment instances Value assignment type and instance (INSTANCE)

New sub-objects (for example new characteristic values, usage or user-defined texts) are added under an existing identifier or value assignment instance. If nothing new is found and the header status does not change, the record returns the error No new data to update.

Settings

Settings

Expand Settings in the Connection Parameters panel to set the SAP connection pool parameters.

Field Description Default
IDLE_TIMEOUT Time after which an idle connection is closed. 2
POOL_SIZE Number of idle connections kept open in the pool. 10
MAX_POOL_SIZE Maximum number of connections that can be open at the same time. 100

Click Notes to add notes to the plugin.

Fields

Click Fields on the plugin to choose the data to map. The fields are grouped into Specification Header Data, Specification Objects and Subobjects. Use Select Fields on a structure to choose its fields.

The Specification Header Data fields come from the specification header structure BAPI1077RH (for example specification SUBSTANCE, specification type SUBCATEGRY, authorization group SUBAUTHGRP, change number CHANG_NO, valid-from date VALID_FROM). The extra field Simulate only (FLG_TESTRUN) turns on test mode for the record. Add Leading Zeros: is preset for the SUBSTANCE field.

Available specification objects include:

  • Restrictions to specification header, reference specification data
  • Identifier data, identifier long texts, regulatory list assignments, identifier usage data
  • Material assignments, inheritance relationships, scopes of application
  • Value assignment types, instances and data, component assignments, usage, assessment and source data
  • User-defined texts and their long texts
  • Transport approval, packaging code approval, risk classification and transport classification data
  • Packaging data, special packing provisions, provisions for carriage
  • Header status

Objects are nested the same way as in the specification: regulatory list assignments and identifier usage are sub-objects of Identifier data; value assignment instances are sub-objects of Value assignment types; value assignments, component assignments, usage, assessment, source, user-defined texts and the dangerous goods tables are sub-objects of the value assignment instance. Rows of a sub-object are linked to their parent by the parent key fields (for example SUBCHACAT and INSTANCE for value assignment data; ID_TYPE, ID_CATEGRY and INSTANCE for identifier data). The plugin generates the internal primary and foreign keys itself.

Value assignment data is sent per characteristic: map the value assignment type (SUBCHACAT), the instance (INSTANCE), the characteristic name (NAME_CHAR) and the value (CHAR_VALUE).

The Header Status object needs the status schema (SCHEMA_ID) and the status (STATUS_ID). It is shown only if the SAP system has the function module /PLMB/SAM_MODIFY_STATUS; otherwise the message Header Status cannot be used appears when you connect.

The Confirmations export returns the messages from SAP for each record.

Export fields

After a successful run the plugin returns these specification header fields: SUBSTANCE, RECORD_NO, SUBCATEGRY, SUBAUTHGRP, CHANG_NO, VALID_FROM, NOTE and SUBCHARACT. If the record has errors, these fields are empty and only Confirmations is filled.

Field options

Import fields have the same options as other SAP plugins: Default Value: (No Default Value., Ignore Source., Only If Source Empty.), Convert To Upper Case: and Add Leading Zeros:. Export fields have Remove Zeros:.

Some fields also have Convert SUBID to RECN:. Select it to send the specification ID (SUBID) and let the plugin convert it to the internal record number (RECN) where applicable. Fields with this option are marked with C. The plugin looks up the record number in table ESTRH (deleted specifications are ignored). If a specification ID is not found, the record returns the error The provided Specification ID does not exist.

Run-time behavior

  • The plugin reads the specification interface from BAPI_BUS1077_CREATE when you click Connect.
  • Data is written to the SAP buffer and saved with BAPI_BUS1077_SAVEFROMBUFFER and BAPI_TRANSACTION_COMMIT. The buffer is cleared with BAPI_BUS1077_CLEARBUFFER.
  • Existing specification data is read with BAPI_BUS1077_GETDETAIL.
  • Header status is changed with /PLMB/SAM_MODIFY_STATUS. If header status data is mapped but Set Initial Header Status isn't selected, an error is returned (for Add New Attributes, only when the specification has no header status yet).

Processing steps

  1. The plugin collects the mapped values and applies the field options.
  2. Specification IDs in fields with Convert SUBID to RECN: are converted to record numbers. Templates in Inheritance relationships are converted from template ID to the template record number (table TCGTPLH); an unknown template returns The Template for Relationships does not exist.
  3. If Phrase Conversion is selected, phrase texts in value assignments are converted to phrase keys (see below).
  4. Create New Specification: all data is passed to BAPI_BUS1077_CREATE in one call. Add New Attributes: the existing specification is read first, and only the new rows are passed to BAPI_BUS1077_CREATE under the existing specification.
  5. If SAP returns an error, the buffer is cleared and nothing is saved. Otherwise the data is saved and committed (the commit waits for the update to finish).
  6. If Set Initial Header Status is selected, the plugin calls transaction CG02 in the background for the specification and saves it on the status tab given by Tab Position (1-N) (CG02). This creates the initial header status.
  7. If Header Status data is mapped, the status is set with /PLMB/SAM_MODIFY_STATUS (object type PLM_RSPSUB). For Add New Attributes the status is changed only if it differs from the current status.
  8. The messages are returned in Confirmations and the specification header fields in the export fields.

Validation and SAP errors are returned in Confirmations and do not stop the project. Unexpected exceptions are written to the log and stop the plugin run.

Phrase conversion

When Phrase Conversion is selected, the plugin reads the characteristics of each value assignment type (class type 100) with BAPI_CLASS_GETDETAIL. A characteristic is treated as phrase-related if its check function is C14K_PHRASECHARACT_CHECK or if a phrase set is assigned to it (table TCG66). The phrases of the characteristic are read with C14K_GETDATAVALUES and cached for the run. The value you send is replaced with the matching phrase key. Possible errors are Phrase does not exist in Characteristic and Characteristic contains more than 1 PhraseID for Phrase.

Long texts

If an identifier (IDENTIFIER) or a user-defined text (USRDFNDTXT) is longer than 132 characters, the plugin stores it as a long text. The text is split into lines of up to 132 characters, and line breaks in the source text start new paragraphs.

Error messages

Message Cause
The provided Specification ID does not exist A specification ID in a field with Convert SUBID to RECN: was not found.
The Specification Property Header does not contain any child A new value assignment type was sent without any value assignment instance data.
Phrase does not exist in Characteristic Phrase conversion found no phrase for the value.
Characteristic contains more than 1 PhraseID for Phrase Phrase conversion found several phrases for the value.
No new data to update Add New Attributes found no new rows and no header status change.
The Template for Relationships does not exist The inheritance template was not found.
Specification Header Status is not correct In test mode, the status schema and status are not a valid combination for specifications.
Initial Spec Header Status is not set. Please run the project with Initial Status flag = X. Header status data is mapped, but the specification has no initial status and Set Initial Header Status is not selected.
Missing mandatory field for Specification Header Status SCHEMA_ID or STATUS_ID is missing in the header status data.

Test mode

Test mode is on when Simulate is selected or when the Simulate only field has a value for the record. A mapped Simulate only field overrides the Simulate option: if it is mapped and empty, the record is processed normally.

In test mode the plugin calls BAPI_BUS1077_CREATE with the buffer flag set, so SAP checks the data without saving it, and then clears the buffer with BAPI_BUS1077_CLEARBUFFER. No commit is made, the initial header status is not set and the header status is not changed. If header status data is mapped, the plugin only checks that the status exists in the status schema for specifications (table /PLMB/SAM_EDGE). The SAP messages are returned in Confirmations.

Log

Each run writes an entry to the client log with the level set in LogLevel. The entry contains the action type, the test mode flag, the import and export parameters of BAPI_BUS1077_CREATE, the start and end time of the call, the header status steps and any error messages. See Logs Section.

Prerequisites

  • SAP EHS (specification management) in the target system.
  • The SAP user needs authorization for the BUS1077 BAPIs, RFC_READ_TABLE (tables ESTRH, TCGTPLH, TCG66, /PLMB/SAM_OBJST, /PLMB/SAM_EDGE), the class and characteristic BAPIs used for phrase conversion and, for Set Initial Header Status, RFC_CALL_TRANSACTION_USING with transaction CG02.
  • Header status requires /PLMB/SAM_MODIFY_STATUS in the SAP system.
  • Set Initial Header Status requires SAP GUI on the VeloXi server, because the plugin opens a hidden SAP GUI session for this step.

Limitations

  • One specification is processed per run.
  • Add New Attributes only adds data. It does not change or delete existing identifiers, value assignments or other objects.
  • The status tab position in CG02 depends on the specification layout of your system. Check it in CG02 before you use Set Initial Header Status.
Esc