Step-By-Step Guide for LSMW using ALE/IDOC Method
By Sarang Kahu

Business Case: In Business scenario, it is required to upload the data into R/3 and process the data in the IDOC form only. The data can be migrated to R/3 SAP system using IDOC Generation Method in LSMW. The data to be uploaded can be regarding material, vendor, customer etc. IDOC is the container, which stores the data in structured format and is used to communicate between R/3 systems. IDOC structure includes Status Record for storing status information of IDOC dispatch, Data Record for storing data into segments and its corresponding fields and Control Record has receiver and source system details etc. This document contains Step-by-Step instructions to use LSMW to generate and process IDOC from the data file available. In first part user-defined IDOC structure is created and required ALE settings are done .In the Second part, this IDOC structure is used in the LSMW IDOC. Part One: To create IDOC structure Step One: Run transaction WE31.Create Segment with name ‘ZEMP_SEG’.

Step Two: Input the fields for the segment structure, which would be required in LSMW for mapping purpose.

The maximum and minimum repetitions can be from 000000000000 to 99999999999. . Here.2 Step Three: Now. Step Four: Run transaction ‘we30’ and enter IDOC structure name we want to create. so that you can use this segment in the R/3 system further. Step Five: (A) Add segment created earlier to this IDOC type ‘ZEMP_IDC’. IDOC structure name is ‘ZEMP_IDC’. Go to Edit -> Set Release.

Step Six: Go to transaction ‘SALE’.3 Choose any number rang as per requirement. IDC64 and IDC87. (B)Create new Message type in transaction ‘WE81’. (C) Attach message type and IDOC type with the help of transaction ‘WE82’. . Now. Go back to earlier page and Click Edit-> Set Release. Click as marked in red color. Now add two logical system names for sender and receiver ex.

Receiver side). Select the client of your current system as per decision to make that system sender or receiver. Input receiver system ‘IDC87’ to client 800. you come to following screen. .e.4 Step Seven: Now assign clients to the logical systems created. no need to assign client to sender as we are doing Inbound IDOC Processing (i. Here in our LSMW using IDOC method. After clicking on to Goto->Details .

Please make sure here connection type is ‘T’ for TCP/IP .5 Step Eight: Run transaction ‘WE21’ to create File port. Give dummy name for ‘Outbound file’ field. Step Nine: Run ‘SM59’ transaction to create RFC connection. . Give directory name as the location of your file to be read.

6 Step Ten: Run transaction ‘WE20’ to create partner profile for partner of receiver system (IDC87) i. The process code is the representation of the function module for inbound idoc processing. .e. sender system (IDC64). Step Eleven: Create process code using ‘WE42’. After saving this data. you go screen as below to attach function module to the process code.

.7 Step Twelve: Now you can use this process code in the inbound parameters of the partner’s profile. Part Two: Following are the steps to be performed on LSMW side. Step Two: Click the first radio button ‘Maintain Object Attributes’ . Step One: Enter the project. execute and enter the message name and IDOC name into the screen as follows. sub-project and Object name for our scenario.

Here these fields are same as the fields in segment of the IDOC created earlier. Step Four: Click radio button ‘Maintain Source Fields’ and execute to enter the fields in the source structure.8 Step Three: Click radio button ‘Maintain Source Structures’ and execute to create new source structure as follows. Step Five: Click radio button ‘Maintain Structure Relations’ and execute to create relationship between source and target structure. Here target structure is Message type ‘ZEMP_MSG’. .

User-Defined Routines’ and execute to assign fixed values to any field. The file has contents as shown below. These activities are not required in our scenario. to call user defined routines etc.9 Step Six: Click radio button ‘Maintain Field Mapping and Conversion Rules’ and execute to create field mapping and a conversion rules between source structure and target structure. Step Eight: Click radio button ‘Specify Files’ and execute to assign file on the local workstation to the LSMW to read. . Step Seven: Click radio button ‘Maintain Fixed Values. Translations.

Step Nine: Click radio button ‘Specify Files’ and execute to specify file to source structure as follows.10 And now we specify the location of file here. Step Ten: Click radio button ‘Read Data’ and execute to read file from local workstation as per path specified. .

.11 Step Eleven: Click radio button ‘Display Read Data’ and execute to display data just read. Step Thirteen: Click radio button ‘Display Converted Data’ and execute to display the converted data.conv ’. Step Twelve: Click radio button ‘Convert Data’ and execute to create a file with extension ‘.

. we cam use the converted file in step twelve. For this purpose. and execute to process the IDOC by Step Sixteen: Click radio button ‘Create IDoc Overview’ and execute to show status and details of IDOC generated.12 Step Fourteen: Click radio button ‘Start IDoc Generation’ and execute to generate the IDOC from the data provided and structure mapping done earlier in this document. below shown message is displayed. This screen is similar to ‘WE02’ or ‘WE05’ transaction. Step Fifteen: Click radio button ‘Start IDoc Processing’ inputting necessary selection parameters. After successful generation of IDOC.

as you can see . .13 Here . Step Seventeen: Click radio button ‘Start IDoc Follow-Up’ and execute to reprocess the IDOC if not posted or generated properly initially. the status of IDOC is OK (Green color Bubble) and hence confirms successful processing of IDOC.

Sign up to vote on this title
UsefulNot useful