Ansicht
Dokumentation

SIMG_OHAX514 - Rules

SIMG_OHAX514 - Rules

RFUMSV00 - Advance Return for Tax on Sales/Purchases   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

This step enables you to set up rules.

For further information, refer to the section "Set up special processing rules", or to the documentation on the form editor in the SAP Library.

You only need to carry out this step if specific information must be printed on a remuneration statement that depends on specific conditions.

Conditions for printing information can be stored in the system as rules. A rule can determine, for example, that information is only printed or selected if the value of the information exceeds a specified value. A rule can also determine that under a specific condition, one piece of information is replaced by another piece of information.

Rules can be defined for all variable information, that is, for information which can be different from employee to employee. Variable information is set up in the following steps:

  • "Individual fields"
  • "Line layout"
  • "Identifiers in window"

A rule is assigned to a specific piece of information by the rule number. This is stored in the field Rule for form editing in each of the steps named above.

Setting up and processing a rule

A rule can include one or more lines. Every rule line consists of the following components:

  • ID component
This component contains the rule identification. It includes the following fields:
  • Rule

  • Number

  • IF component
This component contains the logical rule condition. It includes the following fields:
  • Table

  • Field

  • Offset for comparison

  • Comparison length

  • Comparison type

  • Comparison operator

  • First comparison value

  • Second comparison value

  • THEN component
This component contains the replacement values for a piece of information. The replacement values are taken into account if the condition in the IF component is fulfilled. The THEN component includes the following fields:
  • Table

  • Field

  • Position (column in form)

  • Output length

  • Conversion

For each piece of variable information to which a rule is assigned, the values in these fields replace the original values specified in the steps "Individual fields", "Line layout", and "Window".

If there are no entries in certain THEN component fields, the original value is taken into account for each of these fields.

  • Subsequent component
This component controls the processing of further rule lines. The component includes the following field:
  • Subsequent rule indicator

The IF and THEN components form the basis of a rule. They specify how a variable piece of information is printed, and under which conditions.

The individual components and their fields are explained in detail below.

ID Component

A rule is identified using the fields Rule and Number.

Rule

The field Rule contains a two-digit number (01-99) for every rule. Using this number, the rule can be assigned to one or more variable pieces of information which you set up in previous work steps.

Number

The field Number is used to number the rule lines. Rule line numbering starts with "01" and is sequential. This means that number "01" must always be assigned to the first rule line, number "02" to the second rule line, and so on.

The rule identification could, for example, be as follows:

Rule   Number
01   01
01   02

In this example, the rule and number fields define rule "01" which consists of two lines.

IF Component (logical condition)

The logical condition of a rule determines the IF conditions under which replacement values stored in the THEN component are used instead of the information that would normally be printed. The logical condition could, for example, look as follows:

"If information xy equals z, ... "

The logical condition of a rule is stored in the following fields:

  • Table
  • Field
  • Offset for comparison
  • Comparison length
  • Comparison type
  • Comparison operator
  • First comparison value
  • Second comparison value

The above condition can be assigned to these fields as follows:

Information xy,,,,-> stored in the field Table and Field
"equal to" ,,,,-> stored in the field Comparison operator
"z" ,,,,-> stored in the field First comparison value

Table and Field

The table and field name of the information to which the condition refers is stored in the fields Table and Field. The following relationships may exist between the field name and the variable information to which the rule is assigned:

  • The specified field name is identical to the field name of the information to which the rule is assigned. Using "employee's personnel number" as an example, this means that a rule is assigned to the variable information "employee's personnel number" which starts as follows: "If the employee's personnel number..."
  • The specified field name is not identical to the field name of the information to which the rule is assigned. Using "employee's personnel number" as an example, this means that a rule is assigned to the variable information "employee's personnel number" which starts, for example, as follows: "If the employee's religious denomination..."
Example:
You want the rule condition to refer to the information in the field "PERNR" of table "PERNR". To do this, you enter the following:
Rule No C Table Field
01 01   PERNR PERNR

For detailed information on field names, refer to the sections "Set up data in fixed positions" and "Set up line layout in window".

Field name restrictions

Only the fields of certain tables are allowed. The following principle applies to whether or not a field is allowed:

  • The table name specified in the field Table must be the same as the table of the individual field to which the rule is assigned.
Example:
You want to assign a rule to the variable information "employee's personnel number" which is stored in the field "PERNR" in table "PERNR". In this example, you can only specify fields in the field Field name which are stored in table "PERNR".
  • If a rule is assigned to variable information stored in table "SCHLW", the field specified in the rule must be identical to the field from which the variable information originates.
Example:
You want to assign a rule to the variable information "Hiring date of employee" which is stored in the field "PHIRE" in table "SCHLW". In this example, only the field "PHIRE" can be specified in the table "SCHLW".
  • The fields from the following tables can be specified in the IF component of every rule:
,,PN
,,PERM (table applies to Germany only)
,,SY
,,VERSC

First comparison value

This enables you to enter the value against which the information stored in Table and Field is compared.

