SAP Legacy System Migration Workbench (LSMW)

Transcription

SAP Legacy SystemMigration Workbench(LSMW)Antje Kunz

Content1Introduction 2Overview of the Legacy SystemMigration Workbench (LSMW) 2.12.22.32.42.52.6311Areas of Application 11System Prerequisites and Authorizations 13Starting LSMW 15The LSMW Initial Screen 16Creating a Project 17Buttons and Central Functions 19Data Migration 3.17LSMW Main Menu 3.1.1 Execute 3.1.2 User Menu 3.1.3 Numbering On/Off 3.1.4 Double-Click Display/Change 3.1.5 Object Overview 3.1.6 Action Log 3.2 Maintaining Object Attributes 3.3 Maintaining Source Structures 3.4 Maintaining Source Fields 3.5 Maintaining Structure Relationships 3.8 Maintaining Field Mapping andConversion Rules 3.7 Maintaining Fixed Values, Translations,and User-Defined Routines 3.8 Specifying Files 3.9 Assigning Files 3.10 Importing Files 3.11 Displaying Imported Data 3.12 Converting Data 23242525262727272833353942566268697172

3.133.143.153.164Recordings 4.14.255.3General Definitions Basic Settings for UsingBAPIs and IDocs Creating Orders Using theBAPI Technology Long Texts 6.16.26.36.46.57Creating Recordings Using the Recording Import Technologyin the LSMW LSMW Using BAPI andIDoc Import Technology 5.15.26Displaying Converted Data Creating Batch Input Sessions Processing Batch Input Sessions Object Overview Long Texts in SAP LSMW Objects for Long Texts Long Texts — Source Structures,Source Fields, Structure Relationships Long Text — Field Mapping Final Process Steps forTransferring Long Texts Transporting Projects 7.17.27.3Transport via Change Request Exporting Projects Importing Projects 140141

8Additional Information 8.18.28.38.48.5Periodic Data Transfer Global Functions and Variables Display Variants and Processing Times Suppressing Data Records Creating Additional Data Records 1431431471491521539Closing Words 157AThe Author 160BIndex 161CDisclaimer 166More books from Espresso Tutorials 165

2 Overview of the LegacySystem MigrationWorkbench (LSMW)In this chapter, you will learn about the areas of application for LSMW and what exactly Legacy System Migration Workbench means. You will also learn about thesupport this tool offers and what its core functions are.The Legacy System Migration Workbench (LSMW) is partof the SAP system and has been included in the standardSAP system since Basis Release ERP 6.0. You can usethis integrated development environment to migrate external data (from non-SAP systems) and to perform massupdates within existing SAP systems.LSMW is a cross-application (CA) component of the SAPsystem. Its use is not specific to any platform, and it has interfaces to the Data Transfer Center, to batch input (BTCI),and direct input processing, as well as to the standard interfaces BAPI and IDoc.From a historical perspective, the LSM Workbench isbased on the standard tool for migration from SAP R/2 toSAP R/3.2.1Areas of ApplicationYou can use the LSM Workbench to migrate both simple and complex data, referred to in the SAP context assource structures.11

Overview of the LSMWThe advantages of the LSM Workbench are particularlybeneficial if you want to migrate legacy data whose structures are very different to the structures in SAP, meaningthat you have to convert data.However, the LSM Workbench is not only useful for migrations and new implementations; it can also be very helpful in a live SAP system. The technology is particularlyuseful if you want to make changes to user-specific fieldsbut cannot perform these changes using the mass changetransactions (e.g., MASS, XD99, XK99).The LSM Workbench is used to migrate external data toSAP, that is, from legacy systems to R/3. You can performthis data transfer as a one-time transfer or at recurring periodic intervals. Within the LSMW tool, you can also convert data.The following SAP standard methods are available for importing external or legacy data to SAP using LSMW: Batch input Direct input IDocs BAPIsWe will look at the individual functions in more detail inChapters 4 to 6 with extensive examples.The sequence of the data migration using LSMW, startingfrom importing one or more files up to transfer into the SAPsystem, is shown in figure 2.1. The core functions of theLSM Workbench are:12

