Ansicht
Dokumentation

OALE_CONVRULEMAINT2 - Maintain Rules

OALE_CONVRULEMAINT2 - Maintain Rules

TXBHW - Original Tax Base Amount in Local Currency   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

In this section, you perform the second step for the rule. The rules are determined for each field.

______________________________________________________________________________________________

Note: You can use this tool only if you are using the Web Application Server (SAP NetWeaver) together with SAP application components.

______________________________________________________________________________________________

You specify how the fields of a source object are converted and mapped to a target object. This object could be a master record, a transaction data record, or an IDoc segment. The rule maintenance functions are used for various purposes. For example, you might want to define how records from a file are mapped to master data, or want to define derivation rules for transaction data. In a derivation, any missing characteristic values are added to a transaction data record. Another application is the definition of an IDoc segment mapping in which the values of the fields of a segment are changed.

Different Options for Each Object

The options have different structural properties. For example, the validity of transaction data depends on the master data. For this reason, when you maintain the rules for transaction data, you have the option of testing the values against the master data. This option is not required when you maintain rules for master data. This means that you see different options depending on which object's rules you are maintaining.

Sender and Receiver Structure

You define how fields in the sender structure are mapped to fields in a receiver structure. The receiver structure is a set of selected fields that defines an object in the SAP system. The sender structure is the layout of records for the mapped data. It describes the structure of the mapped data, byte by byte. Unlike the sender structure, the fields in a receiver structure are derived from the object that you want to update. You either enter this object yourself when you maintain the sender structure, or it is predefined for certain applications. This means that some fields do not appear, such as the client, the last user to change the object, the date of the last change, or the currency key. These fields are application-specific. You assign a variable to the receiver field. This allows you to enter the field when the data is transferred. For example, you can specify the company or company code for each file.

In this step, you define which fields in the sender structure are mapped to the fields of the receiver structure, and how.

Prerequisites

You must define the sender structure before you define the mapping rules.

Initial Screen

On this screen, you assign the mapping rules to the sender structure. Enter the name of the sender structure for which you want to define or modify the mapping rules. Choose Rules -> Maintain to see the screen Maintain Rules for .

Overview

The table is split into two logical parts.

The left part shows the fields of the receiver structure, is grayed out, and cannot be changed. The receiver structure is determined from the data you specified when you defined the sender structure.

The right part shows the fields of the sender structure, and other fields for the definition of the rules.

If the sender structure of the data you want to map matches the receiver structure, then you can generate an explicit MOVE rule (choose Rules -> Create Proposal for Rule). Any fields for which no assignment could be generated are highlighted in color.

Otherwise, in the Sender Field column, you can enter the name of the sender field that you want to assign to the receiver field.

You can specify that the receiver field only gets a value if the sender field has a value defined by you. Enter the required information.

You can define more rules on a detail screen. To do this, select the line of the receiver field for which you want to define special rules.

Detail Screen

The detail screen for defining mapping rules varies according to whether the field for which you want to define a rule is filled with a characteristic or a key figure:

Characteristic fields are fields that have the role of characteristics, attributes, or classification keys in the SAP system (company code, posting date, order number, for example). From a technical perspective, these are fields with the data type C, N, D, or T, which are not usually unit keys or currency keys, and which do not have a purely technical meaning (like, for example, the client number).

Key figure fields are fields that have the role of key figures, values, or balances in the SAP system (sales, revenue, headcount, for example). From a technical perspective, these are usually fields with the data type P, which can be used for calculations.

Detail screen for maintaining rules for characteristics

You can use the following rules for characteristics:

1. Copy Sender Field
You assign the values of the sender field to the receiver field. However, you can only assign those sender fields whose type is compatible with the type of the receiver field. For example, you cannot assign a field with type C (any character string) to a field of type T (used to store times). This prevents the field from containing invalid values. You can use the Restrict Value Range function to specify that only those values specified by you in the sender field can be copied to the receiver field. You can also specify conditions for other fields in the sender structure, so that the fields are copied only if the data record contains certain values.

2. Set Constant

You assign a fixed value from the set of valid characteristic values to the receiver field. This value is then used for each mapped data record.

1. Set Variable

You assign a variable (see Create Variable below) to the receiver field. This enables you to enter the field when the data is mapped. For example, you can specify the company or company code for each file that is to be read.
You can also assign a fixed value to the variable. In this case, the mapping works in the same way as with a constant. The difference is that the constant fixed value can be used in other locations in the system, with the variable name. In this way, you can improve the consistency of data mappings.

2. Convert Sender Fields
You assign certain values of the sender field to a single value of the receiver field. To do this, you specify the sender fields from the list that you want to include in the conversion.
You can specify an offset and length if you only want to use part of the sender field.
You can also specify a conversion routine. This is executed before the conversion in the sender field value. You might need this conversion routine to fill fields with leading zeros.
Choose Conditions to display a screen where you specify which values the sender fields need to have before they are converted to a specific value of the receiver field. In the left column, specify the target values of the receiver field. In the following columns, specify the individual values or intervals for the sender fields. To enable a receiver field to contain the specified value, all sender fields must have the specified values. If you want to convert different sender fields to the same value of the receiver field, then select the line and choose the pushbutton on the right of the field. A symbol on the right of the field, or the color of the pushbutton indicates that multiple conditions exist.
You can specify complex rules in multiple lines for a receiver field value. When the rules are processed, the first suitable rule is used, however, the rules are not processed in a defined order. You can also set the initial value explicitly for a receiver field value.

