Show TOC

 Fact Mapping

The fact mapping table contains the regulations for mapping facts in the set of rules to characteristics or other elements in the EH&S data model.

If you use EH&S Open Content Connector (EH&S OCC), the facts of the set of rules correspond to the data IDs of a content provider.

Table Fields in the Fact Mapping Table

Table Field

Meaning

Internal_Id

Name of the fact in the set of rules

Record

Optional assignment of the fact to a record in the set of rules

In the rule editor, this assignment is visible in the tree structure and is not therefore listed explicitly.

Group

Optional assignment of the fact to a composition in the set of rules

In the rule editor, this assignment is visible in the tree structure and is not therefore listed explicitly.

External_Id

Name of the assigned data element in EH&S (see section “Syntax”)

Description

Description text for the fact

Options

Options that govern access to the data in EH&S more closely (see section “Options for Facts”)

IsPhrase or Map Value

Identifies whether the fact contains values that are to be subject to value conversion via phrase mapping tables.

This will mostly be used for facts that represent phrase-enabled characteristics in order to convert an easily recognizable phrase identification used in the set of rules to the phrase key in EH&S and vice versa.

The value conversion can, however, also be used for any other value.

DispOrder

Specifies the column sequence of the Open Content Connector Dialog Box .

The first three fields together form a unique identifier for the fact in the set of rules.

Assignment to Characteristics, Identifiers, and Additional Information

You can assign facts in the set of rules to the following elements in EH&S:

Header data, for example, specification type

Identifiers

Component table data (for example, quantities)

Characteristics in the classification system (property tree)

Additional information on individual value assignments in the value assignment types (user-defined texts, usage, for example)

Parameters for the EH&S Expert call

Facts can also be assigned to the fields of any tables in an external Microsoft Access database

Syntax

In the following syntax description, optional parts are shown in square brackets [ ]. The square brackets themselves do NOT belong to the syntax.

Three periods ... indicate a random number of repetitions of the previous syntax element.

In order to distinguish between the different elements, one of the following identification letters is placed before each External_Id in the fact mapping table:

Field from the header data table

Syntax:H:<Table field in ESTRH>(H:SUBCAT, for example)

Field from the reference table

Syntax:D:<Table field in ESTRR>(D:SUBID, for example)

The only field of interest here isRECNREF, the internal record number of the reference. Alternatively, you can enter the field nameSUBIDand thus fill the fact with the specification key of the reference.

Identifier from the ESTRI table

Syntax:I:<Category>,<Type> [,<List> ][,<Language> ][; <Table field in ESTRI>[]](I:NUM,CAS, for example)

The identifier can be identified by category and type and also by assigning a list and a language. If you specify a language but not a list, you should place two commas before the language. If you do not specify a language, the logon language of the SAP system from which you called the EH&S Expert is used when a multilingual identifier is read.

If several values are available for the specified category, type, list, and language, the fact will acquire a set of text values when reading. It must also be assigned a set if a number of values are to be written.

As an option, a list of fields from the identifier table ESTRI can be specified separated with a semicolon. You must separate values for these fields in the fact text value using a forward slash. You can use the /SEP option to specify an alternative separator.

If no list of fields is specified, only the IDENT field (the actual value of the identifier) is set. If a list of fields is to be specified, IDENT must also be specified explicitly in order to receive the identifier value.

Other fields of interest are:

LANGU (language)

ORD (order number for sort sequence)

SUBLIST (assignment to regulatory list)

If an identifier is longer than 132 characters or if it contains line breaks, a long text is automatically created.

Specification status

Syntax:s (lowercase s):<Table field in EHSBT_APPL_SCOPE> [,... ]< FINAL>

Set the option FINAL to X if the specification status after updating is to be valid. The default setting for FINAL is blank.

If the specification status is Released , EH&S Expert is initially not allowed to change data for this specification. In this case, the set of rules must set the specification status to In work before updating. After updating the data, the status can be set to Released again. With the FINAL option, this specification status is marked so that it can only be set after the substance data has been updated. Two tables for the specification status are passed to the module C1E5_SUB_EXPERT_DATA_CHANGE. One is to update the specification status before updating the data and the other is for after updating the data.

