0% found this document useful (0 votes)
86 views

HDHSSD Oo

SDSDF FDFSD SS D

Uploaded by

RONALD TORRES
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
86 views

HDHSSD Oo

SDSDF FDFSD SS D

Uploaded by

RONALD TORRES
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Version: 2, Date 2020-01-06

SNP2[TC] Exercises

SNP | SNP2[TC] Release: 19.03 SP00

SNP Schneider-Neureither & Partner SE


Dossenheimer Landstraße 100 | 69121 Heidelberg
Tel.: + 49 6221 6425-0 | Fax: + 49 6221 6425-20
E-Mail: [email protected] | Internet: www.snpgroup.com Page 1 of 44
Content

General Information .................................................................................................................. 3


Logon Data ............................................................................................................................... 4
Scenario .................................................................................................................................... 5
Exercise 1: Create and Check System Connections ................................................................. 6
Exercise 2: Create Scenario and Make Settings........................................................................ 7
Exercise 3: Create Tasks ........................................................................................................ 10
Exercise 4: Data Objects ......................................................................................................... 12
Exercise 5: Maintain Selections and Export Rules................................................................... 17
Exercise 6: Adding Mappings and Import Rules ...................................................................... 29
Exercise 7: Create and Perform the Transformation ................................................................ 36
Exercise 8: Foreign Key Check ............................................................................................... 42

Page 2 of 44
General Information
Please replace the characters XX by the participant number you received from your trainer at the
beginning of this training.

Page 3 of 44
Logon Data
At the beginning please check whether logging on to the following systems works.

Please, replace the XX by the participant number, your trainer assigned to you at
the beginning of the training.

SAP-Logon

Training Control System Line 1 Kommentiert [GN1]: Linie 1 hnzugefügt


Application Server: 172.16.254.120
Instance number: 00
System-ID: TRA
CLient: 001

Training Source/Target System TAR Line 1


Application Server 172.16.254.121
Instance number: 00
System-ID: TAR
Client: Source: 800/Target: 9XX

-----------------------------------------------------------------------------

Logging on to SAP

User: SU_TBXX
Password: initial (afterwards please select your own password)

Page 4 of 44
Scenario
You are consultant in a transformation project. The customer instructs you to migrate sales
documents from source system SNP-TAR-800 into a target system, which has not yet been
determined. All dependent data must be adopted to the target system. Moreover, parts of the
data shall be adjusted according to the requirements of the customer.

The transformation tool you use is the Transformation Cockpit (/n/SNP/TC). Since the
Transformation Cockpit needs a control system the customer provides the solution manager
system SNP-TRA-001 to you. All necessary transports have already been imported and the
software has also been licensed.

Furthermore, the system administrator of the customer has already created RFC connections in
transaction SM59, as well as the corresponding whitelist entries for all determined systems
(control and source system) according to the SNP name convention. The systems have also
been entered into the system maintenance of the Transformation Cockpit and can now be used
for the transformation.

Page 5 of 44
Exercise 1: Create and Check System Connections
Now the customer also provides the target system SNP-TAR-9XX (XX is your participant
number).

Logon to the control system using username SU_TBXX (e.g. SU_TB01, SU_TB02, …) and
password initial. Check whether a RFC as well as a dialog RFC connection has already been
created (SM59) and write down the names for further steps.

____________________________________

____________________________________

Change to the Transformation Cockpit, which you call by transaction /n/SNP/TC. If there is a
message that there is no chosen scenario, go to the SAP menu and select Scenario  Select
scenario. Choose one of the available scenarios.

System Maintenance Transformation Cockpit

Now you have to announce the provided target system of the customer to the Transformation
Cockpit, in order to use it later on in the tool. Choose Systems in the left-hand navigation bar and
afterwards select Jump  Sys. Maint. in the SAP menu. Alternatively, you can use transaction
/SNP/TCSYS. Add a new entry to the list and maintain the necessary data:

 RFC connection to the target system (SNP_TB_TAR_9XX)


 Callback RFC connection to the control system (SNP_TB_TRA_001)
 Dialog connection to the target system (SNP_TB_TAR_9XX_DIA)
 Description (e.g. SNP_Training_9XX)

Refresh the system details via button Refresh system details. The fields for technical data such
as system ID etc. will be filled automatically. Confirm your entries and save the created system.
Now you can use it working with your transformation project within the Transformation Cockpit.

Page 6 of 44
Exercise 2: Create Scenario and Make Settings
Since the Transformation Cockpit is delivered without content, it is necessary to create a new
or upload an existing scenario in the next step.

Create a Scenario

You decide to create a new scenario. To do that select Scenario  Create new scenario in the
SAP menu.

Maintain the following entries and confirm them:

 Scenario ID: SNP_TC_XX


 Scenario title: SNP_TC_EXERCISE_XX

Assign Systems to the Scenario

In the next step, you have to assign at least one source and one target system to your scenario.
In order to do that, go back to Systems in the left-hand navigation bar, choose tab Systems and
assign them as follows:

 Source system: SAP-TAR-800


 Target system: SAP-TAR-9XX

The customer wishes for the exported files to be deposited in the register /export/. Check the file
path for the source, as well as the target system.

Also, please add a new Alias name Source_1 for the source system.
Save your entries.

Switch to tab System connections and check if all necessary connections are entered. Which
connections are necessary for a data migration from source to target system?

____________________________________

____________________________________

Afterwards, check the system connections using button Check system connections.

Page 7 of 44
Which results does the connection check show regarding the whitelist entries in your system?

____________________________________

Maintain Whitelist Entries

With the aid of the connection check you found out, that the customer did not maintain a whitelist
entry for the dialog connection on the control system to the provided target system. Normally you
ask the customer to carry out this task subsequently. In the context of this training, you solve the
problem by yourself. Hence, open transaction /n/SNP/PXRFCWL and maintain the missing
whitelist entry.

To do that, search for your RFC connection and perform the action Write entry. You have now
maintained the whitelist entry successfully.

Check the system connections again under Systems. The message does not appear anymore.

Upload Scenario

