5 Things you may not known about LSMW
5 Things you may have not known about LSMW
As I journey further into HCM Cloud applications, I’ve gained more of an appreciation for LSMW. A few useful tips below – some you may have known about already or just a useful reminder if you not used LSMW for some time.
See attached XML document for screen shot details.
- Adding selection fields to the read and convert step. This is very useful in large migrations; where you have one source file and want to split the migration into smaller groups, for example select on a country or range of personnel areas. You can also include specific fields into the source file(s) for selection purposes.
On the ‘Maintain Source Fields’ step, double click on the field(s) you want to add as selection fields and set the Selection Parameter.
- Specifying source fields based on an existing SAP object. This is useful and saves time in LSMW build by automatically inheriting some of the field attributes from the existing SAP object. For example, using table PA0002 for an LSMW to migrate infotype 0002 (Personal Data).
On the ‘Maintain Source Fields’ step, select the Source Fields Input Structure, then the menu path, Source Fields>Copy Fields. Then select the table object you want to copy the fields from, this normally relates to the data table you are updating with the LSMW. For example, PA0002 for infotype 0002, or table CSKS for cost centre masters.
- Manually editing recordings. Useful if you wanted to make some cosmetic adjustments to a recording but did not want to re-run the full recording. For example, change a modulepool screen number or adding BDC Commands.
Use the ‘Export LSMW Project’ from the main LSMW application screen, using the ‘extras menu’ option. Select the LSMW project and continue, then unselect all the LSMW objects by clicking on the main project top node long description line. Then select the specific recording by clicking on the applicable long description line. Then Export the Project to a local text file. Using a normal text editor, you can then edit the LSMW manually. You need to maintain the same layout structure, but can edit within the Recording Section, add lines by copying exiting lines. Screen numbers can easy be changed by overwriting the existing number on the appropriate line. You can also remove lines or edit screen fields and BDC commands. Once finished, save the text file.
Use the ‘Import LSMW Project’ from the main LSMW application screen. Again, you must unselect all the objects and then just select the object you want to import. The existing recording will be overwritten with the manual modifications. It’s also useful to copy existing recordings that are similar to what you require for a new LSMW, and then follow the above to manually edit and import. These new recordings can then be used for new LSMW objects. For example, migrating infotype 0002 for many different countries that have similar fields.
- Batch files sizes and keeping batch folders. If you migrating large volumes of data and may also need to distribute loads across application servers, it is useful to break the batch files into user specified batch numbers.
In the ‘Create Batch Input Session’ step, use the display transaction per folder field to specify the batch sizes. You can also use the keep batch folders option to keep the batch files once completed.
- Batch Analysis in Excel format. The batch error analysis can be tedious to navigate through the various errors, mostly since this is done at an individual transaction level. With a bit of manual file manipulating, you can follow the below steps to import the errors into Excel.
– In SM35, highlight your batch with the errors.
– Click on Log
– Highlight the job
– Click display
– Click print
– Menu: System – List – Save – Local file – Unconverted
– In SE38, run program /SAPDMC/SAP_LSMW_BI_ANALYSIS
– In the Batch Input Folder(s) field, you need to enter the session name of your batch (that you will find in the first column in SM35).
NOTE: If you have more than one session in SM35 with the same batch name, the system will only pick up the first one. So delete the ones you don’t want to analyse to make sure the right one is picked up.
– Use the middle radio button for selection (Only Error message E,A,X)
– Click on execute
– On the next screen, select the PERNR tick box (usually the top one)
– Click on execute
– Menu: List – Save – File – Spreadsheet
– Open both your unconverted and your spreadsheet files from Step 1 and 2 in MS Excel
(for the text file, open as delimited in step 1; and use | as text delimiter in step 2)
– Now do a VLookup based on the index number, to get the PERNR (in step 2 file) next to the error message (in step 1 file).
NOTE: in the step 2 file, the index nr and the PERNR do not stand on the same row – so in a new column next to the index nr row, put in a formula to say = the PERNR cell; and then copy down to the bottom of page. Now copy and paste special – values. Then sort the file and you can do the lookup.
I hope you found this content useful.
Would you like to access Full Article?
If you are already a member in this website, Please Click here to loginIf you are not yet a member, Please Click here to Sign up
New NetWeaver Information at SAP.com