Fact: s:SUBSTAT,VACLID,RVLID,VALFR,VALTO,FINAL

Value:I0570/OFFICIAL/DE/20020730/20050730/X

The specification status is therefore released (RE = I0570) for Germany (DE) for authorities (OFFICIAL) between 07/30/2002 and 07/30/2005. This specification status applies after updating because the FINAL option is set to X.

Inheritance relationships

Syntax: E:<Fields> [,... ]for inherit relationships orV:<Fields> [,... ]for pass-on relationships

<Fields>here is a combination of the following data elements:

SUBID

Specification key. For inherit relationships, this key relates to the substance passing data on. For pass-on relationships, it relates to the inheriting substance.

IDTYPE

Identification category if not referenced with SUBID

IDCAT

Identification type, only valid together with IDTYPE

IDENT

Identification value, can only be used with IDTYPE and IDCAT

TEMPLATE

Inheritance template to select the structures to pass on data

TEMPLATEGROUP

Inheritance template group

Fact: E:SUBID,TEMPLATEGROUP,TEMPLATE

Value: D182/PUBLIC/ALL

The specification currently being edited now inherits all files (TEMPLATE=ALL) from the specification D182.

Fact mapping of the inheritance relationship always comprises one part that references the specification passing on or inheriting data, and one part that identifies the inheritance template. Only the combination of TEMPLATE and TEMPLATEGROUP identifies the inheritance template uniquely. The reference to the specification passing on or inheriting data results either from a specification key that is represented by SUBID, or by an identifier represented by the combination of IDTYPE, IDCAT, and IDENT.

For mapping of SUBID, the same rules apply as for all fields from the header data table ESTRH.

For mapping of the identifiers mentioned, the same rules also apply as for identifiers from the table ESTRI.

Characteristic

Syntax:M:<Characteristic name> [;<Value assignment type> ](for example,M:SAP_EHS_1015_003_VALUE;SAP_EHS_1015_003)

The value assignment type only needs to be specified if the fact is not assigned to a record. Otherwise the value assignment type appears in the record mapping table.

Characteristics that are assigned multiple values are represented as sets.

Component data (for example, quantity)

Syntax:C:<Table field in ESTVP>(C:COMP_AVG, for example)

Facts of this type are only possible with a composition assignment.

As an alternative to the RECNCMP field that contains or requires the internal record number of the component, you can specify the field nameSUBIDand thus fill the fact with the specification key of the component.

You can write composition data under certain conditions (in other words, create a new composition type and fill it with data from the set of rules). You cannot write specification data for components. Component data is the only kind of composition fact that can be written. All other data (characteristics, identifiers, and so on) can only be written to the main specification.

User-defined text

Syntax:F:<Table field in ESTDF>[][;<Value assignment type or identifier or "H:">](F:TEXTCAT,LANGU,HEADER;SAP_EHS_1015_003, for example. Can, for example, be assigned the valueRE/D/User-defined text for density. Alternatively, for example, you can use the /DEF=TEXTCAT:RE option to set the text type default asRE.)

One or more fields from the user-defined text table ESTDF are specified. You must separate values for these fields in the fact text value using a forward slash. You can use the /SEP option to specify an alternative separator.

If several user-defined texts are to be written for a data record of the value assignment type, the fact is to be filled with a set of text values.

As with characteristics, you only need to enter the value assignment type if the fact is not assigned to a record.

If the user-defined text is longer than 132 characters or if it contains line breaks, a long text is automatically created for the user-defined text.

Usage

Syntax:U:<Table field in ESTDU> [,... ][;<Value assignment type> ](for example,U:VACLID,RVLID;SAP_EHS_1015_003. Can, for example, be assigned the valuePUBLIC/DE.)

One or several fields from the ESTDU usage table are specified. You must separate values for these fields in the fact text value using a forward slash. You can use the /SEP option to specify an alternative separator.

