Você está na página 1de 49

Creating a New Migration Object

1
CREATING A NEW MIGRATION OBJECT

Would you like to know more about how to create your own migration
objects with the migration object modeler? If so, follow this interactive
demo.

You want to migrate data in your S/4HANA System (on premise). You
have created a migration project with the name, Project Bank Migration, in
the SAP S/4HANA Migration Cockpit. Now you want to create your own
migration object.

We start in the migration object modeler (transaction LTMOM) in


the project Project Bank Migration

2
CREATING A NEW MIGRATION OBJECT

If you have specific requirements that are not covered by the migration
objects provided by SAP, you can create user-defined migration objects.
These user-defined migration objects have the following restrictions:

 The source structure must be a file.


 A function module must populate the target structure with data.

Prerequisites:
You have created a project using the SAP S/4HANA Migration Cockpit.
You use the mass transfer ID associated with this project for the new
migration object.

3
CREATING A NEW MIGRATION OBJECT

(1) Choose Migration Object.

(2) In the Create Migration Object sub menu, select User-Defined.

4
CREATING A NEW MIGRATION OBJECT

(3) You have to enter a technical name for your migration object. The first field contains
the technical name of the migration object, the second field is the mass transfer ID. The
mass transfer ID is derived from the project. The system will add the prefix Z_ to your
technical name.

In the Migration Object ID field, enter Bank_Data.


.

(4) Enter Bank Master Data as description and choose Next.

5
CREATING A NEW MIGRATION OBJECT

(5) Enter BANK_BAPI_CREATE as the name of function module and press Enter.

6
CREATING A NEW MIGRATION OBJECT

These settings specify how the function module processes the data from a
specific source, (for example the data from a file).Two options are
available:

Process One Instance at a Time.


The system can pass data to the function module one instance at a
time. This means if N records must be read, the function module will
be called N times. Note that this can negatively impact performance.

Process Multiple Instances at Once.


The system can pass all the records to the function module at
once. This means that the function module is called only once.

If the function module encounters errors when processing the passed


data, it should return appropriate feedback in the form of messages to the
user. Here, you can specify the return parameter that contains such error
messages.

 Parameter That Returns Result: The return parameter that contains


the messages.
 Include for Handling Return Parameter: The name of the include
file that handles the return parameter.

7
CREATING A NEW MIGRATION OBJECT

(6) Choose the list Parameter that Returns Result list.

(7) Choose Return with a double-click.

8
CREATING A NEW MIGRATION OBJECT

If you want to simulate a data transfer without writing data to the target
system, you can specify the relevant settings here. The following options
are available:
 Parameter for Simulation: The parameter of a function module that
refers to the simulation or the writing of data.
 Value for Simulation: If the data transfer is started in test mode and
you specify a simulation value here, the simulation value is shown
as a result.
 Value for Writing Data: If the data transfer is not started in test
mode, and you specify a value here, then this value will be written
as a result.

9
CREATING A NEW MIGRATION OBJECT

(8) Choose the Parameter for Simulation list.

(9) Choose I_CHECK_BEFORE_SAVE with a double-click.

10
CREATING A NEW MIGRATION OBJECT

(10) Enter X as value for simulation and choose OK.

You can now see that the new migration object Z_BANK_DATA_0FG has
been created successfully.

11
CREATING A NEW MIGRATION OBJECT

(11) To create the relevant source structure, double-click Source Structures.

(12) Choose Change<-> Display to enable change.

12
CREATING A NEW MIGRATION OBJECT

(13) Choose Source Structures with right mouse button.

(14) Choose Append Structure to Lower Level.

13
CREATING A NEW MIGRATION OBJECT

(15) Enter S_MASTER_DATA as the name of sender structure and press Enter.

Note: The name should not contain blanks.

(16) Enter Sender Bank Master Data as description and choose OK.

14
CREATING A NEW MIGRATION OBJECT

(17) Choose Add Field.

(18) Enter Bankcountry as the name of the field and press Enter.

15
CREATING A NEW MIGRATION OBJECT

(19) Enter CHAR as data type and press Enter.

(20) Enter 80 as length and press Enter.

16
CREATING A NEW MIGRATION OBJECT

(21) Enter BANK COUNTRY KEY as the column header and press Enter.

(22) Select Key Field checkbox.

17
CREATING A NEW MIGRATION OBJECT

To create additional fields, you can repeat the previous steps. For this
demo, the fields highlighted have been created for you.

(23) Choose Save.

18
CREATING A NEW MIGRATION OBJECT

(24) You now create a customer view for your source structure.

Choose Sender Bank Master Data with the right mouse button.

(25) Select Display View.

19
CREATING A NEW MIGRATION OBJECT

(26) Choose the Open button.

(27) To create customer view, select Customer View 1.

20
CREATING A NEW MIGRATION OBJECT

You can use these views to adjust the fields that are available in the
template file for the migration object. For each source structure field, you
can choose whether it is visible, required, or not visible in the customer
view. You can change these attributes in edit mode.

(28) Choose Save.

21
CREATING A NEW MIGRATION OBJECT

(29) Double-click Target Structures to open.

Here you can get an overview of the target structures associated with the
migration object. Note that structures can be single fields, multiple fields,
or tables. You can check the attributes of the field associated with the
target structure, (for example the data type and length).