3. Use General Rule
You specify a previously defined general rule that you want to use in the data mapping. You can define general rules by declaring the settings made with one of the previous options as a general rule. To do this, enter a unique technical name and a description in the field Use Rule Defined Here as General Rule. After you have saved this general rule, you can use it for other mappings.
You might, for example, always want to assign the company code 0003 to the company code 0002 when you map data. To enable this, you have created a general rule that you can reference for the Company Code characteristic. If you select this rule, the sender fields of the general rule that need to be converted are displayed.
Remember that once you have referenced a general rule, you can no longer delete it. If you still want to delete the rule, you can reassign the rule to the referencing rule.

Application-Specific Options

In some applications, you can decide what happens if a characteristic value does not contain a value, despite the rules.

  • Clear Field
    The field contains the initial value.
  • Classify as Error
    The field is classified as an error. The mapping terminates.
  • Set Constant
    You assign a constant value from the set of valid characteristic values to the field.
  • Copy Sender Field
    You assign the value of a sender field specified by you to the field.
  • EC-EIS only:
    You have the option of specifying whether a receiver field value is checked, or whether it needs to undergo a special (output) conversion routine. For more detailed information on the conversion routines, see the F1 help.

Detail Screen for Rule Maintenance of Key Figures

On the detail screen, you specify how the key figure values are aggregated, how currencies or units are translated, and how the key figure is mapped to the receiver key figure.

  • EC-EIS Only:

You can specify whether the key figure is overwritten in the database or not. If you want to overwrite the key figure in the database, then the value determined from the sender records overwrites the value in the database. If you do not want to overwrite the key figure, then the key figure is read from the database. It is used as the start value in the total operation. Whether this option is required depends on the application. Enter one of the following total operations:

  • SUM
    The total of the sender field values is mapped to the receiver record.

  • MIN
    The smallest mapped sender field value is entered in the receiver record.

  • MAX
    The largest mapped sender field value is entered in the receiver record.

  • FIRST
    The first mapped sender field value is entered in the receiver record.

  • LAST
    The last mapped sender field value is entered in the receiver record.

  • COUNT
    The number of mapped sender field values is entered in the receiver record. This option usually only makes sense if combined with the formula 1 (see Formulas below).

  • Other Applications (Not EC-EIS):

Enter SUM as the total operation. The value of the sender field is mapped to the receiver record (the other total operations in the EC-EIS component are not available, since data is not compressed when it is mapped in other components).

You can use conditions to specify that a key figure is filled only if a sender field has certain values. This function is required in the following example:
The sender structure contains the fields Balance Sheet Item and Balance. The receiver structure contains the key figures ASSETS and LIABILITIES. You can now specify that the key figure ASSETS is filled only if the field Balance Sheet Item contains the value 10000000.

Units and Currencies

Enter a unit in quantity fields, if no default exists.

You have the option of performing a unit conversion for quantity fields or a currency translation for currency fields.

You can specify the exchange rate type, the exchange rate, and the currency for a translation into a target currency. You can either specify fixed values for the currency and translation date, or specify reference fields that contain the currency and date. You can also use a variable for the translation type.

Note: The following applies to amount fields for users of the external data transfer tool, with the exception of the CO-PA application:

The SAP system always saves currency amounts to the database with two decimal places. Amounts of any currencies whose definition includes a number of decimal places other than two need to be transformed to the SAP format.

SAP expects that currency amounts are provided with the usual amount of decimal places. However, when currency amounts are saved to the database in SAP format, the Reference Sender Field must be filled in the mapping rule for currency amounts (this also applies when you map fields according to similar names, without explicit rules). This guarantees that the amount is available in the SAP system with the correct number of decimal places for the specified currency, after the conversion. If you import currency amounts from an SAP system (data in binary format), then the database expects that the data is already in the correct format.

Formulas

You define the formula in the Key Figure Formula Line field. The key figure formulas are formed according to the ABAP rules that are valid for expressions. You can calculate with the sender fields. For an overview of the valid sender fields, position the cursor on the input field and choose F4. You can also use formula variables in the formula.

As with the mapping rules for characteristics, you can save the current rule as a general rule. To do this, enter a name for the rule in the field Use as General Rule.

If you want to use a general rule for the mapping, then enter the name of a rule stored in the system in the field General Rule. The sender fields that you want to convert are shown.

Creating Variables

You can create variables for characteristic values, formulas, and translation keys. These variables can then be used in mapping rules. Variables for formulas and translation types can be used globally. Variables for characteristic values can only be used for the object you are processing. To create variables from the detail screen, choose Goto -> Variables -> Translation Key or Goto -> Variables -> Formula Variables. On the next screen, choose Edit -> Insert Line or use any empty line that exists. To define a variable, proceed as follows:

  1. Enter the name of the variable in the Variable Name column. The first character of the variable name must be a &, followed by a letter (the system inserts the & automatically, if you forget it) The total length of the name cannot be greater than 10 characters (including the &).
  2. Select a replacement type. The replacement type specifies the way a variable is replaced by a value. You can use replacement type 2 to specify the variables when you start the data transfer (this is currently supported for the reading of files and for aspect summarization only). If you select replacement type 5, you must also enter a fixed value in the next column. To be able to use replacement type 3, you must activate the function module EXIT_SAPFKCIM_003 in a user exit.
  3. Enter a description of the variable.
  4. Save your entries.






BAL Application Log Documentation   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 18343 Date: 20240523 Time: 201826     sap01-206 ( 391 ms )