Other fields of interest are: EXCLFLG (exclude indicator), ACTVFLG (active indicator) and ESNTFLG (relevance indicator). Normally, EH&S Expert sets the active indicator for all the written data records of the value assignment types. EH&S Expert, however, does not set the relevance indicator. Using a fact that is assigned to a usage via a mapping table, you can set these indicators differently.

If the EH&S Expert is being run with an EH&S Release 2.7B or higher, a usage can also be assigned to an identifier or the header data. Instead of the value assignment type, write the following after the semicolon:

For an identifier assignment"I:<Category>,<Type> [,<List> ][,<Language> ]"

For a header data assignment"H:"

You only need to specify the value assignment type, identifier, or header data indicator if the fact is not assigned to a record.

If several usages are to be written for a data record of the value assignment type, identifier, or header data, the fact is to be filled with a set of text values.

If you want the usage that is defined by a fact like this to cancel the usage that was assigned to EH&S Expert as a parameter and that is used for writing, you must set the option /NOUSAGE for the corresponding entry in record mapping . Otherwise the usage defined by the fact would be added to the default. If the fact is not assigned to any record, you must set the option in fact mapping for this fact as well as for all other facts of the same value assignment type. This applies only for facts that relate to value assignment types and not to identifiers or header data. For the latter the default is not set automatically; the usage must be specified explicitly by a fact or the option /USAGE here.

It is possible to restrict the data to be read for each value assignment type with a usage.

Source

Syntax:S:<Table field in ESTDS> [][;<Value assignment type> ](for example,S:SRCID,SRCTEXT;SAP_EHS_1015_003)

One or more fields from the ESTDS source table are specified. You must separate values for these fields in the fact text value using a forward slash. You can use the /SEP option to specify an alternative separator.

As with characteristics, you only need to enter the value assignment type if the fact is not assigned to a record.

Assessment

Syntax:R:<Table field in ESTDR> [,... ][;<Value assignment type> ](for example,R:RELID;SAP_EHS_1015_003)

The only field in the ESTDR assessment table that is relevant is RELID.

As with characteristics, you only need to enter the value assignment type if the fact is not assigned to a record.

Regulatory list

Syntax:L:<Table field in ESTVP> [][;<Value assignment type> ](for example,L:RECNCMP;SAP_EHS_1015_003)

One or more fields from the component table ESTVP are specified. You must separate values for these fields in the fact text value using a forward slash. You can use the /SEP option to specify an alternative separator.

This fact type is used for the regulatory list concept in EH&S.

If several elements of a regulatory list are to be written for a data record of the value assignment type, the fact is to be filled with a set of text values.

As with characteristics, you only need to enter the value assignment type if the fact is not assigned to a record.

As an alternative to the RECNCMP field that contains or requires the internal record number of the regulatory list element, you can specify the field nameSUBIDand thus fill the fact with the specification key of the regulatory list element.

Administration data for the value assignment type data record

Syntax:A:<Table field in ESTVA> [][<Value assignment type> ](for example,A:ORD;SAP_EHS_1015_003)

You can use this to overwrite implicitly filled administration data such as the sort sequence.

As with characteristics, you only need to enter the value assignment type if the fact is not assigned to a record.

Transport approval data

Syntax:7:<Table field in EST07> [,... ][;<Value assignment type> ](for example,7:ADMOS;SAP_EHS_1022_024)

One or several fields from the EST07 table are specified. You must separate values for these fields in the fact text value using a forward slash. You can use the /SEP option to specify an alternative separator.

If several data records are to be written for a data record of the value assignment type, the fact is to be filled with a set of text values.

As with characteristics, you only need to enter the value assignment type if the fact is not assigned to a record.

Packaging approval data

Syntax:b:<Table field in EST0B> [][;<Value assignment type> ](for example,b:IPMQU;SAP_EHS_1022_024)

One or several fields from the EST0B table are specified. You must separate values for these fields in the fact text value using a forward slash. You can use the /SEP option to specify an alternative separator.