The entry in this field can be a constant value, a constant or a table field.

  • Constant value
If you specify a constant value, it must be preceded by an apostrophe which identifies the value as a constant value.
Example:
You want to enter "0" as a constant value in the field First comparison value. To do this, enter the following:
Value 1
'0
Decimals as constant values
If numbers are specified after a decimal point as part of a constant value in the field First comparison value, the decimal point that is chosen depends on the comparison type:
Comparison type Decimal point
"N" "." (for example "0.50")
"C" depending on the user values in the
program starter, for example:
in Germany: ","(comma)
in the USA:"."(period)

If numbers are specified as a constant value which include a decimal point, it is recommended that you use comparison type "N".
  • Constant
The fields "HDATE" and "LDATE" in table "SCHLW" are both constants. Fields from table "SCHLW" can be specified simply by entering the field name of the field.
Example:
You want to enter the constant "HDATE" in the field First comparison value. To do this, enter the following:
Value 1
HDATE
  • Table field
If you specify a table field, you must first enter the table which contains the field, followed by a hyphen, followed by the field name itself.
Example:
You want to specify the field "BEGDA" from table "PN" in the field Value 1. To do this, enter the following:
Value 1
PN-BEGDA

The information stated in "Restrictions on field names" applies to the field First comparison value in the table fields.

For detailed information on constants and table fields, refer to the steps "Set up data in fixed positions" and "Set up line layout in window".

Second comparison value

An entry in this field is only necessary or useful if the comparison operator "BE" (between) is used. This is the case if the information stored under Table and Field is compared against a specific set of values.

The same entry options and restrictions apply to the field Second comparison value as apply to the field First comparison value.

THEN Component (replacement values)

This component contains the replacement values for the variable information to which the rule is assigned. The replacement values are printed if the condition within the IF component has been fulfilled.

The THEN component includes the following fields:

  • Table
  • Field
  • Position (column on form)
  • Output length
  • Conversion

For every piece of variable information to which a rule is assigned, the values in these fields replace the original values determined in the steps "Individual fields", "Line layout" and "Window".

The original value is used for fields for which nothing has been entered within the THEN component.

Table and field

These fields contain the replacement value that is printed instead of the variable information if the condition of the IF component is fulfilled.

The entry in this field can be a constant value, a text module identifier, or a table field.

  • Constant value
If you specify a constant value, it must be preceded by an apostrophe which identifies it as a constant value.
  • Text module identifier
For the table name Table, you enter the character string "TEXT" and the respective text module number.
  • Table field
Table fields are subject to the restrictions listed above for tables and fields of the IF component.
Example
Table Field Meaning
'0 0 as a constant value
TEXT 05 Text module with identifier 05
PN ENDDA Table field PN-ENDDA

Position

In this field, you enter the column where printing of the information (original information or replacement value) should start.

For detailed information on constant values, text modules and table fields, refer to the steps "Set up data in fixed positions" and "Set up line layout in window".

Subsequent component

This component controls the processing of further rule lines. It includes the following field:

Subsequent rule indicator

The field Subsequent rule indicator is a one-character field which can have the following settings:

  • " "
  • "*"
  • "S"

The meaning of this setting depends on whether the condition in the preceding IF component has been fulfilled.

  • ""
If the condition in the IF component has been fulfilled, the system does not search for a subsequent rule line.
If the condition in the IF component has not been fulfilled, the system searches for a subsequent rule line.
  • "*"
The system searches for a subsequent rule line irrespective or whether the condition was fulfilled or not.
  • "S"
If the condition in the IF component has been fulfilled, the system searches for a subsequent rule line which has an entry in the fields Table and Field that is different from the current rule line.
If the condition in the IF component has not been fulfilled, the system searches for a subsequent rule line which has the same entry in the fields Table and Field as the current rule line.

The effect of a rule

The effect of a rule depends on whether you assign the rule to information in a fixed position (individual field), a line layout or an identifier in a window.

Rules for data in fixed positions

If you assign a single or multi-line rule to information in a fixed position in the step "Individual fields", and if one or several rule conditions have been fulfilled, the specified replacement values are used instead of the original values.

If none of the rule conditions has been fulfilled, nothing is printed (not even the original values).

Layout rules

If you assign a single or multi-line rule to a layout entry in the step "Line layout", the same information applies as listed under "Rules for data in fixed positions".

Rules for wage types in a window

If you assign a single or multi-line rule to a wage type in a window via the step "Identifiers in window", and if one or several rule conditions have been fulfilled, the specified replacement values are used instead of the original values.

If none of the rule conditions are fulfilled, the effect of the rule depends on whether the wage type to which the rule is assigned is printed in a normal line (that is, the line contains information on one wage type only) or a superline (that is, the line contains information on more than one wage type).

  • Rule for wage type in normal line
If none of the rule conditions has been fulfilled, the wage type is not selected to be printed in a window. As a result, there are no unnecessary blank lines in the window.
Note
If the total amount ("XRT-BETRG"), number ("XRT-ANZAHL") and rate ("XRT-BETPE") of a wage type are all "0", a setting within the program determines that no wage types are selected to be printed in a window, eve if a rule has not been assigned.
  • Rule for wage type in superline