Overview of the LSMW Read in data from the legacy system Convert data into SAP format Import data into the SAP databaseFigure 2.1: Central functions of LSMW2.2System Prerequisites and AuthorizationsThe system prerequisite for using the LSM Workbench isSAP Basis Release 4.0 or higher. However, LSMW is notincluded in the standard SAP delivery scope until BasisRelease 6.20, meaning R/3 Enterprise, ERP 2004, ECC6.0, and higher versions. If you want to use LSMW in anolder release, you have to install this SAP functionalityfirst via a transport request. You can download this freeof charge from SAP Service Marketplace (https://service.sap.com/lsmw).13

Overview of the LSMWThe logistical prerequisite for successful data migrationwith LSMW is completion of the Customizing in the targetSAP system. It must be possible to process the relevanttransactions manually without any errors: this means thatyou can only use LSMW when you have installed the SAPsystem and completed the application Customizing.To determine which fields have to be filled in the targetsystem, you should first run the processes that you wantto migrate data for with test data from the legacy system.This will indicate quickly whether data from the legacysystem can be delivered for all SAP required fields. If thisis not the case, you should consult users from the corresponding specialist departments to agree on a standardvalue to be defined in LSMW.Before starting the LSMW work, it is important to be clearabout which fields are to be transferred 1:1 from the legacy system, which fields require translation, and whereyou will have to program conversion logic. You should document these analyses in writing so that you can refer tothem at any time during the migration project.As you can use the LSMW to change and/or supplementthe data in SAP, an authorization concept is defined forchecking access authorization. This means that to use theLSM Workbench, special authorizations are required, andthese are subdivided into the following four profiles (seeTable 2.1):14

overvIew of the LSMwAuthorization levelProfileFunctionDisplayB LSMWThe user can display all pro-SHOWjects together with their process steps. He cannot switchto change mode.ExecuteChangeB LSMWThe user can display, read in,EXECconvert, and import data.B LSMWThe user has “Execute” au-CHGthorizationandcanthuschange and copy objects.AdministrationB LSMWThe user can use all of theALLfunctions that the tool provides.Table 2.1: Authorization profiles in LSMW2.3Starting LSMWYou start the Legacy System Migration Workbench by calling up SAP transaction LSMW. This is not a transactionthat is already defined in the SAP menu. Via the menupath faVorites insert transaction, add transaction LSMWto your favorites (see Figure 2.2).Figure 2.2: Adding favorites 115

B IndexACABAP 30, 136ABAP code 50, 62, 148,150ABAP instruction 153ABAP subroutines 152Action log 27Administration 21Authorization concept 14Automatic value collector61Change log 22, 27Change mode 28Code 150, 151, 152Concatenation 50Control record 42Conversion rules 42Customizing 14BBAPI 11, 12, 48, 49, 107,108, 116BAPI Explorer 116BAPI import technology114BAPI method 117Batch input 11, 12, 29, 32,42, 77, 79, 80, 82BTCI 11, 79, 102BTCI session 102, 104Business Application Programming Interface 108Business Framework 108Business method 115Business object 115DData conversion 12Data conversion file 62Data Dictionary 41, 46Data migration 12Data migration object 16Data transfer 29Data Transfer Center 11Direct input 11, 12, 29, 32,42, 48, 49Display variant 149Dynpro 81EExisting system 29161

FLField mapping 42, 44, 48,134, 152File port 110Fixed value 21, 27Flag file 146Form routine 153Framework program 144Legacy data 64Legacy file 104Legacy system 12, 29Legacy System MigrationWorkbench 15Long text 127LSMW 11LSMW administration area22LSMW initial screen 16, 19LSMW main menu 33LSM Workbench 11, 12,16, 24LSMW user guidance 24GGlobal data definitions 151Global functions 147Global variables 147, 148IIDoc 11, 12, 32, 48, 49,107, 108, 124Import method 28, 29, 31,87Import project 141Import technology 31, 32,39, 107Initial fields 150Intermediate document108KKey field 38MMASS 12Mass change transaction12Mass update 11Migration 12, 23Migration object 17Migration project 17, 24Migration test 37NNew implementation 12OObject type 28OK code 81, 104162

PTPartner number 112Partner status 112Partner type 112Periodic data transfer 143Port 110Prefix 49Processing time 149, 151Project name 17Target field 44, 46, 48Target structure 39, 83Technical fields 150Text header 134Text line 134Text pool 127Transaction 14, 15, 32, 78,90, 93, 97, 102, 114, 115,126, 144Transfer rule 44, 45Translation 14, 21, 27, 49,58, 59, 60, 61Translation rules 58RRecording 48, 87, 88, 90,95, 98Recording technology 32Reusable rules 21, 27SSAP required field 14SAP standard method 12SAP Transport Management 139Screen 93Selection parameter 73Source field 35, 37, 38,44, 45, 50, 69, 73Source record 153Source structure 11, 33,35, 38, 65, 83, 99Source system 23Standard batch 48Standard interface 32Structure relationship 39,40, 41, 83Suffix 49UUser-defined routine 50User ID 102User menu 25User-specific fields 12WWelcome screen 16Wildcard 67, 73XXD99 12X FIELD 50XK99 12163

Migration Workbench (LSMW) 11 2.1 Areas of Application 11 2.2 System Prerequisites and Authorizations 13 2.3 Starting LSMW 15 2.4 The LSMW Initial Screen 16 2.5 Creating a Project 17 2.6 Buttons and Central Functions 19 3 Data Migration 23 3.1 LSMW Main Menu 24 3.1.1 Execute 25 3.1.2 User Menu 25 3.1.3 Numbering On/Off 26