If several data records are to be written for a data record of the value assignment type, the fact is to be filled with a set of text values.

As with characteristics, you only need to enter the value assignment type if the fact is not assigned to a record.

Dangerous goods classification data

Syntax:d:<Table field in EST0D> [,... ][;<Value assignment type> ](for example,d:HNU;SAP_EHS_1022_024)

One or several fields from the EST0D table are specified. You must separate values for these fields in the fact text value using a forward slash. You can use the /SEP option to specify an alternative separator.

If several data records are to be written for a data record of the value assignment type, the fact is to be filled with a set of text values.

As with characteristics, you only need to enter the value assignment type if the fact is not assigned to a record.

Transport classification data

Syntax:f:<Table field in EST0F> [,... ][;<Value assignment type> ](for example,f:WOS;SAP_EHS_1022_023)

One or several fields from the EST0F table are specified. You must separate values for these fields in the fact text value using a forward slash. You can use the /SEP option to specify an alternative separator.

If several data records are to be written for a data record of the value assignment type, the fact is to be filled with a set of text values.

As with characteristics, you only need to enter the value assignment type if the fact is not assigned to a record.

As an alternative to the RECNCMP field that contains or requires the internal record number of the referenced UN-listed substance, you can specify the field nameSUBIDand thus fill the fact with the specification key of the reference.

For all table fields or field lists for header data, identifiers, component data, and additional information listed above, the administration fields can also be specified and therefore read and written to. Some are, however, ignored when writing or must not be written to as they are filled implicitly:

MANDT: Client. Is set implicitly.

RECN: Sequential number of data record. Is set implicitly for new data records.

If this field is read for a value assignment (A:) or an identifier (I:) and written again without being changed, this has the effect that a specific instance can be changed explicitly in EH&S, while in normal cases new instances are always created after any instances with matching data sources and data providers that may exist have been deleted or deactivated first.

Specifying a random value that was not read from EH&S first is not permitted and can lead to unpredictable side effects.

ACTN: Sequential number of change state.Is set implicitly.

VALFR: Start of validity. Is set implicitly, but can also be filled explicitly.

VALTO: End of validity. Is set implicitly, but can also be filled explicitly.

AENNR: Change number. Is set implicitly depending on how you entered the hit list before EH&S Expert was called.

DELFLG: Delete indicator. By setting the indicator to “x”, a data record can be logically deleted. This is only relevant in conjunction with an RECN that has already been read from EH&S (see above).

CRDAT: Created on. Is set implicitly if blank, but can also be filled explicitly.

CRNAM: Created by. Is set implicitly if blank, but can also be filled explicitly.

UPDDAT: Date of last change.Is set implicitly.

UPDNAM: Name of last person to make change. Is set implicitly.

SRSID: Data source. Is filled by the parameter EXPERT_WRITE_SOURCE_ID of the EH&S Expert user exit, but can also be filled explicitly.

OWNID: Data provider. Is filled by the parameter EXPERT_WRITE_OWNER of the EH&S Expert user exit, but can also be filled explicitly.

RECNROOT: Sequential number of specification header data record. Is set implicitly.

Parameters for the EH&S Expert call

Syntax:P:<Parameter name>

The possible parameter names are (see also IMG documentation on setting up the EH&S Expert user exit):

I_SUBSTANCE: Specification key

I_EXPERT_INSTANCE: Name of set of rules

I_MODE: Save mode D, I, or C

I_NUM_OF_DEACT_VAL: Number of value assignments to be deactivated in mode C

I_FLG_RESTRICT_BY_SRSID_OWNID: Indicator whether data origin and data provider are to be taken into account when deactivating or deleting existing data

I_KEY_DATE: Key date from hit list for reading data in form YYYYMMDD

I_CHANGE_NR: Change number for writing data

I_SRSID: Data origin for writing data

I_OWNID: Data provider for writing data

I_LANGUAGE: Logon language

I_COMMIT_FUNC: Name of update module

I_FLG_RULES_IN_R3: Since EH&S 2.7A: Indicator whether the set of rules is saved in the SAP system and was downloaded from there

I_TAB_USAGE_READ: Usage that is used to select input data for the set of rules, in the form <Rating>/<Validity area>/<Exclude indicator>. A number of usages fill the fact with a set of values.

I_TAB_USAGE_READ: Usage with which the determined output data (value assignments) of the set of rules is returned, in the form <Rating>/<Validity area>/<Exclude indicator>. A number of usages fill the fact with a set of values.

I_TAB_PARAMS: Table with freely definable content that can be filled using the parameters EXPERT_ADD_PARAM_1...n of the EH&S Expert user exit or programmed in a customer-specific call. A number of rows in this table fill the fact with a set of values.

All parameters apart from I_TAB_PARAM can only be read as input data (facts with the IN ID). They are not returned to EH&S.

In I_TAB_PARAMS, data can also be returned that can be evaluated by a customer-specific call module.

Fields from external tables

Syntax:T:<Field> [;< Table>/<Database> ]

In this manner, table fields can be read from an external Microsoft Access database and a set of rules be made parameterizable. The database must be accessible from the EH&S Expert server PC and can be present in Access 97 or Access 2000 format.

<Field> is a table field in the database. <Table> is a table in the database.<Database> is the file name of the Microsoft Access database. If a full path is not specified, the database is expected to be in the same directory as the rule file. For sets of rules saved in the SAP system, the working directory entered in the administration tool for EH&S Expert applies.

You only need to specify the table and database if the fact is not assigned to a record. In this case the fields are read from the first data record that was found in a selection without criteria. Use is recommended only for tables with one single data record because the order of the data records cannot be predicted.

The IsPhrase or MapValue options are not available for fields from external tables and must not therefore be selected.

Options for Facts

Option

Meaning

/LOWER

For a numeric value that specifies a range, the lower limit value is read or written with this option.This option is the default.

/UPPER

For a numeric value that specifies a range, the upper limit value is read or written with this option.

/RANGE

For a numeric value that specifies a range, the lower limit value and the upper limit value are read or written with this option.

/OPLOWER

For a numeric value that specifies a range, the operator (for example, >, >=, and so on) for the lower limit value is read or written with this option.

/OPUPPER

For a numeric value that specifies a range, the operator for the upper limit value is read or written with this option.

/STRING

A numeric value is read in the text form defined in the SAP classification system (for example1–2 mg/kg). This option has no effect when writing. The decimal separator is always set to the English usage of a period here, independent of the user settings in the SAP system.

/USAGE=<Rating>,<Validity area>. [,Exclude indicator [Active indicator [Relevance indicator ]]][;... ]

The fact is read or written with the specified list of ratings and validity areas. As an option, you can set the exclude indicator with X or –. You must only set this option for a fact if the fact is not assigned to any record. Otherwise you should set the option in record mapping.

You can still set or deactivate the active indicator and the relevance indicator either withXor –.

If not specified, the exclude indicator is not set, the active indicator is set, and the relevance indicator is not set.

For facts that are read from EH&S, specifying the active and relevance indicators has no effect. Only active value assignments are read.

For more information about using the /USAGE option as a selection criterion, see Data Selection by Usage

You must only set this option for a fact if the fact is not assigned to any record.Otherwise you should set the option in record mapping.

/NOUSAGE

This option prevents the usage entered in the EH&S Expert as a parameter for the value assignment type that is assigned to the fact from being written. This option is used if a usage that is defined as a fact of the same value assignment type is to cancel the default setting. Otherwise the usage that is defined as a fact would be written additionally.

This option is not necessary for header data and identifiers in EH&S 2.7B. Here the usage passed as a parameter is not written implicitly. If a usage is required, it must be written explicitly with the /USAGE option or by means of a fact.

/DEF=<Field>:<Value> [,... ]

You can use this option to specify fixed values for certain table fields for a fact that is assigned to an additional information table (usage, user-defined text, assessment, source, regulatory list, dangerous goods additional tables) or an identifier.Fieldindicates the table field in the respective EST table (ESTDF, ESTDU, ESTDR, ESTDS, ESTVP, EST07, EST0B, EST0D, EST0F). When reading, in this way you can specify a selection, for example, only user-defined texts of the typeRE

