Sample transaction-based connection and Direct Transfer activity
This section illustrates a transaction-based connection and the Direct Transfer activity that uses it.
Connection document
The SAP connection document has a field called Screen Input Field Definition that serves as a multi-value field containing all information required for a given transaction.
- The programs and screens to be used
- The OK codes to be executed
Specifying a screen
When you want to use a new screen, add the following entry:
$<Program>=<Screen> for example $SAPMF02D=0101
The ‘=’
operator indicates that no data is passed to
<Program>
when the activity is executed. Whenever you assign
a value to a field with the ‘=’
operator, this assignment is
considered to be constant during the execution of the activity.
Specifying OK codes and constant values
You can use the ‘=’
operator for constant assignments. If your
source data contains OK codes on a per- record-basis, you may want to use constant
assignments for all the OK codes.
BDC_OKCODE=<code>
An example is shown below.
BDC_OKCODE=/00
You can also use these constant assignments for other fields in your transactions that always have the same value (for example Organizational Unit, Factory ID, and so on.).
Fields to be mapped with your source
All remaining fields that receive values from the Source do not have any assignment. You just need to enter all fields used by the transaction.
<FieldName>
An example is shown below.
KNA1-NAME1
Loop fields
Some transactions do contain so-called loop fields. You may think of loop fields in much the same way as arrays. Assume you want to create an order in ECC. That order has multiple line items. Each line item is referred to by the index of its row position.
EKPO-EMATN(01)
EKPO-EMATN(02)
EKPO-MENGE(01)
EKPO-MENGE(02)
RM06E-EEIND(01)
RM06E-EEIND(02)
Entry order
$Program=Screen
statement. After that, you must
list all fields that belong to that screen. Before you can enter fields that belong
to another screen, you must add another $Program=Screen
statement,
as shown below.
$<Program1>=<Screen1>
<Field1 for Screen 1>
<Field2 for Screen 1>
<Fieldn for Screen 1>
BDC_OKCODE=<OK code>
$<Program2>=<Screen2>
<Field1 for Screen 2>
<Field2 for Screen 2>
<Fieldn for Screen 2>
BDC_OKCODE=<OK code>
Activity document
A Direct Transfer activity document is used as an example in this section, however, the comments also pertain to a Virtual Fields activity document.
Specifying Metadata
When you create metadata you must map the Source fields with the transaction previously defined in the "Connection Options" field of the connection document.
Specifying a select statement
You can add a field to your data Source that indicates whether source data has been changed and, if so, that you want to pass the change to ECC. For example, with Notes as the Source, you could check for field "IsModified" in the Form "Customer". The corresponding Select Statement is shown below.
SELECT Form = "Customer" & IsModified = "1"
Using the stored procedure option
Transaction-based activities must be processed through a stored procedure call. Enable the "Target Metadata is Stored Procedure" option on each transaction-based activity document.