If none of the rule conditions has been fulfilled, the effect of the rule depends on whether you have flagged the field Print line only if Ctype = 1 in the report used to create remuneration statements.
  • If none of the conditions has been fulfilled and you have selected the field, the whole superline in which the wage type must be printed is not selected to be printed in the window. As a result, there are no unnecessary blank lines in the window.

  • If none of the rule conditions has been fulfilled and you have not selected the field, the remaining wage types in the superline are selected to be printed in the window provided that they have not been assigned a rule or that one or several conditions of rules assigned to them have been fulfilled.

If a rule whose condition has not been fulfilled is assigned to the remaining wage types in the superline, the whole superline in which the wage type must be printed is not selected to be printed in the window. As a result, there are no unnecessary blank lines in the window.

Examples

You will find a list of the abbreviations used in the example under the heading "Abbreviations used" at the end of this step.

Example 1

In the step "Identifier in window", you set up wage type "MA10" with line type "01" and column type "X" (= normal line) in window "F1". You only want the wage type information to be printed on the remuneration statement if the monthly value of the wage type is not equal to zero. To do this, assign the following rule to wage type "MA10" in the step "Identifier in window":

Ru No C Table   Field Offset   Com   Type CO Val1
01 01   XRT   BETRG     N NE '0

The number "01" was chosen in this example as a rule number in the ID component.

In the IF component, the table name and field name of the monthly value of the wage type must be specified in the fields Table and Field. The value with which the monthly value is compared must be specified in the field First comparison value. The value in this example is "0" which must be specified as a constant value (that is, preceded by an apostrophe). A check must be performed to determine whether the monthly value is equal to zero. You must, therefore, specify the comparison operator "NE" (not equal to) in the field Comparison operator. The value "N" in the field Comparison type determines that the comparison carried out in the IF component is numeric.

The THEN component contains no entries. If the condition has been fulfilled, wage type "MA10" is selected to be printed in the window with the information specified in the step "Line layout" for the combination of line type "01" and column type "X". If the condition has not been fulfilled, the wage type is not selected to be printed in the window. As a result, there are no unnecessary blank lines in the window.

The entry in the subsequent component determines that the system only searches for a subsequent rule line if the condition has not been fulfilled. Since a subsequent rule line does not exist, rule processing ends after the first (and only) rule line has been processed.

Note

If you assign the same rule to each layout entry with line type "01" and column type "X" in the step "Line layout", the rule determines that information for all wage types to which the layout with line type "01" and column type "X" has been assigned is only printed on a remuneration statement if the condition has been fulfilled, that is, if the total amount of the respective wage type is not equal to zero. If the wage type condition has not been fulfilled, a blank line is printed in the window.

Example 2

In the step "Line layout", you set up a layout with line type "02" and column type "X" (= normal line). The line type and column type determine that the wage type long text (stored in table T512T and field LGTXT) is printed as of column "000", the retroactive accounting date of the wage type (stored in table XRT and field RUECKD) as of column "028", and the total amount of the wage type (stored in table XRT and field BETRG) as of column "040". You only want the retroactive accounting date of the wage type to be printed on a remuneration statement if retroactive accounting occurs, that is, if the in-period (period in which the remuneration statement is created) is not equal to the for-period (period for which the remuneration statement is created). You can do this by assigning the following rule to the entry with column type "02", line type "X", table XRT and field RUECKD in the step "Line layout":

Ru No C Table Field Offset   Com Type CO Val1
02 01   EVP IAPER     C NE EVP-PAPER

The number "02" was chosen in this example as a rule number in the ID component.

In the IF component, the fields Table and Field must specify where the in-period (table EVP, field IAPER) is stored. Specify the table field which contains the for-period (table EVP, field PAPER) in the field First comparison value. A check must be performed to determine whether the in-period is not equal to the for-period. To do this, enter the comparison operator "NE" (not equal to) in the field Comparison operator. The value "C" in the field Comparison type determines that character strings are compared in the IF component.

The THEN component contains no entries. If the condition has been fulfilled, the original values are used for the information "retroactive accounting date". If the condition has not been fulfilled, the retroactive accounting date is not printed.

The entry in the subsequent component determines that the system searches for a subsequent rule line only if the condition has not been fulfilled. Since a subsequent rule line does not exist, rule processing ends after the first (and only) rule line has been processed.

Abbreviations used

The above examples contain the following abbreviations:

Ru Rule for form editing
No Number of a rule line
C Continuation indicator
Table Table name
Field Field name
Offset Offset for comparison
Com Comparison length
Type Comparison type
CO Comparison operator
Val1 First comparison value
Val2 Second comparison value

Procedure

Make the required entries using the form editor, and choose the activity for the form editor.






rdisp/max_wprun_time - Maximum work process run time   General Material Data  
This documentation is copyright by SAP AG.

Length: 32326 Date: 20240607 Time: 010211     sap01-206 ( 461 ms )