Now switch to the area Data Objects. In the center screen area, you will see the scenario you
have created. This scenario is empty at this point. For a complete transformation of the sales
documents it is also necessary to migrate data from the modules FI, MM and SD. Furthermore,
you need a data object, which collects the addresses out of the corresponding objects as well as
a predecessor, which prepares the mapping (e.g. number get next) for certain objects in the
target system later.

Now, an exercise content named SNP_TC_EXERCISE_XX is provided to you. The scenario


contains the most important data objects, selections, mappings, rules and global functions for
your migration. Import the exercise content into your already created scenario as follows:

1. Select Scenario  Upload scenario in the SAP menu.


2. In the field Scenario enter the already created scenario (SNP_TC_XX).
3. Choose Import from client and using file path (XML/Zip) enter the path to the scenario
your trainer provided to you (SNP_TC_EXERCISE_XX) in the field File path (XML/Zip).
4. Change the number of processes to 1 and execute the import process.
5. Select all table entries in the window Scenario import and press the Import button. All
entries are now marked for the import.
6. Press the Execute button and confirm possible notifications with Yes.

Page 8 of 44
7. Also confirm the appearing message asking whether you want to go to the imported
scenario with Yes.

Make Basic Settings for the Scenario

You can select settings for the scenario in tab run parameters in the left-hand navigation bar
under Data objects after double-clicking the scenario. Check, which values are defined in the
fields Pack.-size for other tasks and Processes for other tasks. For which kind of tasks are these
values used?

____________________________________

____________________________________

Finally, change the Max. package size (MB) to 10 MB and save your entry. Reaching a file size
of 10 MB or 200.000 datasets (it counts what is reached first) a new file will be generated for the
export.

Now you have successfully made all settings for your scenario.

Page 9 of 44
Exercise 3: Create Tasks
Your project manager wants the project team to centrally store all corresponding project tasks
in the Transformation Cockpit.

He asks you to maintain the following task in the task list using ID 001:

 Setup satellite system with the description Setup source and target system, check
logical system, maintain whitelist entries

For that entry the following subtasks shall be maintained:

 Source system RFC with the description Setup RFC connection


 Target system RFC with the description Setup RFC connection
 Source system whitelist with the description Maintain whitelist entries
 Target system whitelist with the description Maintain whitelist entries

Proceed as described below:

1. Change to the area Tasks.


2. Create a new entry in the task list using the Create-new-button. Enter the above-
mentioned title of the task list and save your entries.
3. Select the just created entry by double-click.
4. Using the add button, maintain the subordinated tasks and enter the above-mentioned
titles and descriptions.
5. Save your entries.

Since you can only maintain whitelist entries for already existing RFC connections you should
set up necessary dependencies for your tasks. To do that choose button Maintain dependencies.

Now enter the dependencies for the tasks. Each whitelist entry needs the predecessor Setup
RFC connection.

Page 10 of 44
You know that all necessary RFC connections and whitelist entries for the source system have
been maintained. That is why you can set the status of the subtasks regarding the source to
Done. Which status does the main task assume in the task list now?

____________________________________

We assume you have found out that a RFC connection but no whitelist entry for the target
system has been maintained. Consequently, you should set the status for the whitelist entry to
Erroneous. How does the status of the main task in the task list change now?

____________________________________

Finally, set all remaining subtasks to Done, as well. The main task is also displayed as Done
now.

Page 11 of 44
Exercise 4: Data Objects
In the next step, you must ensure that all necessary objects and tables you need for your
transformation of sales documents are maintained in the area Data objects.

While checking, you find out that the tables for the customer master data from the SD module
are missing. An experienced SD consultant tells you that the tables you need can be found in the
data object VTDE_TRAINING and that it has already been imported into another scenario on the
same system.

Copy from Data Object

Your next task is to copy the corresponding data object (VTDE_TRAINING) from scenario
SNP_SALES_ORDER.

Proceed as follows:

1. Open area Data objects and right-click on the scenario. Create a new module.
2. Enter the ID SDXX and the name SDXX.
3. Perform another right-click on the just created module and create a data object.
4. Enter ID VTDE_TRAINING and title sales customer.
5. The status of the data object is active. Save your entries.
6. Double-click on the data object VTDE_TRAINING and switch to the tab Mass
maintenance.
7. Press the button Copy from data object and type the scenario SNP_SALES_ORDER in
the appearing window. Choose the object VTDE_TRAINING with the help of the search
help. Uncheck the options Copy export rules and Copy import rules and press the Next
button.
8. Now select the whole object and press Apply.
9. Save your entries.

In the mass maintenance of your created data object you can now see the copied tables and
their dependencies (see Predecessor no. and Selection tables).

Alternatively, you also could have copied the data object VTDE_TRAINING directly into the
module SD. Move the object into the SD module changing the module assignment. Perform a
right-click on the data object and choose Further functions  Change module assignment.

Page 12 of 44
Create and Connect Tables

The next thing you find out with the help of an FI consultant is that the tables for the bank details
are missing in the data object DEBI_TRAINING. That concerns the selection table KNBK
(Customer master data: Bank details) and the dependent tables BNKA (Bank master data) and
TIBAN (IBAN). Note that table BNKA has the dependent table CDHDR (Change document
header) and this one also has the dependent table CDPOS (Change document position) (see
figure below).

Create the tables within the object DEBI_TRAINING and place them as dependent tables under
selection table KNB1.

Proceed as follows:

1. Perform a double-click on the data object DEBI_TRAINING in the Data object area.
2. Select the tab Mass maintenance and add the tables KNBK, BNKA and TIBAN using the
functionality Add from DDIC.
3. In the next step maintain the dependencies of the tables in field Predecessor No. Table
KNBK has the selection table KNB1. Consider field No. of table KNB1 and maintain this
one in field Predecessor No. of KNBK (see figure). Repeat the process for TIBAN and
BNKA. Note that both have the selection table KNBK (different Predecessor No.). Save
your entries (a resorting of the tables take place automatically).

Page 13 of 44
Alternatively, tables can be created by right-clicking on the corresponding selection table or the
data object in the Data object area. In this manner, the tables CDHDR and CDPOS shall be
assigned to selection table BNKA respectively CDHDR:

