VeloX Docs

SAP plugins

SAP RD Specification Data Load

Load specification data from Excel or any other source into SAP EHS / Product Compliance specifications.

Purpose: Load specification data into SAP specifications (EHS / Product Compliance, transaction CG02BD).

  • Extract data from any source: an Excel sheet, an SAP table, a database table (HANA DB, MS SQL, …) or any third-party system.
  • Create specifications, add new attributes to existing specifications, or update the specification header.

In the Designer, the plugin is called Specification Create and is in the SAP Targets group. It is a target plugin: map fields from any source to it. Each source record is one specification. The plugin works with the standard specification BAPIs (business object BUS1077), so SAP checks the data as it does for any other BAPI call.

How to use

  1. Add the Specification Create plugin to the canvas.
  2. Open the Connection Parameters.
  3. Fill in the SAP connection parameters, user name and password, or connect through the Password Manager (see example).
  4. Set the plugin options (see Options).
  5. Click Connect.
  6. The line under the connection button turns green when the connection to SAP is established.
  7. Select the fields and objects you need, then map the import fields to a source (required) and the export fields to a target (optional).

The connection tabs are the same as in the other SAP plugins: Password Manager (SAP System and Server Type), Application Server (Server Host, System Number, SAPRouter, User, Password, Client, Language) and Message Server (SID, Server Host, Logon Group, Server Service, SAPRouter, User, Password, Client, Language). See the Password Manager for saved SAP systems.

Options

Field Description
Operation Create New Specification creates new specifications. Add New Attributes adds new objects (for example identifiers or value assignments) to existing specifications. Update Specification Header Only changes only the header data of existing specifications.
Check LongText Checks identifier texts and user-defined texts longer than 132 characters before they are split into long-text lines. If a text has more than 132 consecutive spaces, the entry gets an error instead of being loaded. Selected by default.
Phrase Conversion Converts phrase texts from the source into phrase IDs for phrase-based characteristics. If a phrase doesn't exist for the characteristic, the entry gets an error. Clear it if your source already contains phrase IDs. Selected by default.
Ignore Header Status Skips the header status check and status change. If it is cleared, the plugin checks the current specification header status and sets the new status from the Header Status object. Selected by default.

Expand Settings in the connection parameters to change the connection pool settings (IDLE_TIMEOUT, POOL_SIZE, MAX_POOL_SIZE) or to open the plugin Notes.

What each operation does

Operation Behavior
Create New Specification Creates a new specification with its header and all mapped objects in one call. The specification number comes from the source or from SAP number assignment, depending on your SAP settings for the specification type.
Add New Attributes Reads the existing specification first, then sends only the objects that don't exist yet. Existing identifiers, value assignment types, instances and characteristic values are kept as they are; they aren't overwritten. If there is nothing new to add, the record gets the error No new data to update.
Update Specification Header Only Reads the existing specification header and changes only the header fields that have a value. Specification objects are ignored.

Import and export fields

The Specification Create plugin consists of three main parts, see Image 1 below:

  1. Input Header structure parameters
  2. Input Tables parameters (specification objects)
  3. Output structure parameters
Image 1: Output structure parameters

Image 1

Open Fields and select what you need on the tabs. Click Select All to select everything on a tab.

Tab Content
Specification Header Data Header fields of the specification.
Specification Objects Specification tables, for example identifiers and identifier long texts, regulatory list assignments, material assignments, reference specifications, inheritance relationships, value assignment types, instances and data, component assignments, usage, assessment and source data, user-defined texts and their long texts, transport and packaging data, and Header Status.
Subobjects Shown for objects that have subobjects, for example the value assignment data of an instance.
Return Data Export fields from the specification header, for example SUBSTANCE (specification number), RECORD_NO, SUBCATEGRY and SUBAUTHGRP. Map them to a target, for example to write the created specification numbers back to Excel.

The full list of return fields is SUBSTANCE, CHANG_NO, VALID_FROM, SUBCATEGRY, SUBAUTHGRP, NOTE, SUBCHARACT and RECORD_NO. They are filled only for successful records.

The drop-down list shows the description of each field. Use the search if there are many parameters, see Image 2.

Image 2: The drop-down list shows the description of each field. Use the search if there are many parameters, see Image 2

Image 2

Field options

Open the details of an import field to set how its value is converted: Default Value (with No Default Value., Ignore Source. or Only If Source Empty.), Convert To Upper Case and Add Leading Zeros. Convert SUBID to RECN converts a specification number (SUBID) into the internal record number (RECN) where applicable. Export fields have a Remove Zeros option. Mandatory fields are marked with M.

Field badges show the active options: M (mandatory), D (default value), U (upper case), Z (leading zeros) and C (Convert SUBID to RECN). SUBSTANCE in the header has Add Leading Zeros switched on by default.

With Convert SUBID to RECN, the plugin looks up the specification numbers in table ESTRH (deleted specifications are ignored) and sends the record numbers to SAP. If a specification number is not found, the record gets the error The provided Specification ID does not exist.

How objects are linked

All object rows that the source returns for one record belong to the same specification. The plugin builds the parent-child links between the rows from their key fields, so map these keys consistently:

Object Linked by
Regulatory list assignments, identifier usage, identifier long texts ID_TYPE, ID_CATEGRY, INSTANCE, and LANGU if it is filled. The language is part of the identifier key.
Value assignment instances SUBCHACAT (value assignment type) and INSTANCE.
Value assignments, component assignments, usage, assessment, source data, user-defined texts, transport and packaging data SUBCHACAT and INSTANCE of the value assignment instance they belong to.

