Beruflich Dokumente
Kultur Dokumente
2
What Well Cover
3
Data Conversion Using LSMW
4
Data Conversion Using LSMW (cont.)
LSMW features
! No need for ABAP programming skills
! Most conversion and migration tasks can be accomplished
with standard functionality
! With little ABAP coding, you can use LSMW for more
complex data conversion activities
! Provides data reformatting options
! Simple mapping to complex data reformatting rules
Conversion Rules
Read Data
1 : 1 Translation
Interval Translation Read Data
Initial value
Constant
Assign Source field
Prefix/Suffix
Concatenate Converted Data
6
What Well Cover
7
Limitations of Data Conversion Using LSMW
8
LSMW Tips and Tricks
9
1 FI Documents Multiple Accounting Lines
11
1 FI Documents Multiple Accounting Lines (cont.)
Object Attributes
Standard Object
! 0100 Financial
Documents
! Method 0000
! Program Name
RFBIBL00
! Program type
B Batch Input
12
1 FI Documents Multiple Accounting Lines (cont.)
13
1 FI Documents Multiple Accounting Lines (cont.)
14
1 FI Documents Multiple Accounting Lines (cont.)
15
1 FI Documents Multiple Accounting Lines (cont.)
Data files
! Header file with FI document header information
! Detail file with FI line Items
! Document Number is the key field to join two files together
16
2 If Then ... Else Conditional Processing
17
2 If Then ... Else Conditional Processing (cont.)
Txn
OB52
18
2 If Then ... Else Conditional Processing (cont.)
Txn
SE16
19
2 If Then ... Else Conditional Processing (cont.)
! You will create an LSMW project with transaction recording for OB52
! The data records for input file are prepared from T001B table
! Transaction OB52 wont accept account type G
Txn
OB52
20
2 If Then ... Else Conditional Processing (cont.)
21
2 If Then ... Else Conditional Processing (cont.)
22
TRANSFER_RECORD and SKIP_RECORD
TRANSFER_RECORD SKIP_RECORD
23
2 If Then ... Else Conditional Processing (cont.)
LSMW trick
! Create a transaction recording and map fields from the source
structure, as usual
! For example, record transaction OB52 and create
Solution
recording OB52_REC
! Maintain field mappings from source data file, as usual
24
2 If Then ... Else Conditional Processing (cont.)
Solution
! Click on Display variant
25
2 If Then ... Else Conditional Processing (cont.)
26
2 If Then ... Else Conditional Processing (cont.)
Solution
Thus you avoided having to massage the input data file
27
2 If Then ... Else Conditional Processing (cont.)
28
3 Variable Number of Order Items
Scenario
! You want to update all line items for specific Sales Orders,
but you dont know how many line items there are
! i.e., there are a variable number of lines
Typical solution
! Create an input file with specific sales order numbers and all
line items for those orders
! Drawback:
! You first have to collect all orders and items in one file
29
3 Variable Number of Order Items (cont.)
11 22 33
Step 2 is the most time consuming!
30
3 Variable Number of Order Items (cont.)
11 10001 10
Sales Order 10001 20
(VBAK-VBELN) 22 10001 30
10001 10013 20
10013 10013 30
10013 50
10024
10013 70
10025
10024 20
10025 40
10025 50
31
3 Variable Number of Order Items (cont.)
33
VA02
Transaction
Recording
Assign Order
Number from
Source data file
Assign Item
Number
Change Plant to
1000
32
3 Variable Number of Order Items (cont.)
11 22 33
LSMW trick
! Use an input file with just Sales Order Numbers
! Within LSMW, loop through the Sales Order item table (VBAP)
and use TRANFER_RECORD multiple times
SELECT POSNR
INTO VA02_REC-POSNR
FROM VBAP
WHERE VBELN = VA02S-ORDERNO.
TRANSFER_RECORD
ENDSELECT.
Solution
34
3 Variable Number of Order Items (cont.)
35
3 Variable Number of Order Items (cont.)
36
3 Variable Number of Order Items (cont.)
Extended scenario
! You want to update all line items for specific Sales Orders,
which are not shipped yet
Challenge
! Preparing an input file with Sales Order and Item Number
! For example:
! Prepare a data file with Sales Order Numbers
(SE16 on VBAK)
! Based on Sales Order Numbers, get the Item Numbers
(SE16 on VBAP)
! Based on Sales Orders and Item Numbers, get Item Status
(SE16 on VBUP)
! Prepare an Input file with Sales Order and Item Numbers
38
3 Variable Number of Order Items (cont.)
10025 50 10025 50 B
39
3 Variable Number of Order Items (cont.)
LSMW trick
! Use an input file with just Sales Order Numbers
! Within LSMW:
! Loop through Sales Order Item Table (VBAP), Get Item
Numbers
! Find the Delivery Status from VBUP Table
Solution
40
3 Variable Number of Order Items (cont.)
41
3 Variable Number of Order Items (cont.)
Another scenario
! You want to update account assignments of all line items for
specific Sales Orders; variable number of items
Solution
42
LSMW Tips and Tricks
43
What Well Cover
44
Resources
45
7 Key Points to Take Home
46
7 Key Points to Take Home (cont.)
47
Your Turn!
Questions?