<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LSMW Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608024#M869111</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business Case:&lt;/P&gt;&lt;P&gt;As a part of reorganization and to better serve the customer needs, you are regrouping many of the customers. In SAP terms, you &lt;/P&gt;&lt;P&gt;are changing the Sales Office, Sales Group and Customer Groups for specific Customer Master Records. Typically, you would &lt;/P&gt;&lt;P&gt;maintain customer records with transaction XD02 to update &amp;#145;Sales View&amp;#146;. You would enter Customer Key (Customer No, Sales &lt;/P&gt;&lt;P&gt;Organization, Distribution Channel, and Division) and update relevant fields on Sales View screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document contains Step-by-step instructions to use LSMW to update Customer Master Records. It has two demonstration &lt;/P&gt;&lt;P&gt;examples - one using Batch Recording and another using standard SAP Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note! The screenprints in this article are from IDES Release 4.6. They may differ slightly in other versions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Demo Example 1&lt;/P&gt;&lt;P&gt;LSMW to Update Customer Master Records with Transaction Recording&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call Legacy System Migration Workbench by entering transaction code LSMW. Every conversion task is grouped together as &lt;/P&gt;&lt;P&gt;Project / Subproject / Object structure. Create a Project called LSMW_DEMO and a Subproject as CUSTOMERS and Object as &lt;/P&gt;&lt;P&gt;CUST_obj as shown in Figure 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 1         Conversion Task with Project, Subproject and Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main screen of LSMW provides wizard-like step-by-step tasks, as shown in Figure 2. To complete your data conversion, you &lt;/P&gt;&lt;P&gt;need to execute these steps in sequence. Once a step is executed, the cursor is automatically positioned to the next step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that these steps may look different depending upon your Personal menu settings. You could make step numbers visible by &lt;/P&gt;&lt;P&gt;&amp;#145;Numbers on&amp;#146; icon or hidden by &amp;#145;Numbers off&amp;#146; icon. You can execute a step by double-clicking on the row. Toggle icon &lt;/P&gt;&lt;P&gt;&amp;#145;Doubleclick=Display&amp;#146; or &amp;#145;Doubleclick=Edit&amp;#146;, makes the step in &amp;#145;display&amp;#146; mode or &amp;#145;change&amp;#146; mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 2 LSMW Wizard &amp;#150; initial screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: Maintain Object attributes&lt;/P&gt;&lt;P&gt;In this example, you will be updating the customer master records with the help of recording a transaction (XD02). Choose radio &lt;/P&gt;&lt;P&gt;button Batch Input Recording and click on the recording overview icon to record the R/3 transaction. Enter the Recording name as &lt;/P&gt;&lt;P&gt;XD02_REC, the description as Customer Master Updates Recording, and the transaction code as XD02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 3         Object type &amp;#145;Transaction Recording&amp;#146;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system calls the transaction code XD02 and prompts you to complete the Change&lt;/P&gt;&lt;P&gt;Customer transaction, as shown in Figure 4. Enter the key customer information (I entered customer number 1000, sales &lt;/P&gt;&lt;P&gt;organization 1000, distribution channel 01, and division 00) and choose &amp;#145;Sales&amp;#146; view within &amp;#145;Sales area data&amp;#146;. Make changes to &lt;/P&gt;&lt;P&gt;these three fields (I entered, sales office 1010, sales group 110, and customer group 01) and save the transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 4        Transaction recording for Transaction Code &amp;#145;XD02&amp;#146;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the transaction is completed, R/3 records the flow of screens and fields and saves the information, as shown in Figure 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 5         Transaction recording overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the fields are populated with default values. The values you entered when you recorded the transaction are set by &lt;/P&gt;&lt;P&gt;default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that if you have more fields in the recording than needed, you can remove them by clicking &amp;#145;Remove Screen field&amp;#146; icon.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Observe that the transaction-recording process stores field names in a technical format. By pressing the F1 key on individual &lt;/P&gt;&lt;P&gt;screen fields and then pressing the F9 key, the system displays technical names. You then can replace the technical names with &lt;/P&gt;&lt;P&gt;descriptive names. Double-click on the field RF02D-KUNNR and enter the name as KUNNR and the description as Customer &lt;/P&gt;&lt;P&gt;Account Number and remove the default value. (See Figure 6.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 6         Field attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, double-click on all other fields with default values and make appropriate changes. Once you have made changes, the &lt;/P&gt;&lt;P&gt;recording overview screen looks like what you see in Figure 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 7        Transaction Recording Overview &amp;#150; with screen field attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save your changes. When you go back to the initial screen, you will see that the initial screen steps have changed. Since you want &lt;/P&gt;&lt;P&gt;to import data via the BDC method, the Direct Input and IDoc-related steps are hidden, as they are not relevant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2. Maintain Source Structures&lt;/P&gt;&lt;P&gt;Give a name and a description to the source structure (Figure 8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 8         Source Structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3. Maintain Source Fields&lt;/P&gt;&lt;P&gt;In this step, you need to list what fields are present in the source structure. The easiest way is to click on &amp;#145;Table Maintenance&amp;#146; icon &lt;/P&gt;&lt;P&gt;to enter Fieldname, Type and Length for each field   as shown in Figure 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 9         Source fields of source Structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that your input file will have four fields as key fields and you need to update three fields in the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 4: Maintain Structure Relations&lt;/P&gt;&lt;P&gt;Execute a step to &amp;#145;Maintain Structure Relations&amp;#146;. (See Figure 10.) Since, there is only one Source and Target Structure, the &lt;/P&gt;&lt;P&gt;relationship is defaulted automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 10  Structure Relation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 5: Maintain field mapping and conversion rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field RF02D-D0310 represents that you chose &amp;#145;Sales view&amp;#146; for the customer Master screen accordingly its value should be set to &lt;/P&gt;&lt;P&gt;X. Keep your cursor on field RF02D-D0310 and click on Constant rule icon to choose the constant value of &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your source file already has the field value, you choose rule &amp;#145;Source Field&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep cursor on field &amp;#145;KUNNR&amp;#146; and click on &amp;#145;Assign Source field&amp;#146; icon to choose source field CUSTOMER from structure XD02S as &lt;/P&gt;&lt;P&gt;shown in Figure 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 11 Assign source fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, assign &amp;#145;Source Field&amp;#146; rules to the remaining fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once all the fields are mapped, you should have an overview screen as shown in Figure 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 12 Field mapping and Conversion rules overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 6: Maintain fixed values, translations, user-defined routines&lt;/P&gt;&lt;P&gt;You can also maintain re-usable translations and user-defined routines, which can be used across conversion tasks. In this case, &lt;/P&gt;&lt;P&gt;that step is not required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 7: Specify files&lt;/P&gt;&lt;P&gt;In this step, we define how the layout of the input file is. The input file is a [Tab] delimited with the first row as field names. It is &lt;/P&gt;&lt;P&gt;present on my PC (local drive) as C:\XD02.txt. (See Figure 13.)&lt;/P&gt;&lt;P&gt;                                                                                Figure 13 File attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an Excel file (Figure 14) with your data and save it as a Tab-delimited text file on your local drive (C:\) and name it XD02.&lt;/P&gt;&lt;P&gt;txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 14  Source data in Excel file (saved as Tab delimited file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 8: Assign files&lt;/P&gt;&lt;P&gt;Execute step &amp;#145;Assign Files&amp;#146; (Figure 15) and the system automatically defaults the filename to the source structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 15 Assign file to Source Structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 9: Read data&lt;/P&gt;&lt;P&gt;In this step, LSMW reads the data (Figure 16) from the source file (from your PC&amp;#146;s local drive). You have the option to read only &lt;/P&gt;&lt;P&gt;selected rows and convert data values to Internal format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 16 Read Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 10: Display read data&lt;/P&gt;&lt;P&gt;This step (Figure 17) is optional. If required, you can review the field contents for the rows of data read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 17 Display Read Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 11: Convert data&lt;/P&gt;&lt;P&gt;This is the step that actually converts the source data (in source format) to a target format. Based on the conversion rules defined, &lt;/P&gt;&lt;P&gt;source fields are mapped to target fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 12: Display Converted data&lt;/P&gt;&lt;P&gt;Again this is an optional step to view how the source data is converted to internal SAP format (Figure 18).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 18 Display Converted Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 13: Create batch input session&lt;/P&gt;&lt;P&gt;Once the source data is converted in an internal format, you can create a batch session to process updates (Figure 19).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 19 Create Batch Input Session&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 14: Run Batch Input Session&lt;/P&gt;&lt;P&gt;You can execute the BDC session by Run Batch input session. Executing a batch input session is a standard SM35 transaction for &lt;/P&gt;&lt;P&gt;managing BDC sessions. Once you have successfully executed the batch input session, the customer master records are updated in &lt;/P&gt;&lt;P&gt;the system. You can confirm this by viewing the customer master records (XD03).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note! Browsing thru these 14 steps, you may get a feeling that this is a very lengthy and time-consuming activity. However, for &lt;/P&gt;&lt;P&gt;the purposes of demonstration, I have made it detailed. Although it looks lengthy, actually it takes hardly few hours from start-to-&lt;/P&gt;&lt;P&gt;finish! After playing around with few simple LSMW scripts, you will find it so easy to change and create more complex ones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Demo Example 2&lt;/P&gt;&lt;P&gt;LSMW to Update Customer Master Records with Standard Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an alternative to using &amp;#145;Transaction Recording&amp;#146;, you could also use a standard SAP object to update Customer Master Records. &lt;/P&gt;&lt;P&gt;Business Object &amp;#145;0050&amp;#146; is already pre-defined in the system with standard Batch Input Interface Program &amp;#145;RFBIDE00&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an Object CUST_OBJ within Project as LSMW_DEMO and Subproject as CUSTOMERS as shown in Figure 20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 20  LSMW Object with Standard SAP Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note! For the Demo example 2, I will list only those steps that are different from the first demo example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: Maintain Object attributes&lt;/P&gt;&lt;P&gt;You will be updating the customer master records with the help of Standard Batch Input; therefore, choose radio-button Standard &lt;/P&gt;&lt;P&gt;Batch/Direct Input as shown in Figure 21. Enter Object &amp;#145;0050&amp;#146; for Customer Master records and default method &amp;#145;0000&amp;#146; and click &lt;/P&gt;&lt;P&gt;on Save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 21 Standard Batch/Direct Input Object Attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 4: Maintain Structure Relations&lt;/P&gt;&lt;P&gt;Sales view of Customer Master is stored in table KNVV. Accordingly, you need to update structure BKNVV. However, in addition, &lt;/P&gt;&lt;P&gt;the Standard Object &amp;#145;0050&amp;#146; also requires updates to BGR00, BKN00 and BKNA1 structures. (If you do not maintain Structure &lt;/P&gt;&lt;P&gt;relations for mandatory entries, you might get a message such as &amp;#145;Target structure BKNA1 needs a relation to a source structure&amp;#146;.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though you don&amp;#146;t want to update any fields in these structures, you need to create a relationship with source structures. In &lt;/P&gt;&lt;P&gt;all, you need to create relationship for four target structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create relationship between source structures XD02S with these target structures with icon &amp;#145;Create Relationship&amp;#146;  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep Cursor on these four target structures and click on icon &amp;#145;Create Relation&amp;#146; and structure relations are maintained as shown in &lt;/P&gt;&lt;P&gt;Figure 22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 22 Structure Relation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 5: Maintain field mapping and conversion rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Keep your cursor on &amp;#145;TCODE&amp;#146; field and click on &amp;#145;Insert Rule&amp;#146; icon  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 23 LSMW Conversion Rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choose radio button &amp;#145;Constant&amp;#146; (Figure 23) to enter value &amp;#145;XD02&amp;#146; transaction code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Keep your cursor on field &amp;#145;KUNNR&amp;#146; and click on &amp;#145;Assign source field&amp;#146; icon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choose source field &amp;#145;Customer&amp;#146; from source structure &amp;#145;XD02S&amp;#146;. (See Figure 24.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 24 Assign Source fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Similarly, choose source fields for Sales Organization, Distribution Channel, and Division. (See Figure 25.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 25 Field Mapping and Conversion Rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Scroll down to structure BKNVV fields and assign source fields to three fields Sales Office, Sales Group, and Customer Group &lt;/P&gt;&lt;P&gt;(Figure 26).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 26 Field Mapping and Conversion Rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save and go back to main screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 12: Display Converted data&lt;/P&gt;&lt;P&gt;When you convert data, LSMW automatically converts into the appropriate structure layouts, as required by Standard program &lt;/P&gt;&lt;P&gt;(RFBIDE00). (See Figure 27).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 27 Converted data into multiple structures&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that if you had only one record in source file, the converted file has four records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Earlier, creating this input file, so that the standard interface program can read it, was a big nightmare, the primary reason being &lt;/P&gt;&lt;P&gt;that it could have multiple record layouts. Even for a simple conversion with one input record, you would have to create this &lt;/P&gt;&lt;P&gt;complex file with many record layouts. The advantage of LSMW is that it prepares these multi-layout files automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 13: Create batch input session&lt;/P&gt;&lt;P&gt;Once source data is converted in internal format, you can create a BDC session to process the updates (Figures 28 and 29).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 28 Create BDC Session&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 29 BDC Session &amp;#145;CUST_OBJ&amp;#146; created&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Summary&lt;/P&gt;&lt;P&gt;Once BDC session is processed successfully, SAP updates the customer master records with relevant changes. Review these &lt;/P&gt;&lt;P&gt;specific customers (transaction code XD03) and confirm that the changes are correctly reflected in the master records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the link.........................&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapmaterial.com/lsmw.html" target="test_blank"&gt;http://www.sapmaterial.com/lsmw.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Mar 2008 04:53:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-31T04:53:42Z</dc:date>
    <item>
      <title>LSMW Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608021#M869108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  I have recorded the BDC and maintained the source fields in LSMW.  But, i can't see any source field in "Field Mapping and Conversion Rules" step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 04:38:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608021#M869108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T04:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: LSMW Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608022#M869109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;These are the step by step procedure to do LSMW, follow this and do, u will get the output..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initially there will be 20 steps but after processing 1 step it will reduced to 14 for Batch input recording method&lt;/P&gt;&lt;P&gt;T-Code: LSMW&lt;/P&gt;&lt;P&gt;ENTER PROJECT NAME&lt;/P&gt;&lt;P&gt;Sub project name&lt;/P&gt;&lt;P&gt;Object name&lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;1. MAINTAIN OBJECT ATTRIBUTES&lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Display/Change&lt;/P&gt;&lt;P&gt;    Select Batch Input recording &lt;/P&gt;&lt;P&gt;    go to-&amp;gt;recording overview&lt;/P&gt;&lt;P&gt;    create&lt;/P&gt;&lt;P&gt;    Recording name&lt;/P&gt;&lt;P&gt;    Enter transaction code&lt;/P&gt;&lt;P&gt;    Start recording&lt;/P&gt;&lt;P&gt;    do recording as per the Requirement&lt;/P&gt;&lt;P&gt;    Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;    Enter recording name&lt;/P&gt;&lt;P&gt;    Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;Now there will be 14 steps&lt;/P&gt;&lt;P&gt;2. MAINTAIN SOURCE STRUCTURES&lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Display/Change&lt;/P&gt;&lt;P&gt;    Create &lt;/P&gt;&lt;P&gt;    Enter the name of structure&lt;/P&gt;&lt;P&gt;    Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;3. MAINTAIN SOURCE FIELDS&lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Display/Change&lt;/P&gt;&lt;P&gt;    Select structure&lt;/P&gt;&lt;P&gt;    Select Copy fields (a dialogue window will pop out )&lt;/P&gt;&lt;P&gt;    Select From data file&lt;/P&gt;&lt;P&gt;    Apply source fields&lt;/P&gt;&lt;P&gt;    a. Enter No. of field's &lt;/P&gt;&lt;P&gt;    b. Length of record&lt;/P&gt;&lt;P&gt;    c. Attach file&lt;/P&gt;&lt;P&gt;    Save &amp;amp; Back.&lt;/P&gt;&lt;P&gt;4. MAINTAIN STRUCTURE RELATIONS&lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Display/Change&lt;/P&gt;&lt;P&gt;    Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;5. MAINTAN FIELD MAPPING &amp;amp; CONVERSION RULE&lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Display/Change&lt;/P&gt;&lt;P&gt;    Click on source field, select exact field from structure and press Enter&lt;/P&gt;&lt;P&gt;    ***repeat these steps for all fields&lt;/P&gt;&lt;P&gt;    (or) Extras-&amp;gt;Automapping&lt;/P&gt;&lt;P&gt;    Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;6. MAINTAIN FIXED VALUES, TRANSACTION, USER DEFINED ROUTINEs&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    Not necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;7. SPECIFY FILES.&lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Display/Change&lt;/P&gt;&lt;P&gt;    Click on legacy data on pc&lt;/P&gt;&lt;P&gt;    Brose flat file&lt;/P&gt;&lt;P&gt;    Give description&lt;/P&gt;&lt;P&gt;    Select tabulator&lt;/P&gt;&lt;P&gt;    select Filed names at start of file&lt;/P&gt;&lt;P&gt;    Enter&lt;/P&gt;&lt;P&gt;    Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;8*. ASSIGN FILES &lt;/P&gt;&lt;P&gt;    Execute &lt;/P&gt;&lt;P&gt;    Display/Change&lt;/P&gt;&lt;P&gt;    Save &amp;amp; Back&lt;/P&gt;&lt;P&gt;9. READ DATA&lt;/P&gt;&lt;P&gt;    Execute &lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Back &amp;amp; Back&lt;/P&gt;&lt;P&gt;10. DISPLAY IMPORTED DATA&lt;/P&gt;&lt;P&gt;    Execute	&lt;/P&gt;&lt;P&gt;    Enter ok                     ***it will show records&lt;/P&gt;&lt;P&gt;    Back&lt;/P&gt;&lt;P&gt;11. CONVERT DATA&lt;/P&gt;&lt;P&gt;    Execute &lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Back &amp;amp; Back&lt;/P&gt;&lt;P&gt;12. DISPLAY CONVERTED DATA&lt;/P&gt;&lt;P&gt;    Execute &lt;/P&gt;&lt;P&gt;    Enter ok                     ***it will show records&lt;/P&gt;&lt;P&gt;    Back&lt;/P&gt;&lt;P&gt;13. CREATE BATCH INPUT SESSION&lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Select keep batch input folder &lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    Enter&lt;/P&gt;&lt;P&gt;14. RUN BATCH INPUT SESSION.&lt;/P&gt;&lt;P&gt;    Execute&lt;/P&gt;&lt;P&gt;    SM35 will come&lt;/P&gt;&lt;P&gt;    Object name will be shown here &lt;/P&gt;&lt;P&gt;    Select object &amp;amp; process &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps u,&lt;/P&gt;&lt;P&gt;Arunsri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 04:44:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608022#M869109</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T04:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: LSMW Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608023#M869110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may have not specified the source structure. and the relationship between them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dhruv Shah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 04:47:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608023#M869110</guid>
      <dc:creator>dhruv_shah3</dc:creator>
      <dc:date>2008-03-31T04:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: LSMW Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608024#M869111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business Case:&lt;/P&gt;&lt;P&gt;As a part of reorganization and to better serve the customer needs, you are regrouping many of the customers. In SAP terms, you &lt;/P&gt;&lt;P&gt;are changing the Sales Office, Sales Group and Customer Groups for specific Customer Master Records. Typically, you would &lt;/P&gt;&lt;P&gt;maintain customer records with transaction XD02 to update &amp;#145;Sales View&amp;#146;. You would enter Customer Key (Customer No, Sales &lt;/P&gt;&lt;P&gt;Organization, Distribution Channel, and Division) and update relevant fields on Sales View screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This document contains Step-by-step instructions to use LSMW to update Customer Master Records. It has two demonstration &lt;/P&gt;&lt;P&gt;examples - one using Batch Recording and another using standard SAP Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note! The screenprints in this article are from IDES Release 4.6. They may differ slightly in other versions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Demo Example 1&lt;/P&gt;&lt;P&gt;LSMW to Update Customer Master Records with Transaction Recording&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Call Legacy System Migration Workbench by entering transaction code LSMW. Every conversion task is grouped together as &lt;/P&gt;&lt;P&gt;Project / Subproject / Object structure. Create a Project called LSMW_DEMO and a Subproject as CUSTOMERS and Object as &lt;/P&gt;&lt;P&gt;CUST_obj as shown in Figure 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 1         Conversion Task with Project, Subproject and Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The main screen of LSMW provides wizard-like step-by-step tasks, as shown in Figure 2. To complete your data conversion, you &lt;/P&gt;&lt;P&gt;need to execute these steps in sequence. Once a step is executed, the cursor is automatically positioned to the next step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that these steps may look different depending upon your Personal menu settings. You could make step numbers visible by &lt;/P&gt;&lt;P&gt;&amp;#145;Numbers on&amp;#146; icon or hidden by &amp;#145;Numbers off&amp;#146; icon. You can execute a step by double-clicking on the row. Toggle icon &lt;/P&gt;&lt;P&gt;&amp;#145;Doubleclick=Display&amp;#146; or &amp;#145;Doubleclick=Edit&amp;#146;, makes the step in &amp;#145;display&amp;#146; mode or &amp;#145;change&amp;#146; mode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 2 LSMW Wizard &amp;#150; initial screen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: Maintain Object attributes&lt;/P&gt;&lt;P&gt;In this example, you will be updating the customer master records with the help of recording a transaction (XD02). Choose radio &lt;/P&gt;&lt;P&gt;button Batch Input Recording and click on the recording overview icon to record the R/3 transaction. Enter the Recording name as &lt;/P&gt;&lt;P&gt;XD02_REC, the description as Customer Master Updates Recording, and the transaction code as XD02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 3         Object type &amp;#145;Transaction Recording&amp;#146;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system calls the transaction code XD02 and prompts you to complete the Change&lt;/P&gt;&lt;P&gt;Customer transaction, as shown in Figure 4. Enter the key customer information (I entered customer number 1000, sales &lt;/P&gt;&lt;P&gt;organization 1000, distribution channel 01, and division 00) and choose &amp;#145;Sales&amp;#146; view within &amp;#145;Sales area data&amp;#146;. Make changes to &lt;/P&gt;&lt;P&gt;these three fields (I entered, sales office 1010, sales group 110, and customer group 01) and save the transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 4        Transaction recording for Transaction Code &amp;#145;XD02&amp;#146;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once the transaction is completed, R/3 records the flow of screens and fields and saves the information, as shown in Figure 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 5         Transaction recording overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the fields are populated with default values. The values you entered when you recorded the transaction are set by &lt;/P&gt;&lt;P&gt;default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that if you have more fields in the recording than needed, you can remove them by clicking &amp;#145;Remove Screen field&amp;#146; icon.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Observe that the transaction-recording process stores field names in a technical format. By pressing the F1 key on individual &lt;/P&gt;&lt;P&gt;screen fields and then pressing the F9 key, the system displays technical names. You then can replace the technical names with &lt;/P&gt;&lt;P&gt;descriptive names. Double-click on the field RF02D-KUNNR and enter the name as KUNNR and the description as Customer &lt;/P&gt;&lt;P&gt;Account Number and remove the default value. (See Figure 6.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 6         Field attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, double-click on all other fields with default values and make appropriate changes. Once you have made changes, the &lt;/P&gt;&lt;P&gt;recording overview screen looks like what you see in Figure 7.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 7        Transaction Recording Overview &amp;#150; with screen field attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save your changes. When you go back to the initial screen, you will see that the initial screen steps have changed. Since you want &lt;/P&gt;&lt;P&gt;to import data via the BDC method, the Direct Input and IDoc-related steps are hidden, as they are not relevant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 2. Maintain Source Structures&lt;/P&gt;&lt;P&gt;Give a name and a description to the source structure (Figure 8).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 8         Source Structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 3. Maintain Source Fields&lt;/P&gt;&lt;P&gt;In this step, you need to list what fields are present in the source structure. The easiest way is to click on &amp;#145;Table Maintenance&amp;#146; icon &lt;/P&gt;&lt;P&gt;to enter Fieldname, Type and Length for each field   as shown in Figure 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 9         Source fields of source Structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that your input file will have four fields as key fields and you need to update three fields in the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 4: Maintain Structure Relations&lt;/P&gt;&lt;P&gt;Execute a step to &amp;#145;Maintain Structure Relations&amp;#146;. (See Figure 10.) Since, there is only one Source and Target Structure, the &lt;/P&gt;&lt;P&gt;relationship is defaulted automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 10  Structure Relation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 5: Maintain field mapping and conversion rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Field RF02D-D0310 represents that you chose &amp;#145;Sales view&amp;#146; for the customer Master screen accordingly its value should be set to &lt;/P&gt;&lt;P&gt;X. Keep your cursor on field RF02D-D0310 and click on Constant rule icon to choose the constant value of &amp;#145;X&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If your source file already has the field value, you choose rule &amp;#145;Source Field&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep cursor on field &amp;#145;KUNNR&amp;#146; and click on &amp;#145;Assign Source field&amp;#146; icon to choose source field CUSTOMER from structure XD02S as &lt;/P&gt;&lt;P&gt;shown in Figure 11.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 11 Assign source fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly, assign &amp;#145;Source Field&amp;#146; rules to the remaining fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once all the fields are mapped, you should have an overview screen as shown in Figure 12.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 12 Field mapping and Conversion rules overview&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 6: Maintain fixed values, translations, user-defined routines&lt;/P&gt;&lt;P&gt;You can also maintain re-usable translations and user-defined routines, which can be used across conversion tasks. In this case, &lt;/P&gt;&lt;P&gt;that step is not required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 7: Specify files&lt;/P&gt;&lt;P&gt;In this step, we define how the layout of the input file is. The input file is a [Tab] delimited with the first row as field names. It is &lt;/P&gt;&lt;P&gt;present on my PC (local drive) as C:\XD02.txt. (See Figure 13.)&lt;/P&gt;&lt;P&gt;                                                                                Figure 13 File attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an Excel file (Figure 14) with your data and save it as a Tab-delimited text file on your local drive (C:\) and name it XD02.&lt;/P&gt;&lt;P&gt;txt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 14  Source data in Excel file (saved as Tab delimited file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 8: Assign files&lt;/P&gt;&lt;P&gt;Execute step &amp;#145;Assign Files&amp;#146; (Figure 15) and the system automatically defaults the filename to the source structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 15 Assign file to Source Structure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 9: Read data&lt;/P&gt;&lt;P&gt;In this step, LSMW reads the data (Figure 16) from the source file (from your PC&amp;#146;s local drive). You have the option to read only &lt;/P&gt;&lt;P&gt;selected rows and convert data values to Internal format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 16 Read Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 10: Display read data&lt;/P&gt;&lt;P&gt;This step (Figure 17) is optional. If required, you can review the field contents for the rows of data read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 17 Display Read Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 11: Convert data&lt;/P&gt;&lt;P&gt;This is the step that actually converts the source data (in source format) to a target format. Based on the conversion rules defined, &lt;/P&gt;&lt;P&gt;source fields are mapped to target fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 12: Display Converted data&lt;/P&gt;&lt;P&gt;Again this is an optional step to view how the source data is converted to internal SAP format (Figure 18).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 18 Display Converted Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 13: Create batch input session&lt;/P&gt;&lt;P&gt;Once the source data is converted in an internal format, you can create a batch session to process updates (Figure 19).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 19 Create Batch Input Session&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 14: Run Batch Input Session&lt;/P&gt;&lt;P&gt;You can execute the BDC session by Run Batch input session. Executing a batch input session is a standard SM35 transaction for &lt;/P&gt;&lt;P&gt;managing BDC sessions. Once you have successfully executed the batch input session, the customer master records are updated in &lt;/P&gt;&lt;P&gt;the system. You can confirm this by viewing the customer master records (XD03).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note! Browsing thru these 14 steps, you may get a feeling that this is a very lengthy and time-consuming activity. However, for &lt;/P&gt;&lt;P&gt;the purposes of demonstration, I have made it detailed. Although it looks lengthy, actually it takes hardly few hours from start-to-&lt;/P&gt;&lt;P&gt;finish! After playing around with few simple LSMW scripts, you will find it so easy to change and create more complex ones.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Demo Example 2&lt;/P&gt;&lt;P&gt;LSMW to Update Customer Master Records with Standard Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an alternative to using &amp;#145;Transaction Recording&amp;#146;, you could also use a standard SAP object to update Customer Master Records. &lt;/P&gt;&lt;P&gt;Business Object &amp;#145;0050&amp;#146; is already pre-defined in the system with standard Batch Input Interface Program &amp;#145;RFBIDE00&amp;#146;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create an Object CUST_OBJ within Project as LSMW_DEMO and Subproject as CUSTOMERS as shown in Figure 20.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 20  LSMW Object with Standard SAP Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note! For the Demo example 2, I will list only those steps that are different from the first demo example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 1: Maintain Object attributes&lt;/P&gt;&lt;P&gt;You will be updating the customer master records with the help of Standard Batch Input; therefore, choose radio-button Standard &lt;/P&gt;&lt;P&gt;Batch/Direct Input as shown in Figure 21. Enter Object &amp;#145;0050&amp;#146; for Customer Master records and default method &amp;#145;0000&amp;#146; and click &lt;/P&gt;&lt;P&gt;on Save.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 21 Standard Batch/Direct Input Object Attributes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 4: Maintain Structure Relations&lt;/P&gt;&lt;P&gt;Sales view of Customer Master is stored in table KNVV. Accordingly, you need to update structure BKNVV. However, in addition, &lt;/P&gt;&lt;P&gt;the Standard Object &amp;#145;0050&amp;#146; also requires updates to BGR00, BKN00 and BKNA1 structures. (If you do not maintain Structure &lt;/P&gt;&lt;P&gt;relations for mandatory entries, you might get a message such as &amp;#145;Target structure BKNA1 needs a relation to a source structure&amp;#146;.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even though you don&amp;#146;t want to update any fields in these structures, you need to create a relationship with source structures. In &lt;/P&gt;&lt;P&gt;all, you need to create relationship for four target structures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create relationship between source structures XD02S with these target structures with icon &amp;#145;Create Relationship&amp;#146;  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep Cursor on these four target structures and click on icon &amp;#145;Create Relation&amp;#146; and structure relations are maintained as shown in &lt;/P&gt;&lt;P&gt;Figure 22.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 22 Structure Relation&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 5: Maintain field mapping and conversion rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Keep your cursor on &amp;#145;TCODE&amp;#146; field and click on &amp;#145;Insert Rule&amp;#146; icon  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 23 LSMW Conversion Rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choose radio button &amp;#145;Constant&amp;#146; (Figure 23) to enter value &amp;#145;XD02&amp;#146; transaction code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Keep your cursor on field &amp;#145;KUNNR&amp;#146; and click on &amp;#145;Assign source field&amp;#146; icon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Choose source field &amp;#145;Customer&amp;#146; from source structure &amp;#145;XD02S&amp;#146;. (See Figure 24.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 24 Assign Source fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Similarly, choose source fields for Sales Organization, Distribution Channel, and Division. (See Figure 25.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 25 Field Mapping and Conversion Rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Scroll down to structure BKNVV fields and assign source fields to three fields Sales Office, Sales Group, and Customer Group &lt;/P&gt;&lt;P&gt;(Figure 26).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 26 Field Mapping and Conversion Rules&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save and go back to main screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 12: Display Converted data&lt;/P&gt;&lt;P&gt;When you convert data, LSMW automatically converts into the appropriate structure layouts, as required by Standard program &lt;/P&gt;&lt;P&gt;(RFBIDE00). (See Figure 27).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 27 Converted data into multiple structures&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that if you had only one record in source file, the converted file has four records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Earlier, creating this input file, so that the standard interface program can read it, was a big nightmare, the primary reason being &lt;/P&gt;&lt;P&gt;that it could have multiple record layouts. Even for a simple conversion with one input record, you would have to create this &lt;/P&gt;&lt;P&gt;complex file with many record layouts. The advantage of LSMW is that it prepares these multi-layout files automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Step 13: Create batch input session&lt;/P&gt;&lt;P&gt;Once source data is converted in internal format, you can create a BDC session to process the updates (Figures 28 and 29).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 28 Create BDC Session&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Figure 29 BDC Session &amp;#145;CUST_OBJ&amp;#146; created&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Summary&lt;/P&gt;&lt;P&gt;Once BDC session is processed successfully, SAP updates the customer master records with relevant changes. Review these &lt;/P&gt;&lt;P&gt;specific customers (transaction code XD03) and confirm that the changes are correctly reflected in the master records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see the link.........................&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapmaterial.com/lsmw.html" target="test_blank"&gt;http://www.sapmaterial.com/lsmw.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 04:53:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608024#M869111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T04:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: LSMW Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608025#M869112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kit,&lt;/P&gt;&lt;P&gt;U has to maintain fields , then structures and then u have to maintain relationships correctly then u will get the source to map the fields.&lt;/P&gt;&lt;P&gt;when u r doing LSMW compare with thesession methods , the procedure is similar but doing is different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PLz rewards points if useful,&lt;/P&gt;&lt;P&gt;Ganesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 05:01:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608025#M869112</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T05:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: LSMW Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608026#M869113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;  I have already maintained the source struture and structure relations. but, i still can't see the source field.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2008 06:25:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-problem/m-p/3608026#M869113</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-31T06:25:00Z</dc:date>
    </item>
  </channel>
</rss>

