In this section you carry out the second work step for the rule. Rules are defined for each field.
The rules determine how fields are converted and mapped from a source object to a target object. Objects could be, for example, master data, a transaction, or an IDoc segment data record. Rule maintenance is used for different purposes. It is used, for example, to define how file records are mapped to master data or to define derivation rules for transaction data. With a derivation rule a transaction data record is updated with missing attributes (enhanced). Another use is to define the mapping of IDoc segments. Here the values of the fields belonging to a segment are changed.
Objects can have differenet structure attributes. For example, the validity of transaction data depends on the master data. For this reason when the rules are maintained for transaction data, the option is provided to check the values against the master data. When rules are maintained for master data, this option is not necessary and is not provided. With rule maintenance different options are provided depending on the objects involved.
When maintaining the rules you specify how fields of the sender structure are mapped to the fields of a receiver structure. With the receiver structure this involves a quantity of selected fields which define an object in R/3. The sender structure represents the record layer of the transferred data. It describes byte by byte the structure of the transferred data. Whereas the fields of a receiver structure are derived from the object that is to be updated. This object is specified either by you when you define the sender structure, or in some applications, it is predefined. Some fields are not displayed, for example, the client, person last changed by, date last changed and the currency key. They are all assigned by the applications. You assign a variable to the receiver field to enable you to enter the field when the data is transferred. For example, you can enter the company or the cost center for each file to be imported.
In this activity you define how and which sender structure fields are mapped to the receiver structure fields.
You must define the sender structure before you can determine the transfer rules.
Here you assign the transfer rules to the relevant sender structures. Enter the name of the sender structure for which you want to define or change the transfer rules. Choose Rules-> Maintain to get to the overview screen Maintain rules for <name of sender structure
The table is split into two logical parts:
If the sender structure of the data to be transferred matches the receiver structure, you can have the system generate an explicit MOVE rule (Rules-> Generate rule proposal). Fields for which no assignment could be generated appear with a color background.
Otherwise, in the column sender field, you can enter the name of the sender field that you want to assign to the relevant receiver field.
You can define that a value is only assigned to the receiver field if the sender field value contains a specific value that you define. Make the required entries here.
You can define further rules on a detail screen. To do this, you must select the row containing the receiver field for which you wish to define special rules.
There are two different detail screens for defining transfer rules. The one you use depends on whether the field for which you wish to define a rule is filled by a characteristic or a key figure:
You can use the following rules for characteristics:
In some applications you can decide what happens when a characteristic value contains no value in spite of the rules.
EC-EIS only:
You can determine whether a receiver field value is to be validated or if it is to undergo a special output/ conversion routine. For more information about conversion routines, see F1-Help.
In the detail screen, you determine how the key figure values are to be aggregated, how currencies or units are to be translated, and how the key figure is to be mapped to the receiver key figure.
EC-EIS only:
You can determine whether the key figure in the database is to be overwritten or not. If it is to be overwritten, then the value determined from the sender records overwrites the value in the database. If the key figure in the database is not to be overwritten, then the key figure value is read from the database. This value is taken as the starting value for the total operation. This option may or may not be desirable depending on the application.
Specify a total operation. The following alternatives are available:
Using conditions, you can determine that a key
figure is only filled when a sender field accepts specific values. This
function is necessary in the following example:
The sender structure contains the fields balance sheet item and balance.The
receiver structure contains the key figures AKTIVA and PASSIVA. You can now
define that the key figure AKTIVA is only filled when the balance sheet item
field contains the value 10000000.
Other applications:
Enter the total operation SUM. The sender field value is transferred to the receiver field.
Enter a unit for quantity fields where no proposal exists.
For quantity fields, you can have a unit translation carried out and for currency fields, a currency translation.
Concerning the currency translation, you can determine which exchange rate, which exchange rate type and which currency you wish to translate into the target currency. You can either specify fixed values for the currency and the translation date, or reference fields which contain the currency and the translation date. You can also use a variable for the currency translation key.
Note: For all users of external data transfer except in the CO-PA application, the following applies to the amount fields:
In the SAP System, currency amounts are always written to the database with two decimal places. Amounts in currencies that, according to the currency definition, have more or less than two decimal places, must be transformed to this SAP format. See example:
| Currency | DEM (2 DP) | ITL (0 DP) | KWD (3 DP) | |||
|---|---|---|---|---|---|---|
| Amount | 123,45 | 12345 | 12,345 | |||
| Amount in the database | 123.45 | 123.45 | 123.45 | |||
| Format: CHAR | 123.45 | 12345 | 12.345 | |||
| Note: A +/- sign can be entered before or after the amount. | ||||||
| Format NUMC | not possible. | 12345 | not possible. | |||
| Note: Decimal places and +/- signs are not possible with NUMC formats. | ||||||
| Format: PACKED (10,0) | 123 | 12345 | 12 | |||
| Format: PACKED (10,3) | 123450 | 12345000 | 12.345 | |||
| Note: see number format |
The SAP System expects currency amounts to be delivered with the regular decimal places. To store the currency amounts in SAP format in the database, the field reference sender field must be filled in the transfer rule for currency amounts (this also applies if you transfer the fields without explicit rules using identical names). This guarantees that, after the conversion, the amount is available to the SAP System with the correct number of decimal places for the specified currency. If you import currency amounts from an SAP System (data in binary format), the host system expects the data to be in the correct format for storing in the database.
In some applications you can specify one of the sender fields as a currency reference field. This way you can make the target currency dependent on the specified reference field, rather then fixing it.
You define the formula in the field Key figure-formula row. The key figure formulas are created according to the valid ABAP rules for terms. You can calculate with the sender fields. To see the valid senderfields, position the cursor on the entry field and press F4. You can also use formula variables in the formula.
As with transfer 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 a general rule'.
If you want to use a general rule for the transfer, enter the name of a rule stored in the system in the field General rule . The sender fields to be converted will appear.
You can create variables for characteristic values, formulas, and translation keys to be used for transfer rules. Variables for formulas and translation keys can be used globally. Variables for characteristic values can only be used for the object that you are currently working on. To create variables, on the detail screen choose Goto -> Variables -> Translation key or Goto -> Variables -> Formula variables. On the next screen, choose Edit -> Insert row or use an empty row if available. To define a variable, proceed as follows: