Beruflich Dokumente
Kultur Dokumente
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
GettingStarted Newsletters
Welcome,Guest
Login
Register
Store
SearchtheCommunity
Products
Services&Support
AboutSCN
Downloads
Industries
Training&Education
Partnership
DeveloperCenter
LinesofBusiness
UniversityAlliances
Events&Webinars
Innovation
StepstocreateasimpleLSMWusingbatchinputrecording
CreatedbyTarunGambhir,lastmodifiedonJan08,2009
TheLSMWorkbenchisanR/3basedtoolthatsupportsyouwhentransferringdatafrom
nonSAPsystems("LegacySystems")toR/3onceorperiodically.
Thetoolsupportsconversionofdataofthelegacysysteminaconvenientway.ThedatacanthenbeimportedintotheR/3systemviabatchinput,directinput,BAPIsorIDocs.
Furthermore,theLSMWorkbenchprovidesarecordingfunctionthatallowstogeneratea"datamigrationobject"inanentryorchangetransaction
TostartworkingwiththeLSMWorkbench,usetransactionLSMW:
Clickonthecreatebuttontocreatenewproject,subprojectandtheobject.Asshownbelow.
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
1/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
Project,SubprojectandObject:
Ontheinitialscreen,youcancreateanewproject,correspondingsubprojectsandobjectsviaEdit>Createnewentry.
Project:AnIDwithamaximumof10characterstonameyourdatatransferproject.Ifyouwanttotransferdatafromseverallegacysystems,youmaycreateaprojecte.g.foreverylegacysystem.
Subproject:AnIDwithamaximumof10charactersthatisusedasfurtherstructuringattribute.
Object:AnIDwithamaximumof10characterstonamethebusinessobject.
Intheinitialscreen,Allobjectsprovidesalistofallprojectscreatedalready.Myobjectsdisplaysalistofallobjectsyoucreatedpersonally.Allobjectsoftheprojectdisplaysallobjectsoftheselectedproject
astreestructure.Projectdocumentationdisplaysanydocumentationwrittenfortheindividualpopupsandprocessingsteps.youcanprinttheprojectdocumentationout,senditandsaveitinvariousfile
formats.
Clickontheexecutebuttononcetheproject,subprojectandtheobjectarecreated.
ClickBack.NowrecordusingBatchInputRecordingDataMigrationStepbyStepviaBatchInputRecording
Step1:MaintainObjectattributes
Inthisexample,youwillbeupdatingtheMaterialmasterrecordswiththehelpofrecordingatransaction(MM01).ChooseradiobuttonBatchInputRecordingandclickontherecordingoverviewiconto
recordtheR/3transaction.EntertheRecordingnameasMM01_REC2,thedescriptionasMM01Recordingmethod,andthetransactioncodeasMM01.
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
2/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
Clickoncreatetorecordthetransaction.
ClickonDone.
ClickonDonetoactuallystartrecordingthetransaction.
Enterthefieldsrequiredforrecodingatransactionsuccessfully.
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
3/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
Notethatthefieldsarepopulatedwithdefaultvalues.Thevaluesyouenteredwhenyourecordedthetransactionaresetbydefault.
*DoubleclickonthefieldRMMG1MATNRandenterthenameasMATNRandthedescriptionasMATERIALNUMBERandremovethedefaultasshownbelow:
Repeatthisstepforallfields.Similarly,doubleclickonallotherfieldswithdefaultvaluesandmakeappropriatechanges.Onceyouhavemadechanges,therecordingoverviewscreenlooksasshown
below:
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
4/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
ClickonSAVEtosavetherecording.TheclickonBACKicontothemainscreen.Savethewhilegoingbacktothemainscreen.
Aftercompletingtherecodingthesystemwillautomaticallytakeyoutothesecondstepasshownbelow:
Step2.MaintainSourceStructures
ClickonCREATEtocreateasourcestructure.Giveanameandadescriptiontothesourcestructureasshownbelow:
Savethesourcestructureandgotothemainscreen.
Step3.MaintainSourceFields
Inthisstep,youneedtolistwhatfieldsarepresentinthesourcestructure.Theeasiestwayistoclickon'TableMaintenance'icontoenterFieldname,TypeandLengthforeachfieldasshown:
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
5/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
Savewhilecomingbacktothemainscreen.
Step4:MaintainStructureRelations
Executeastepto'MaintainStructureRelations'.Since,thereisonlyoneSourceandTargetStructure,therelationshipisdefaultedautomatically.
Savewhilecomingbacktothemainscreen.
Step5:Maintainfieldmappingandconversionrules
Keepcursoronfield'MATNR'andclickon'AssignSourcefield'icontochoosesourcefieldMATERIALfromstructureMM01V6asshown
Similarly,assign'SourceField'rulestotheremainingfields.
Onceallthefieldsaremapped,youshouldhaveanoverviewscreenasshown
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
6/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
Savewhilecomingbacktothemainscreen.
Step6:Maintainfixedvalues,translations,userdefinedroutines
Youcanalsomaintainreusabletranslationsanduserdefinedroutines,whichcanbeusedacrossconversiontasks.Inthiscase,thatstepisnotrequired.
Step7:Specifyfiles
Inthisstep,wedefinehowthelayoutoftheinputfileis.Theinputfileisa[Tab]delimitedwiththefirstrowasfieldnames.ItispresentonmyPC(localdrive)asC:\MM3.txt.
DoubleClickonthelegacydata.
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
7/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
Savewhilegoingtomainscreen.
CreateanExcelwithyourdataandsaveitasaTabdelimitedtextfileonyourlocaldrive(C
andnameitMM3.txt.
IMPORTANT
****TheStructureoftheflatfileshouldbeproperotherwisedatawillnotbeuploaded..Allthemandatoryfieldsshouldbepresentintheflatfilefortherequiredtransaction
Step8:Assignfiles
Executestep'AssignFiles'andthesystemautomaticallydefaultsthefilenametothesourcestructure.
Savewhilegoingtomainscreen.
Step9:Readdata
Inthisstep,LSMWreadsthedatafromthesourcefile(fromyourPC'slocaldrive).Youhavetheoptiontoreadonlyselectedrowsandconvertdatavaluestointernalformat.
Here1to2representsthenumberofrowstobereadfromtheflatfile.Ifyoudon'tspecifyanynumberthesystemwillreadalltherowsfromtheflatfile.Wehave2rowsintheflatfilehencefrom1to2.
Afterweexecutethedatareadfromtheflatfileisasshownbelow.
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
8/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
Step10:Displayreaddata
Thisstepisoptional.Ifrequired,youcanreviewthefieldcontentsfortherowsofdataread.
Step11:Convertdata
Thisisthestepthatactuallyconvertsthesourcedata(insourceformat)toatargetformat.Basedontheconversionrulesdefined,sourcefieldsaremappedtotargetfields.
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
9/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
ClickBACKtocomebacktomainscreen.
Step12:DisplayConverteddata
AgainthisisanoptionalsteptoviewhowthesourcedataisconvertedtointernalSAPformat.
Step13:Createbatchinputsession
Oncethesourcedataisconvertedinaninternalformat,youcancreateabatchsessiontoprocessupdates.
ClickEXECUTEbuttontoexecuteabatchinoutsession.
Step14:RunBatchInputSession
YoucanexecutetheBDCsessionbyRunBatchinputsession.ExecutingabatchinputsessionisastandardSM35transactionformanagingBDCsessions.Onceyouhavesuccessfullyexecutedthe
batchinputsession,theMaterialmasterrecordsareupdatedinthesystem.YoucanconfirmthisbyviewingtheMaterialmasterrecords(MM03).
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
10/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
SelectthesessionandclickonthePROCESSicon.
YoucanProcessthesessioninforegroundorbackgroundorcanonlydisplayerrors.
SelecttheProcessingModeandthenclickonthePROCESStabtoexecutivethesession.
AfterthesessioniscompletelyprocessedyoucanconfirmthisbyviewingtheMaterialmasterrecords(MM03)orinthetableMARA.
sap
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
tutorial
11/12
5/22/2016
StepstocreateasimpleLSMWusingbatchinputrecordingABAPDevelopmentSCNWiki
4Comments
RonaldKnienieder
Greattutorial!Thanks!
jaganmathew
Superb!thanks!
AlfredoMurguia
Thankyou!Greattutorial.
MohammadZeeshan
Awesome!Veryhelpful!Thanks.
ContactUs
Privacy
SAPHelpPortal
TermsofUse
LegalDisclosure
Copyright
https://wiki.scn.sap.com/wiki/display/ABAP/Steps+to+create+a+simple+LSMW+using+batch+input+recording
FollowSCN
12/12