22
CREATING A NEW MIGRATION OBJECT

(30) Double-click Structure Mapping to open.

In the Structure Mapping area, you have to decide how the source
structures associated with a migration object are mapped to the target
structures in the SAP S/4HANA system. Note that structures can be single
fields, multiple fields, or tables

23
CREATING A NEW MIGRATION OBJECT

To map a source structure to a target structure, drag a source structure


from the right-hand side to the relevant target structure on the left-hand
side.

24
CREATING A NEW MIGRATION OBJECT

The suffix << Sender Bank Master Data, has been added to the target
structure to indicate that the source structure is mapped to the target
structure. As you can see, the following have been mapped to the sender
structure using drag and drop:

 BAPI_BANK_CREATE
 Bank country key
 Bank key
 Transfer structure object 1011

(31) Choose Save.

25
CREATING A NEW MIGRATION OBJECT

(32) Double-click Field Mapping to open.

26
CREATING A NEW MIGRATION OBJECT

In the field mapping area, you can map fields from the source structure to
fields in the target structure.

In the following steps you will learn three different ways to map the source
structure to the target structure and assign the necessary rule.

The first possibility is to assign an already existing rule to the target


structure field.

(33) Choose Bank country key with the right mouse button.

27
CREATING A NEW MIGRATION OBJECT

(34) Choose Assign Rule.

In this demo we use the already existing rule CVT_LAND1 to assign the
source structure field Bank country key to the target bank country key.

28
CREATING A NEW MIGRATION OBJECT

(35) Enter CVT_LAND1 as the rule name and press Enter.

(36) Open the Parameter Value IV_LAND1 list.

29
CREATING A NEW MIGRATION OBJECT

(37) Choose S_MASTER_DATA-BANKCOUNTRY with a double-click.

(38) Choose Continue.

30
CREATING A NEW MIGRATION OBJECT

You can now see the assign rule for Bank country key. If a field from a
source structure has been mapped to a target field, the system displays a
green icon beside the name of the field.

We will now assign rule CVT_BANKL for Bank Keys in the similar way.

31
CREATING A NEW MIGRATION OBJECT

The rule CVT_BANKL for Bank Keys has been assigned in a similar way.

The second possibility to assign a rule is to use Drag and drop.

To map a field from a source structure to a target field, drag the relevant
field from the right-hand side to the target structure field on the left-hand
side. The resulting mapping operation is a simple 'MOVE' operation - that
is, the values of the source field will be moved to the target field.

32
CREATING A NEW MIGRATION OBJECT

As you can see the rule MOVE has been assigned to the target structure
field Name of bank.

The third possibility to assign a rule is to Create a own rule.

33
CREATING A NEW MIGRATION OBJECT

(39) Choose City with the right mouse button.

(40) Choose Assign Rule.

34
CREATING A NEW MIGRATION OBJECT

(41) Enter ZCITYMOVE as name and press Enter.

(42) Choose Create Rule.

35
CREATING A NEW MIGRATION OBJECT

(43) Enter Conversion Rule City as the description and press Enter.

(44) Enter IV_CITY as the parameter and press Enter.

36
CREATING A NEW MIGRATION OBJECT

(45) Open the Flow Direction list.

(46) Select 1. Import Parameter.

37
CREATING A NEW MIGRATION OBJECT

(47) Open theTyping Method list.

(48) Choose TYPE_ANY with double click.

38
CREATING A NEW MIGRATION OBJECT

You have to add an exporting parameter as well. In this demo the


parameter EV_CITY with the flow direction Export Parameter and typing
method TYPE_ANY has been added for you.

(49) Choose the Variants tab.

39
CREATING A NEW MIGRATION OBJECT

(50) Open the Variant Type list.

(51) Select Free Code.

40
CREATING A NEW MIGRATION OBJECT

(52) to open the code editor choose Rule Editor.

Enter the necessary code. For this demo it has been added for you.

41
CREATING A NEW MIGRATION OBJECT

(53) Choose Save.

(54) Choose Continue.

42
CREATING A NEW MIGRATION OBJECT

(55) Choose Back.

(56) Save the newly created rule and choose Back button.

43
CREATING A NEW MIGRATION OBJECT

(57) Open the Parameter Value list.

(58) Choose S_MASTER_DATA_CITY with a double-click.

44
CREATING A NEW MIGRATION OBJECT

(59) Choose Continue.

As you can see the rule CITYMOVE has been assigned to the target
structure field City.

Note: Do not forget to save your changes

45
CREATING A NEW MIGRATION OBJECT

(60) To check, if the generated programs are free from syntax errors choose Generate
Runtime Object.

(This generates the programs required to read data from the source system and to transfer
data to SAP S/4HANA.)

(61) The display log confirms the object is created without any errors.

Choose Continue.

46
CREATING A NEW MIGRATION OBJECT

The new Migration Object has been created. You can view the
object template in the SAP S/4HANA Migration Cockpit. (TA LTMC).

(62) the newly created object Bank Master Data appears in your migration project in the
SAP S/4HANA Migration Cockpit.

Choose Bank Master Data.

47
CREATING A NEW MIGRATION OBJECT

(63) Choose Download Template and open the downloaded excel file.

You can now see the excel template for your own created migration object
with the four added fields.

This concludes the interactive demo.

48
CREATING A NEW MIGRATION OBJECT

49