SAP - Using IDOC Method in LSMW
SAP - Using IDOC Method in LSMW
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.
Step Two: Input the fields for the segment structure, which would be required in LSMW
for mapping purpose.
Step Four: Run transaction ‘we30’ and enter IDOC structure name we want to create.
(C) Attach message type and IDOC type with the help of transaction ‘WE82’.
Now add two logical system names for sender and receiver ex. IDC64 and IDC87.
Select the client of your current system as per decision to make that system sender or
receiver.
Here in our LSMW using IDOC method, no need to assign client to sender as we are doing
Inbound IDOC Processing (i.e. Receiver side).
Step Eight: Run transaction ‘WE21’ to create File port. Give directory name as the
location of your file to be read. Give dummy name for ‘Outbound file’
field.
Step Ten: Run transaction ‘WE20’ to create partner profile for partner of receiver system
(IDC87) i.e. sender system (IDC64).
After saving this data, you go screen as below to attach function module to the process
code. The process code is the representation of the function module for inbound idoc
processing.
Part Two:
Following are the steps to be performed on LSMW side.
Step One:
Enter the project, sub-project and Object name for our scenario.
Step Three:
Click radio button ‘Maintain Source Structures’ and execute to create new source structure
as follows.
Step Four:
Click radio button ‘Maintain Source Fields’ and execute to enter the fields in the source
structure. Here these fields are same as the fields in segment of the IDOC created earlier.
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 Seven:
Step Eight:
Click radio button ‘Specify Files’ and execute to assign file on the local workstation to the
LSMW to read. The file has contents as shown below.
Step Ten:
Click radio button ‘Read Data’ and execute to read file from local workstation as per path
specified.
Step Eleven:
Click radio button ‘Display Read Data’ and execute to display data just read.
Step Twelve:
Click radio button ‘Convert Data’ and execute to create a file with extension ‘.conv ’.
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. For this purpose, we cam
use the converted file in step twelve. After successful generation of IDOC, below shown
message is displayed.
Step Fifteen:
Click radio button ‘Start IDoc Processing’ and execute to process the IDOC by inputting
necessary selection parameters.
Here , as you can see , the status of IDOC is OK (Green color Bubble) and hence confirms
successful processing of IDOC.
Step Seventeen:
Click radio button ‘Start IDoc Follow-Up’ and execute to reprocess the IDOC if not posted
or generated properly initially.