Show TOC
Maintain
Transfer Rules
Activities
In this activity, you define how you want data
stored in the format of an external structure to be mapped to the data
structures of your operating concern. You define this mapping at the
field level.
On the initial screen, enter the name of the
sender structure. Then go to the overview screen by choosing "Maintain" or
"Display".
The overview screen shows a table containing
the fields of the operating concern that were defined in the sender structure.
You can generate an automatic assignment of fields in the
external structure to the fields of the operating concern by choosing "Create
proposal for rule".
If you want to define manually how a field of
your operating concern should be populated, select that field and choose the
"Detail" icon. Here you have a number of different options, depending on the
type of field.
I. Detail
Screen for Defining Rules for Characteristics
You can define the following rules for
characteristics in your operating concern:
1. Copy sender
field
This rule assigns a
field in the external structure to a characteristic in the operating
concern.
Using the "Restrict
value ranges" function, you can specify explicitly which values of the sender
field should be copied to the target field. You can also use special
"conversion routines" for the transfer. This makes it possible, for example,
to fill a field with leading zeros. In addition, you can specify conditions
for other fields, so that the field content is only transferred if certain
other fields of the external structure contain certain values.
Example:
Suppose the country
in the sender record is "France" and you want to transfer the divisions "01"
through "09" from the sender to the same divisions in the operating concern.
To achieve this, you enter the sender characteristic "SPART" under "Sender
Field to be Transferred". Then choose "Restrict value ranges" and enter the
divisions "01" through "09". Under "Sender fields for conditions", enter the
characteristic "LAND". Then choose "Conditions" and enter "France" as the
condition for the transfer.
If a characteristic
is not populated during an external data transfer, you have
the following options:
a) "Set to
initial"
The field receives
its initial value (blank or "0").
b) "Classify as
error"
The case is
registered as an error.
c) "Set
constant"
A constant is
entered in the field.
d) "Copy sender
field"
The system copies
the value of another sender field.
2. Set
constant
You can assign a
fixed value to the sender field.
Example:
You want all
external plan data to be transferred to version 001. To achieve this, you set
the constant "001" for the characteristic "VERSI".
3. Set
variable
You assign a
variable to the receiver field. This makes it possible for you to specify a
value for this field when you carry out a data transfer. For example, you can
use this option to specify the company code manually for each data being
imported. You can also define a fixed value for the variable.
Example:
You want to specify
the company code when you carry out the data transfer. To achieve this, you
define a variable "&COCODE" by choosing "Goto -> Variables ->
Characteristic variables" and selecting replacement type 2 (manual entry).
Then save the variable. Then enter this variable for the receiver
characteristic "BUKRS".
4. Convert
sender fields
This option lets you
specify which fields of the external structure you would like to convert. By
specifying an offset and a length, you can copy only part of the sender field.
Also, you can specify a conversion routine that the system should carry out
before converting the sender field value.
When you choose the
"Conditions" function, the system takes you to a screen where you can specify
the values the sender field must have for the conversion to take
place.
In the left-hand
column, you enter the "target" values of the receiver field. In the subsequent
columns, you can enter single values or intervals for the sender fields. All
of the sender fields must contain the specified values for the receiver field
to receive that value. If you want a sender field to be able to have more than
one value, select the line and choose "Multiple selection" next to the field.
An icon to the right of the field shows that multiple criteria have been
specified. You can also define more than one line for one receiver field
value. When you carry out the data transfer, the system chooses the first rule
that works. However, the order in which the rules are processed is not
defined. It is also possible to enter a receiver field value explicitly or set
the field to its initial value.
Example:
You want to use the
sender fields "Sold-to party" and "Division" to determine the value for the
receiver field "Sales district". To achieve this you enter the sender
characteristics "AUFGB" and "SPART" under "Sender fields to be converted" and
choose "Conditions". Then you enter the desired conditions - for example,
sales district "0001" is found for sold-to party "000001000" and division
"02".
5. Use general
rule
You can enter a rule
that should be used for more than one transfer.
You can decide that
the rule should be used as a "general rule". To do so, enter a name and a
description in the field "Use the rule defined here as a general
rule".
Example:
You want to transfer
the data for the sender characteristics "Region" and "Product group" to the
receiver characteristic "Customer group" in multiple transfers. To be able to
use a defined rule more than once, you need to define a general rule. You
define this rule as described above for "Convert sender field". Then you enter
a name and a description for the rule in the field "Use rule defined here as
general rule", and save your entries. You can then use this rule in other
sender structures by choosing the "Use general rule" function. When you select
a rule, the system displays the sender fields to be converted by the general
rule.
Once a rule is
referenced, you can no longer delete it. If you want to delete the rule, you
need to append it to the rule that references it.
II. The Detail
Screen for Defining Rule Values for Value Fields
On the detail screen, you define how the values
in the external file should be transferred to the value fields of your
operating concern.
In the "Key figure formula" box, enter the name
of the external field that you want to transfer to the selected value
field.
You can also calculate using sender fields. To
do so, you need to define a formula using the fields in the external
structure. You can display a list of the valid sender fields using the
"Possible entries" function. It is also possible to work with variables in the
formula. The formulas are defined using the syntax rules that apply in ABAP.
For more information, see the field help (F1) for the input field.
You can use conditions to specify that a key
figure is only populated if a certain sender field contains a certain
value.
As with the transfer rules for characteristics,
you can save your rule as a general rule by entering a name in the "Use as
general rule" field. To use this rule for the transfer, enter a name in the
"General rule" field. The system displays the sender fields that are to be
converted.
Further
Notes
Define
variables
You can define variables for characteristic
values and formulas, and use these when you define your transfer rules.
Variables for formulas are global. Variables for characteristic values are
only valid for the object that you are processing. To create a variable,
choose "Goto -> Variables" from the detail screen. Then choose "Edit ->
Insert line" on the next screen. The system inserts as ampersand (&) in
the field. Enter the name of the variable directly after this ampersand. Then
choose the desired replacement type. If you choose replacement type "2", you
can replace the variable manually when you carry out the external data
transfer. If you choose "5", you must enter a fixed value. If you choose "3",
you must activate function module EXIT_SAPFKCIM_003 as a user exit. Finally,
enter a description for the variable and save your entries.