Entering content frameBackground documentation Fact Mapping Locate the document in its SAP Library structure

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.

Table Fields in the Fact Mapping Table

Table Field

Description

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 characteristics with phrases assigned 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.

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:

Syntax

Caution

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:

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

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

The only field of interest here is RECNREF, the internal record number of the reference. Alternatively, you can enter the field name SUBID and thus fill the fact with the specification key of the reference.

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 R/3 session 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 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:

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

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.

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 name SUBID and 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.

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 value RE/D/User-defined text for density. Alternatively, for example, you can use the /DEF option to set the text type default as RE.)

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

Syntax: U:<Table field in ESTDU>[,...][;<Value assignment type>] (for example, U:VACLID,RVLID;SAP_EHS_1015_003. Can, for example, be assigned the value PUBLIC/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 slash. You can use the /SEP option to specify an alternative separator.

Other fields of interest are: EXCLFLG (excluding indicator), ACTVFLG (active indicator) and ESNTFLG (relevancy indicator). Normally, the EH&S Expert sets the active indicator for all the written data records of the value assignment types. The EH&S Expert, however, does not set the relevancy 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:

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

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

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.

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 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 name SUBID and thus fill the fact with the specification key of the regulatory list element.

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.

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

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

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

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 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 name SUBID and 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:

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.

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 R/3 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.

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

Options for Facts

Option

Description

/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 R/3 classification system (for example 1–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 R/3.

/USAGE=<Rating>,<Validity area>.[,Exclude indicator[Active indicator[Relevancy 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 relevancy indicator either with X or .

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

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

For more information on 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. Field indicates 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 type RE.

/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 R/3 System from which the 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 R/3 System from which the 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.

 

 

 

Leaving content frame