1. Perform a right-click on table BNKA and select Create table.


2. Enter table CDHDR in the field Table of the appearing window. Confirm your entry. Table
CDHDR is now the subordinated table of BNKA.
3. Repeat the process for table CDPOS by right-clicking on table CDHDR and creating
another table. After entering the table confirm your entries.

Go back to the mass maintenance of object DEBI_TRAINING and check the dependencies of
the created tables. Pay special attention to column Selection tables. Which selection tables are
displayed for your created table CDPOS?

____________________________________

After creating the new tables, the connections of the tables must be checked. Double-click on
the corresponding table and select tab Export. Via Connections you can see, which field(s)
connect(s) the selection table and the dependent table with each other.

Page 14 of 44
Which field(s) connect(s) table KNBK with selection table KNB1?

____________________________________

Which field(s) connect(s) table TIBAN with selection table KNBK?

____________________________________

Which field(s) connect(s) table BNKA with selection table KNBK?

____________________________________

Which field(s) connect(s) table CDHDR with selection table BNKA?

____________________________________

Which field(s) connect(s) table CDPOS with selection table CDHDR?

____________________________________

Concatenated Selection

You found out that there is no automatic connection between table CDHDR and table BNKA.
Discuss in teams of two which problem occurs in this case.

Note: Opening both tables in transaction SE16/SE16n in the source system and checking the
key fields might help. Login to the source system with username SU_TBXX (e.g. SU_TB01,
SU_TB02, …) and password initial.

You will learn how to solve the occurring problem in exercise Maintain Selections and Export
Rules.

Connection in SQL Expert Mode