/SEP=<Separator>

You can use this option to change the default separator ("/") for a fact that is assigned to an additional information table (usage, user-defined text, assessment, source, regulatory list, dangerous goods additional tables) or an identifier and whose value therefore potentially contains the contents of a number of table fields simultaneously.

/PHRCODE

Option for facts to which a characteristic is assigned, to which a phrase set is assigned in EH&S. The phrase code is read instead of the phrase key. The language is taken into account that you specify when logging onto the SAP system from which EH&S Expert is called.This option has no effect when writing.

/PHRTEXT

Option for facts to which a characteristic is assigned, to which a phrase set is assigned in EH&S. The phrase text is read instead of the phrase key. The language is taken into account that you specify when logging onto the SAP system from which EH&S Expert is called.This option has no effect when writing.

/PHRID

Option for facts to which a characteristic is assigned, to which a phrase set is assigned in EH&S. Only the phrase identifier is read instead of the complete phrase key (phrase library and phrase identifier).

/PREFIX=<text>

When writing, the text value of the fact is always preceded by the specified text as a prefix.The option has no effect when reading.

/DEC=<Whole number>

According to the number entered, the value is rounded to the required number of places after the decimal separator when writing numeric values.

/MAP=<Field> [,... ]

You can use this option to activate a value conversion via the phrase mapping table of individual fields for a fact that is assigned to an additional information table (usage, user-defined text, assessment, source, regulatory list, dangerous goods additional tables) or an identifier, and whose value therefore potentially contains the contents of a number of table fields simultaneously.

The specified fields must also be specified in the External ID of the fact and the IsPhrase or MapValue indicator must be set.

The value conversion is then only performed for the contents of the specified fields.

/FIRST

If a fact is not assigned to a record, only one value assignment instance that matches the usage criterion is permitted when reading the data. If a number of instances are found, an error message is displayed.

This option suppresses the error message. Instead, the value assignment instance with the lowest order number is selected.

We do not recommend that you use this option because it hides an incorrect data constellation. The selection is relatively random because the order number is a very inaccurate criterion.

/DISP=<n>

EH&S OCC:

Specifies how the data should appear in the EH&S OCC tree. This has no influence on the order. The order is controlled by DispOrder.

0: Data is not displayed.

1: Data is displayed according to DispOrder.

2: EH&S data is displayed together with the content provider data at record level. The first four properties of the record require this option.

3: If data appears in the Other Content from Provider column, the descriptions are added in front of the data.

/CONCATLIST=“<c>“

EH&S OCC:

Displays characteristics with multiple value assignments as a list with a separator such as a forward slash (/). You should set this option for all characteristics with multiple values.

/SPLITLIST=“<c>“

EH&S OCC:

Separates concatenated values into individual values before they are loaded into the specification database. This is necessary if the content provider supplies concatenated values. The separator must match the separator used by the provider.

/REF[(<Group>,<Template>)][=id]

Using the fact, record, or composition option /REF, you can use EH&S Expert to write data to a reference specification or inheritance source and to create and reference this data automatically.

This option allows the proper mapping of automatically generated dangerous goods data to the recommended data model of Dangerous Goods Management .

The data of all OUT facts, records, or compositions that is given the /REF option in mapping is not updated in the specification for which the set of rules was started. Instead, the data is updated in a reference specification or inheritance source. With the enhancement /REF=id, where id stands for any desired identifier, data can also be updated in several reference specifications. With /REF=- the set of rules is canceled if the assignment is not unique. With /REF=! the data is updated in the first specification found.

If an inheritance relationship is required instead of a reference, /REF(<Group>,<Template>) can be used. <Group> is the name of a template group, <Template> is the name of an inheritance template. For substance references, there is no need to specify an inheritance template and template group. For inheritance relationships, these details are required.

For more information, see SAP Notes 418696 and 762525.