Other rules:

  • Each value assignment type must have at least one instance with data. Otherwise the record gets the error The Specification Property Header does not contain any child.
  • If the same value assignment type and instance appear twice, the record gets the error Property Header has duplicates (Specification has inconsistencies).
  • Identifiers longer than 132 characters are sent as identifier long texts and the identifier field is left empty. User-defined texts are split into long-text lines in the same way. Line breaks in the source start new lines.
  • For inheritance relationships, give the template ID in RECORD_NO_OF_TEMPL_HEADER. The plugin converts it into the template record number (table TCGTPLH). If the template is not found, the record gets the error The Template for Relationships does not exist.
  • If you fill the change number (CHANG_NO) in the header but not VALID_FROM, the plugin reads the valid-from date of the change number with CCAP_ECN_HEADER_READ and uses it as the key date.

Phrase conversion

With Phrase Conversion, the plugin reads the characteristics of each value assignment type (class type 100) and finds out which characteristics are phrase-related. For those, it reads the allowed phrases from SAP and replaces the phrase text in CHAR_VALUE with the phrase ID. The phrase lists are kept in memory for the rest of the run. If no phrase matches, the record gets the error Phrase does not exist in Characteristic; if more than one phrase has the same text, it gets Characteristic contains more than 1 PhraseID for Phrase.

Header status

If Ignore Header Status is cleared, fill the Header Status object with SCHEMA_ID and STATUS_ID. Both are mandatory; if one is missing, the record gets the error Missing mandatory field for Specification Header Status. The plugin then:

  1. Sets the initial status for a new specification, or for an existing specification that has no status yet. It does this by running the SAP mass status change transaction /PLMI/SPC_SAM_MASS_C in the background.
  2. Sets the status from the Header Status object with /PLMB/SAM_MODIFY_STATUS (object type PLM_RSPSUB).

Mapping

First, create a mapping between a source and the Specification Create plugin. The source can be the Excel Import plugin, a database, the SAP Read Table plugin, the Python plugin and so on.

For example, if the source is the Excel plugin, map the fields between the Excel plugin and the Specification plugin with drag and drop, as shown below:

Image 3: For example, if the source is the Excel plugin, map the fields between the Excel plugin and the Specification plugin…

Image 3

Most Specification Load fields are part of the standard SAP transaction CG02BD. To complete the mapping, you need domain knowledge in Specification Management (EHS-BD-SPE). Also see the SAP documentation.

Run-time behavior

  • The plugin uses the specification BAPIs BAPI_BUS1077_CREATE (to create specifications and to add new attributes) and BAPI_BUS1077_CHANGE (to update the header) and saves with BAPI_BUS1077_SAVEFROMBUFFER. Header status changes use /PLMB/SAM_MODIFY_STATUS.
  • Long texts are split into lines of 132 characters. Duplicate value assignment instances are detected and reported as errors.
  • The language is part of the identifier key, so you can load the same identifier in several languages.
  • In simulation mode, the plugin calls SAP but doesn't save the changes.
  • The migration log shows a Specification Key column. Click it to open the specification in SAP. This requires SAP GUI on your computer and the function module C100_ENTRY_ONE_SUBSTANCE in the SAP system; VeloXm checks that the function module exists when you connect.

SAP calls for each record

Before SAP is changed, the plugin runs its own checks (specification numbers, templates, duplicates, long texts, phrases, header status fields). If any check fails, the record is marked as an error and nothing is sent to SAP.

Operation SAP calls in order
Create New Specification BAPI_BUS1077_CREATE with the header and all objects; then BAPI_TRANSACTION_COMMIT (with wait) and BAPI_BUS1077_SAVEFROMBUFFER; then, if the header status is not ignored, the initial status and /PLMB/SAM_MODIFY_STATUS. If the create call returns an error, BAPI_BUS1077_CLEARBUFFER discards the data.
Add New Attributes BAPI_BUS1077_GETDETAIL to read the existing specification; BAPI_BUS1077_CREATE with the existing header and only the new objects; then BAPI_TRANSACTION_COMMIT and BAPI_BUS1077_SAVEFROMBUFFER; then the header status, if it is not ignored. On error, BAPI_BUS1077_CLEARBUFFER.
Update Specification Header Only BAPI_BUS1077_GETDETAIL to read the header and its record number; BAPI_BUS1077_CHANGE with the header fields that have a value (the matching fields in SUB_HEADERX are set to X); then the header status, if it is not ignored.

Simulation mode

In simulation mode, nothing is saved in SAP:

  • Create New Specification and Add New Attributes: BAPI_BUS1077_CREATE runs with FLG_BUFFER = X, so SAP checks the data only in its buffer. The plugin then discards the buffer with BAPI_BUS1077_CLEARBUFFER.
  • Update Specification Header Only: BAPI_BUS1077_CHANGE runs with FLG_TESTRUN = X.
  • If the Header Status object is filled, the plugin checks that the status exists in the status schema (table /PLMB/SAM_EDGE). If not, the record gets the error Specification Header Status is not correct. The status is not changed.

In simulation mode, the return fields show the values sent to SAP, because no specification number is assigned.

Log

For each record, the log shows the Specification Key (the specification number). If SAP or the plugin checks return errors, the row is marked as an error and lists every message, with the field or key concerned. The technical log contains the operation, whether the run is a simulation, and the import and export parameters of each SAP call.

Prerequisites

  • SAP EHS / Product Compliance (specification management) in the target system.
  • An SAP user with RFC access and authorization to create and change specifications, and to read tables with RFC_READ_TABLE (ESTRH, TCGTPLH, TCG66 and, for header status, /PLMB/SAM_OBJST and /PLMB/SAM_EDGE).
  • For header status: the status management function module /PLMB/SAM_MODIFY_STATUS and authorization to run transaction /PLMI/SPC_SAM_MASS_C through ABAP4_CALL_TRANSACTION.
  • For opening specifications from the log: SAP GUI on your computer.
Esc