In addition to the TC standard view the Transformation Cockpit also provides a SQL Expert Mode
(e.g. for more complex selections). Double-click on table KNBK open the SQL Expert Mode,
changing the selection mode to S (Free Selection (SQL). Save your entries and confirm the
appearing message.

Page 15 of 44
Using which SQL statement table KNBK relates to table KNB1?

____________________________________

Interpret the SQL statement.

Close the SQL Expert Mode, switching the selection mode back to F (Field selection) and saving
the entries.

The area connections appears again. You have to recreate the connection between the fields
now. Connect table KNBK again with selection table KNB1, selecting the field KUNNR in table
KNB1 using the search help. Save your entries.

You now have deleted the SQL expert mode statement and connected the newly created tables
as far as possible.

Page 16 of 44
Exercise 5: Maintain Selections and Export Rules
Maintain and Link Global Selections

The customer provides Excel lists to you, in which he classifies the data to transfer from source
to target system. Your next task is it to select exactly the data the customer wants you to migrate.
To do that, you must maintain selection rules and link them within the corresponding tables.

Subsequently, you will find the number of the sales documents you should migrate with all
dependent data from FI, MM, SD as well as the corresponding address numbers.

Participant Number Sales Document Number


01 0000010201
02 0000009804
03 0000009770
04 0000010113
05 0000010052
06 0000010133
07 0000010042
08 0000010192
09 0000010036
10 0000009769
11 0000009893
12 0000009717
13 0000010084
14 0000009877
15 0000010021
16 0000010104
17 0000010055
18 0000009836
19 0000009728
20 0000010010
21 0000009754

Page 17 of 44
22 0000010184
23 0000009930

There is a specific amount of data which shall be transferred from source to target system per
participant. Hence, the data to be selected needs to be restricted using global selections. That
guarantees that later only relevant data is exported from the data pool of the source system. The
advantage of global selections is that they only need to be created once for a domain and can
be reused for all fields with the corresponding domain.

The following selection rules are already available and assigned in the system. You just have to
fill in values:

 SEL_MATNR (Material number)


 SEL_WERKS (Plant)
 SEL_ADRNR (Address numbers)

Since data object VTDE_TRAINING has been copied without export and import rules, the
following global selections have to be assigned and filled with values:

 SEL_VKORG (Sales organization)


 SEL_KUNNR (Customer number)

Additionally, the global selection for the following domains (they have an impact on certain fields
later) have to be maintained, linked and filled:

 VBELN (Document number)


 VSTEL (Shipping point)
 BUKRS (Company code)

To create the global selection, proceed as follows:

1. Go to the area Global and open the tab Selections. Here, you can see the already created
selections.
2. Click the add button.
3. First, maintain the global selection for the domain VBELN. Fill the field ID with
SEL_VBELN. Enter the title Selection: Sales document number. Select the domain
VBELN.
4. Save your entries with the button Save & close.

Page 18 of 44
Repeat the process for the domain VSTEL with ID SEL_VSTEL and title Selection: Shipping
point.

Note: The global selection for the domain BUKRS is created in a later part of this exercise.

For the global selections to work later, they must be linked to the corresponding fields in the
tables.

Therefore, switch to area Data objects. First open the object VBAU_TRAINING in module SD.
The global selection SEL_VBELN must be linked to the corresponding field of tables VBAK
(Sales document header) and VBKA (Sales activities). Proceed as follows:

1. Double-click on table VBAK.


2. Switch to tab Export.
3. In the area Selections use the Add selection button to assign an additional selection. (The
already assigned global selection remains).
4. For Type choose the option Global selection.
5. Open Value help. All the fields in the table are displayed here. In this example the field
name VBELN exactly matches the domain name you earlier created the selection for.
Select the field and confirm your entry.
6. In the next step all already existing selections, which fit to your field selection are
displayed in Select existing selection. One of them is your created global selection
SEL_VBELN. This one is marked with the compatibility Same domain.
7. Select the global selection you have created before and press Save & close. The global
selection has been added successfully.

Repeat the process for table VBKA. This table also contains field VBELN.

For the assignment of the global selection SEL_VSTEL repeat the operations as described
above. The concerned table is called KNVS (Customer data: Shipping data) with field VSTEL in
this case.

Note: In order to find out, which module/data object the table is assigned to, use the search help
selecting Table as search criterion.

Page 19 of 44
In which data object can the table KNVS be found?

____________________________________

Create Global Selection within a Table

Global selections can also be created directly in the Data object area. Afterwards, they can be
reused for any tables.

Your next task is to create the remaining global selection SEL_BUKRS that way. Proceed as
follows:

1. In the area Data objects, open module FI and the data object DEBI_TRAINING. One of
the relevant tables for this selection is the selection table KNB1 (Customer data
(Company code).
2. Perform a double-click on that table and open the tab Export. Add a new selection using
the add selection button.
3. In field Type select again the value Global Selection.
4. Open the Value help and select the field BUKRS. Confirm your entry. The system
automatically offers Title and ID under Create new selection.
5. Press Save & close. You have now added the new global selection SEL_BUKRS to table
KNB1 successfully.
6. Go to the area Global now and open tab Selections. Your just created global selection is
shown here and can be reused.

Finally, assign the global selection SEL_BUKRS to field BUKRS of the following tables in data
object DEBI_TRAINING:

 TINSO (Unsuccessful payments and fees)


 TFBWD (Personal Customizing for Transaction FBWD)
 TFBWE (Personal Customizing for Transaction FBWE)

Page 20 of 44
Now, you must assign the already existing global selections SEL_KUNNR and SEL_VKORG to
the tables of the copied data object VTDE_TRAINING.

Assign SEL_KUNNR to the following tables:

 EDSDC (Assignment EDI Partner to sales organization, distribution channel, division)


 KNVH (Customer Hierarchy)
 KNVP (Customer Master Data Partner roles)
 KNVS (Customer Master Data Shipping data)
 KNVT (Customer Master Data Texts for Sales)
 KNVV (Customer Master Data Sales data)

At the end, assign SEL_VKORG to the tables:

 EDSDC (Assignment EDI Partner to sales organization, distribution channel, division)


 KNVH (Customer Hierarchy)
 KNVP (Customer Master Data Partner roles)
 KNVT (Customer Master Data Texts for Sales)
 KNVV (Customer Master Data Sales data)

When assigning the selections to the tables, you noticed that there is one more selection type –
the field selection. What is the difference between the field selection and the global selection and
when is it applied?

____________________________________

____________________________________

You have now managed all required conditions for the selection of your assigned sales
document.

Fill Global Selection with Values

In the next step, it is necessary to fill the already existing as well as the new global selection with
values from your sales document.

Page 21 of 44
For better understanding open the source system again. Login with user SU_TBXX (e.g.
SU_TB01, SU_TB02, …). Open transaction VA03 and display the sales document which was
assigned to you (see table). Make yourself familiar with the data of the sales document.

Click into the field Standard Order and press F1. The SAP help opens. Press the button for
technical information. In the appearing window, you can see technical information for the selected
field such as the table name and field name. By double-clicking the field name VBELN you jump
to transaction SE11. You can see the domain of the field for which you have already created a
global selection and assigned it to the corresponding table.

In further consideration, you can find out more data of the sales document, which are needed for
your selection. Find out the values which are maintained for the following entities:

 Customer number
 Company code
 Sales organization
 Shipping point
 Materials in the sales document position
 Plant in the sales document position

The values you have determined are the ones you should fill your created global selections with.

Subsequently, you will find a table, which summarizes the data of your sales document:

Particip VBELN KUNNR BUKRS VKORG VSTEL MATNR WERKS


ant No.

01 10201 2140 1000 1000 1200 M-05 1200

02 9804 1002 1000 1000 1999 L-80C 1200

03 9770 1032 1000 1000 1000 P-102 1000

04 10113 1033 1000 1000 1200 M-09 1200

Page 22 of 44
Particip VBELN KUNNR BUKRS VKORG VSTEL MATNR WERKS
ant No.

05 10052 1172 1000 1000 1200 M-06 1200


M-10
M-14
M-18
06 10133 1174 1000 1000 1000 M-07 1000

07 10042 1175 1000 1000 1200 M-08 1200

08 10192 1250 1000 1000 1100 T-FV100- 1100


EM

09 10036 1300 1000 1000 1200 L-80C 1200

10 9769 1321 1000 1000 1000 P-104 1000


P-103
P-402
P-101

11 9893 1360 1000 1000 1200 DPC102 1200


0
DPC100
4
DPC101
5
DPC101
1
12 9717 1900 1000 1000 1000 1400-100 1000
1400-400

13 10084 2000 1000 1000 1000 P-104 1000


P-103
P-402
P-102

Page 23 of 44
Particip VBELN KUNNR BUKRS VKORG VSTEL MATNR WERKS
ant No.

14 9877 2004 1000 1000 1200 M-06 1200

15 10021 2007 1000 1000 1200 R-1141 1200

16 10104 2130 1000 1000 1200 R-1140 1200

17 10055 2140 1000 1000 1200 M-18 1200

18 9836 2200 1000 1000 1200 M-12 1200


M-20
M-08
M-16
19 9728 2300 1000 1000 1000 1400-200 1000
1400-750

20 10010 2401 2400 2400 2400 P-103 2400

21 9754 2402 2400 2400 2400 P-102 2400

22 10184 2502 2500 2500 2500 P-102 2500

23 9930 2503 2500 2500 2500 P-104 2500

Now go back to the Transformation Cockpit in the control system and fill your global selections
with the determined values. Note that some of the data is shown without leading zeros.
However, these are essential for the selection.

Page 24 of 44
Note: In order to identify leading zeros, you can open transaction SE16/SE16N and take a look
at the database format. To do that open table VBAK for example and start searching for records.
Double-click on one of the appearing records. A detail view opens. In this you can find the value
for field VBELN in data base format, which means that leading zeros are displayed.

In order to fill the global selections, proceed as follows:

1. Go to the Global area and open tab Selections.


2. Double-click on the selection SEL_KUNNR.
3. Press the button no values maintained for the system with the alias SOURCE_1.
4. In field Single value enter the determined customer number.
5. Confirm your entry using the execute button.
6. Save your entries with Save & close.

The centrally maintained values are displayed in the Selection area of each table in area Data
objects, they are linked to (see figure).

For selections that contain many values, an excel file with the selection values can alternatively
be uploaded into the Transformation Cockpit.

1. Re-open the Tab Selections in the area Global.


2. Double-click on the selection SEL_MATNR.
3. Select the button Export and save the excel template locally to your desktop for the
selection values.
4. Open the Excel and fill the fields as shown in the image. Replace the XX with the material
number(s) you have determined (each material number receives its own row):

Page 25 of 44
5. Save your entries and close the Excel file.
6. In the Transformation Cockpit, press Import and under file path, select your recently filled
in Excel file and upload it.
7. You have successfully imported selection values using Excel.

Alternatively, you can maintain the values in the export tab of each table in the Data objects area:

1. Open the Data object area.


2. Select table VBAK via double-click.
3. In the Selection area, you can see the assigned global selections.
4. Press the button no value maintained of the selection SEL_VBELN.
5. Enter your value for the document number (leading zeroes!) in the field Single value of
the appearing window.
6. Confirm your entry pressing the execute button.
7. The area Values is now filled with your values.
8. Now, press the Global selection button. You directly jump into the global selection. The
maintenance screen of the global selection SEL_VBELN appears.

The value you have entered in the Data object area has been adopted automatically into the
global selection. Therefore, it is valid for all fields the global selection is assigned to.

Choose one of the described options and make sure that the following global selections are filled
with the values of your sales document:

 SEL_KUNNR
 SEL_VBELN
 SEL_MATNR
 SEL_BUKRS
 SEL_VKORG
 SEL_VSTEL
 SEL_WERKS

Note: For global selections that have no values but are already assigned to tables no datasets
will be exported.

Now you have created all conditions required for your data export.

Page 26 of 44
Create Selections in the SQL Expert Mode

As an alternative to ‘clicking the selection conditions together’, you can also code selections
yourself using the SQL expert mode. Note that once you have jumped into expert mode, your
previously selected selections are only visible in the SQL version.

You have previously linked the global SEL_VSTEL and SEL_KUNNR selection to the table
KNVS. Navigate to the corresponding table and open the SQL expert mode changing the
selection mode to S (Free selection (SQL)). Save your entries. What is the SQL statement for
the corresponding selection?

____________________________________

Your selection is now displayed as an SQL statement. Undo this by changing the selection mode
to F (Field selection) again and saving your entry. Then add SEL_VSTEL and SEL_KUNNR
again for the field VSTEL.

Syntax-Check

Syntax checks are always carried out automatically after the start of an export and import. In
order not to delay the project process, it is useful to start syntax checks regularly. This can be
done on several levels (Scenario, Module, Object, Table) each for import, export and to check
the completeness of the field usages of global rules. In addition, there is the possibility to check
directly on the level of each rule.

Run a syntax check for the object DEBI_TRAINING, by double-clicking on the object
DEBI_TRAINING, pressing the button Syntax-Check and checking the box for Export on the
following screen.

What error message occurs?

____________________________________

____________________________________

Concatenated Selection

You now need to fix the syntax errors that occur. For this purpose, a concatenated selection must
be created between the tables BNKA and CDHDR.

Page 27 of 44
After having analyzed the table CDHDR for change documents on SE16/SE16n in the previous
exercise, you have found out that this table keeps change documents for lots of objects. They
are specified in more detail by a change object (OBJECTCLAS). This results in a particularity
when linking the selection table and the dependent table. Because of this, in case of Export we
must ensure that the relevant line items for a specific Object class will be exported only. For bank
data (table BNKA), it is BANK. This means if the link of both tables exists, a selection on table
CDHDR takes place accordingly.

Now check by logging in to the source system again (User SU_TBXX (e.g. SU_TB01, SU_TB02,
…), which are the keys the field Object Value (OBJECTID) that got concatenated for object class
BANK:

____________________________________

____________________________________

Using the knowledge you acquired earlier, subsequently link the tables BNKA and CDHDR by a
concatenated selection.

Proceed as follows:

1. Select the table CDHDR.


2. On the right section of the sub screen Connections all key fields of the table CDHDR are
listed. Because for field OBJECTCLAS only entries for change document header BANK
should be selected, you need to add ('BANK') to the first line of column Field from BNKA.
3. In the second row add the concatenated key MANDT|BANKS|BANKL (key fields of table
BNKA)
4. Save your changes.

Run syntax check for the object DEBI_TRAINING again. If no message shows up, the
concatenated selection was added correctly.

Page 28 of 44
Exercise 6: Adding Mappings and Import Rules
In the workshop with the customer, it was defined that during the import, both the materials and
the associated plant should be changed. The plant should be mapped to 77XX (XX stands for
your participant number) and the material master numbers should get a prefix XX_.

Preparing and adding Mappings

First you need to define the structure for the mapping in the area Global on tab Mapping.
Afterwards mappings can be defined. Proceed as follows:

1. Switch to the area Global and open the tab Mapping.


2. Add a new Mapping using the Add button.
3. Use the ID MAP_MATNR.
4. As a title use the following description Mapping: Material master number.
5. Click the button Create table.
6. Using the button you can assign a domain this mapping should apply to. Choose
domain MATNR.
7. Confirm your input. The fields Description, Data type and Number of digits will be
populated automatically.
8. For Field type choose Source.
9. Repeat these steps for fields type Target. To do this, copy the already created entry and
change Field type to Target.
10. Confirm your input and save the mapping structure.

Note: Alternatively, there is always the option for adding line items by using the Add button and
populating the fields manually.

Now you can populate the created mapping structure with content:

1. Open the new mapping structure MAP_MATNR by a double-click on the line item on tab
Mapping.
2. Using the button Add you must create a new line item on the table.
3. You now can see the fields you have previously defined for source and target.
4. Fill in the field MATNR source with the material number(s) from your sales document.
5. Fill the field MATNR target according to customers’ specification (XX_ (your material)
6. Press the button Save & Close.

You have successfully defined your mappings for the material number (see figure).

Page 29 of 44
Repeat the entire process for plant by creating a second mapping using ID MAP_WERKS and
domain WERKS for source and target. Last populate the mapping table according to the above
specification (target value 77XX).

Note: You always have the possibility to adopt your table structure. To do this, select the Change
table structure button within the mapping. In this case, however, you should note that all existing
content for the customized domain is deleted.

Maintain Global Import Rules in the Area Global

In order to apply the mappings, you have just created, you must refer to them within a global
import rule. Global import rules can be created for different scope: domain, data element, and
table fields. They are created once and then apply within the entire scenario for the defined effect
scope.

Group by two and consider what such a global import rule might look like for the material number
mappings. Use parameters IV_VALUE and EV_VALUE.

Global import rules can be created both under Global in the Import rules tab and directly in a
selected table in the area Data objects.

Maintain the global import rule for mapping the material number in the area Global. Proceed as
follows:

1. Open the area Global and choose the tab Import rules.
2. By using the button Add create a new rule.
3. For Scope define domain MATNR, again by using the Add-button.

Page 30 of 44
4. Confirm your input by ENTER. The screen refreshes and shows some coding parameters
which can be used for creating the global import rule.
5. Maintain the following import rule:
DATA: lv_message(200) TYPE c.

CHECK NOT iv_value IS INITIAL.

PERFORM api_mapping_get
USING
'MAP_MATNR'
iv_value
CHANGING
ev_value.

IF sy-subrc <> 0. "If a mapping found?


"No mapping found
CONCATENATE
'MAP_MATNR: No mapping found. Source value:'
iv_value
'Table:'
te-tabname
INTO lv_message
SEPARATED BY space.
PERFORM api_message_add USING 'W' lv_message.

"Source value equal Target value is written into the mapping


PERFORM api_mapping_add USING 'MAP_MATNR' iv_value iv_value.

"Target value = Source value


ev_value = iv_value.
ELSE.
"return found Mapping
ENDIF. "IF sy-subrc <> 0. If a mapping found?

6. Save your input.


7. Perform a syntax check for the import rule and fix any syntax errors.

Point the cursor to the line item for the new import rule in tab Import Rules. Next click on button
Cross reference. You get a list of tables including the path where the import rule you created will
apply.

For table VBAP the cross-reference list shows multiple entries for the domain MATNR. What
might be the reason for that?

Page 31 of 44
____________________________________

____________________________________

Starting with one of the entries for table VBAP on the cross-reference list directly navigate to the
table in the area Data objects by double-clicking on an entry. You will now see that your
previously created global import rule is shown in detail in the tree view on the left under Import.
Note the names of the fields that will get mapped by the import rule MATNR within the table
VBAP:

____________________________________

____________________________________

____________________________________

Maintain Global Import Rules in the Area Data Objects

Now also maintain the global import rule for the domain WERKS. This time the import rule should
be created directly in the table. Go ahead as follows:

1. Go to the Data objects area and open the table MARC. Use the search help again.
2. In the tree structure make a right-click on table MARC. From context menu choose Create
import rule base  Create global import rule.
3. For Scope, add a new line item and make sure it is defined for the domain WERKS.
4. Confirm all your changes by ENTER. You now can see again the coding parameters that
can be used for creating your global import rule.
5. Maintain the following import rule:

Page 32 of 44
DATA: lv_message(200) TYPE c.

CHECK NOT iv_value IS INITIAL.

PERFORM api_mapping_get
USING
'MAP_WERKS'
iv_value
CHANGING
ev_value.

IF sy-subrc <> 0. "If a mapping found?


"No mapping found
CONCATENATE
'MAP_WERKS: No mapping found. Source value:'
iv_value
'Table:'
te-tabname
INTO lv_message
SEPARATED BY space.
PERFORM api_message_add USING 'W' lv_message.

"Source value equal Target value is written into the mapping


PERFORM api_mapping_add USING 'MAP_WERKS' iv_value iv_value.

"Target value = Source value


ev_value = iv_value.
ELSE.
"return found Mapping

ENDIF. "IF sy-subrc <> 0. If a mapping found?

6. Save your entries.


7. Perform a Syntax check for the created import rule and correct syntax errors if necessary.

Return to the area Global and open the tab Import rules. Select the global import rule you
just created for WERKS and click again the button Cross references. Once again, all tables
affected by the global import rule will be displayed. Therefore, it does not matter where you
maintain the global import rule.

Page 33 of 44
Deactivating a Global Rule

The customer is using generic material in the MM module of his system. This means that
materials only differ in certain attributes (e.g. size, color). These differences are set up as material
variants. The basic attributes of the material, however, can be found in the generic material. The
key of the generic material therefore differs from the key of the material variant.

Log on to the source system with the user SU_TBXX (e.g. SU_TB01, SU_TB02, …). In
transaction SE11, check the domain of the generic material (field: GENNR) in table MARA.

What is the domain of the field GENNR?

____________________________________

What conclusions can you draw from this fact regarding the mapping?

____________________________________

____________________________________

It is now up to you to create a field rule that overrides the global import rule you defined for the
domain MATNR in the table MARA. In order to do this, choose one of the proposed options:

Option 1: Overriding a global rule using a field rule:

1. Switch to the area Data Objects.


2. Open the module MM, the data object MARA_TRAINING and the table MARC.
3. Double-click on the table MARA and create a field rule by right-clicking on Create import
rule base Create field rule.
4. Select the field GENNR and press ENTER.
5. Enter Switches Global Rule MATNR off into the field Title.
6. Enter the comment Deactivates global rule MATNR as coding.
7. Save your entries.
8. Perform a syntax check for the first field rule and, if necessary, correct any occurring
syntax errors.

Your field rule will now be directly displayed in the tree view under Import and overrides the global
import rule.

Page 34 of 44
Option 2: Deactivating the global rule:

1. Switch to the area Data Objects.


2. Open the module MM, the data object MARA_TRAINING and the table MARC as well as
the Import area of the table MARA.
3. Right-click on the field GENNR and select Deactivate.
4. Save your entry.

You have successfully deactivated the global import rule for the field GENNR.

Create Field Rule

The customer wants the user name Migration _XX in the field ERNAM (name of the consultant
who added the object) added to the sales documents (table: VBAK) via the migration. Go to the
area Data objects and check whether there is already an import rule for the field ERNAM in
table VBAK. Which is it?

____________________________________

Override this rule with a field rule that writes the user name Migration_XX into the field ERNAM.
Proceed as follows:

1. Create a field rule for the field ERNAM by right-clicking on VBAK  Create import rule
base  Create field rule.
2. Fill the field Title with Field rule_ERNAM.
3. Define in the coding that the user Migration_XX should be written into the field ERNAM
using the given parameters IS_VBAK and CV_ERNAM.
4. Save your entries.
5. Perform a syntax check for the field rule and correct syntax errors if necessary.

Note: Keep in mind that parameter IS_VBAK is the structure of the table you refer to in your
coding.

You have now successfully maintained all import rules required for the migration.

Page 35 of 44
Exercise 7: Create and Perform the Transformation
In the previous exercises, you created the basis for migrating the sales document from the
source to the target system.

As a next step, you will test your selections and import rules on a random basis. To do this, you
carry out single executions of the export/import of the tables in dialog or in background, and
finally you perform the export and import of the sales document.

Perform Single Export and display/ export Export Files

First go to the tab Global and open the tab Selections. You have created, amongst others,
selections for the scope KUNNR, VBELN and MATNR, filled them with content and connected
them with the respective fields. With the single execution, you have the possibility to export
both tables and entire data objects individually and without significant effort.
In this example, you export the tables KNB1, VBAK and MARC individually and check the
exported data for plausibility in the area Transformation.

Proceed as follows to individually export the table:


1. Go to the area Data objects and open the table KNB1 in the data object
DEBI_TRAINING.
2. Right-click on the table. A context menu opens.
3. Select Execute  Export in background.
4. Confirm the message with Yes.
5. Go to the area Transformation. The single execution of the table KNB1 automatically
created the folder Single execution DEBI_TRAINING.
6. Open the tree as far as possible.
7. Under KNB1 you can view the number of exported records and the status of the run.

How many data records of table KNB1 were exported to the file?

____________________________________

Display the export files by right-clicking on the table KNB1 and selecting Display export files. You
jump to the file view. Execute it without specifying any selection criteria.

As a result, the customer number and the respective company code from your document are
displayed.

Page 36 of 44
Repeat the procedure for the table VBAK and MARC.

Which data record is displayed for table VBAK?

____________________________________

How many data records have you exported for table MARC?

____________________________________

You also have the option to download the data from the file. In order to do this, click on the
according table on the right and select Further Functions  Download Export Files. Save the
files again on your desktop. Display the contents of the Excel file.

Simulate Import in Background

Besides directly writing data into the database of the target system, you can simulate the import.
This way you can test whether all desired records are imported and whether terminations occur.

Furthermore, it may be expedient to carry out the import in dialog to use the Debugger.

Your task is now to simulate an import (in the background) for the table VBAK.

Proceed as follows:

1. Go to the area Data objects and open the table VBAK in the data object
VBAU_TRAINING.
2. Right-click on the table. The context menu opens.
3. Select Execute  Import (simulation) in background.
4. Confirm the message with Ok.
5. Go to the area Transformation. An import entry was automatically added to your folder
Single execution VBAU_TRAINING.
6. Open the tree as far as possible.
7. Under VBAK you can view the number of records that would be imported. In addition, you
obtain an overview of the status of the run.

Does the number of imported records of the simulation match the number of exported records?
If not, find the error.

Page 37 of 44
Perform Import in Dialog and Debug

To detect errors or check the correct mapping of data, you can perform the import (both the actual
one and the simulation) in dialog. This allows you to jump to the debugger. In doing so, specific
debugging points are available to you. Which ones?

____________________________________

____________________________________

____________________________________

____________________________________

You can also set your own break points. As a next step, you will simulate an import in dialog for
the table MARC and jump to the debugger within the global import rule to check whether the
maintained mapping is correctly applied. To do this, proceed as follows:

1. Open table MARC in the area Data objects.


2. Jump to the global import rule for the domain MATNR and set a break-point before the
API call.
3. Save your entries.
4. Now right-click on table MARC. The context menu opens.
5. Select Execute  Import (simulation) in dialog.
6. Confirm the appearing message with ok.
7. You jump to the target system. Log on to the correct client using the user SU_TBXX
(e.g. SU_TB01, SU_TB02, …).
8. After pressing the execute button, the import simulation is carried out in dialog. The
debugger opens at the corresponding point.
9. Within the debugger, double-click on the parameter iv_value. Repeat the procedure for
the parameter ev_value. Both parameters now appear on the right side of the debugger
screen.
10. Use F6 to go through the statement line by line. First, the value iv_value is filled with the
incoming value of the data record. In the next step, you can see how your material
number mapping works and the outgoing value adjusts according to the mapping. Use
F8 to jump to the next data record (if available).
11. Use F8 to navigate through the following data records or exit the debugger via the SAP
menu Debugger  Terminate application and debugger.

You have successfully checked the mapping of your data records.

Page 38 of 44
Create Export/Import Blocks

After performing individual tests, a mass test takes place in a project. In a mass test, all data
objects in the scenario are first exported and then imported.

To prepare the transformation, you must add blocks for the export and import as well as
forerunners to the existing run in the area Transformation.

Proceed as follows:

1. Go to the area Transformation.


2. By right-clicking on Transformation create a new Run.
3. Now, add an export block by right-clicking on Run.
4. Name the block Start and assign the object Start_TRAINING to it.
5. Create a second export block by right-clicking on Run.
6. Name the block All Objects and assign the objects DEBI_TRAINING,
MARA_TRAINING, VBAU_TRAINING and VTDE_TRAINING.
7. Create a third export block.
8. Name it Addresses and assign the object ADR_TRAINING to it.
9. Right-clicking on the run you can Maintain block dependencies. Keep in mind that firstly
the Start block, afterwards All Objects and at the end the Address Object should run.
10. Now, create another run for the import.
11. For the import run, add a block of the type Forerunner.
12. Name the block Predecessor and assign the object PREDECESSOR_TRAINING to it.
13. Create another block of the type Import.
14. Name the block Addresses and assign the object ADR_TRAINING to it.
15. Create another import block.
16. Name the block All Objects and assign the objects DEBI_TRAINING,
MARA_TRAINING, VBAU_TRAINING and VTDE_TRAINING to it.
17. By right-clicking on the import block maintain the block dependencies again. Keep in
mind that the import starts with the Predecessor, continues with the Addresses and
finishes with All Objects.

You have successfully created the preconditions to execute the mass test.

Migrate Sales Document

Now you can migrate your sales document. To do this, first perform a syntax check for the
Export and Import of the entire scenario (Area Data objects). Execute the Syntax check in the

Page 39 of 44
background and then jump to the protocol of the syntax check via Information  Display
Syntax check results.

If errors occur, correct them. You have the possibility to directly jump to the respective point in
the data objects.

After successfully correcting the syntax errors start your export right-clicking on the run. Select
Start run in the background. Alternatively, you can start the blocks one by one. Keep in mind
that the previous block always should be finished completely before the next block can be
started. After exporting the data check the number of records of the tables.

If the check was successful start your import block by right-click Start run in the background.
After it has been completed successfully, check the number of imported records. Are there
differences between exported and imported datasets?

If one of the blocks terminates during the export or import, find the error.

Check Results of the Migration

To verify the success of an import, open the target system. Log on to the system using the user
SU_TBXX (e.g. SU_TB01, SU_TB02, …). Start transaction VA03. Display your sales
document.

Check whether the mapping of the material number, the plant and your field rule were
successful. If not, find the error.

After that, open transaction XD03 and open the customer from your sales document. Can you
display the customer master record? If not, find the error.

As an alternative to this procedure, there is the option to maintain Test Units in the area Data
objects within the Transformation Cockpit. These allow a direct jump from the Transformation
Cockpit to the according transaction for testing the data. The Test Units are part of the delivery
content.

Optional
Switch to the area Data objects and double-click on the module MM. All transactions for the
module maintained in the training content are displayed in the Tab Test Units.

Open the import for MARA_TRAINING in the area Transformation. Right-click on the object
and select Further Functions  Transactions  MM02. Select Display data.

Page 40 of 44
If you are able to open the master data and if the fields within your sales document were
correctly mapped, you have successfully migrated your sales document. The base for your
imported data is now displayed to you. Copy the material number which you want to test and
then double-click the according data record. After signing into the correct client, the dialog
connection directly transfers you to the transaction with your dialog user. Enter the previously
copied material number here. You can now display the according views of the material. If the
material cannot be displayed, find the error.

If you can open the master data and the errors within your sales document were successfully
recoded, you have successfully migrated your sales document.

Page 41 of 44
Exercise 8: Data Validation
After completing the migration, you must validate the results at a technical level. In the
following, you will learn three options for doing this:

Compare Export with Content in Target

Using this method, you can determine whether data records with the same key fields differ
within the non-key fields. In the case of a sales document it is possible to test here, whether the
mapping of the material number and plant was successful. For comparing the export with the
content in the target, proceed as follows:

1. Open the table VBAP of your import block in the area Transformation.
2. Right-click on VBAP and select Compare Export with Content in Target.
3. Familiarize yourself with the interface and check whether the mapping for material
number and plant was successful. If not, re-check your import rule base.
4. Are there more fields that differ? If so, find the cause by also checking the import rule
base.

Foreign Key Check

Describe in a few words what the Foreign Key check is and why it is used in this stage of the
project:

____________________________________

____________________________________

____________________________________

____________________________________

Execution of the Foreign Key Check in the Target Client

Log on to the target system using the user SU_TBXX (e.g. SU_TB01, SU_TB02, …), and
proceed as follows:

1. Open transaction /n/SNP/FKC to go to the initial screen of the Foreign Key Check.
2. Familiarize yourself with the predefined and available selection options.

Page 42 of 44
3. In Transaction description, enter a unique designation for your foreign key check and
change the Number of processes to 1 (Please observe this! The number of batch
processes on the training system is limited).
4. Tick Gather examples/messages under Options to limit space and memory consumption
and runtime and confirm the message with ENTER.
5. Leave the other parameters unchanged.
6. Now open the area Selection by Transformation Cockpit (TC) rulesets.
7. In the field Central system (RFC connection), enter the RFC connection
SNP_TB_TRA_001.
8. In the field Scenario, enter the number/ID of your training scenario SNP_TC_XX.
9. Select the Module MM and the Object MARA_TRAINING.
10. Click the button Execute.
11. A list with all determined tables, the worklist, will be displayed. By default, it is completely
selected.
12. Confirm the selection by clicking the button Start selected checks. It is only now that the
actual processing starts.
13. In this example, the program creates a batch job and switches to the view Monitoring.
14. Press the Execute button. Jump to the table view where you can monitor the progress of
your processing.

Note: The procedure can take several minutes since the runtime is negatively impacted by the
number of executed processes per participant.

Evaluation of the results

If the processing is complete, the status of the processes switches to COMPLETE after refreshing
the view in Monitoring. Now you can view the results and messages of the Foreign Key Check:

1. Go to the respective view via Goto  Results  Display.


2. First familiarize yourself with the navigation available at the levels of the output.
3. Check whether there are messages for the mapping rules you defined.

Note: If there are messages, normally the customer and responsible process consultant have to
be consulted to remove them.

Automated Testing for the Transformation Scope

There is an option to perform Automated Testing for the Transformation Scope. The prerequisites
for this (Upload/ activate global function SAVE_DATA_FOR_AT and create Global event: After

Page 43 of 44
Package processing (Import) by invoking the function) were already established within your
training scenario.
Log into the target system again and open the transaction /n/SNP/AT_mig_check. During the
transformation, the objects to be tested were transferred automatically to AT. Additionally, the
number of migrated data records in the according object is displayed.

Open the tree until you reach the area All objects and select the object MARA as an example.
Press the Execute button. Enter a description and confirm the default settings. After completing
the execution, you can choose to display the protocol by double-clicking Display protocol. Here
you will be able to see the error messages that would also appear in the SAP transaction. By
double-clicking on the according line, you can directly jump to the data record that has caused
the errors.

Note: If messages occur, the customer and the responsible process consultant are to be involved
in the clarification.

© Copyright SNP SE, 2018. All rights reserved.


All other products mentioned in this document are registered or unregistered trademarks of their respective companies.

Page 44 of 44

You might also like