lsmw idoc

Upload: kocherlakotapavan

Post on 02-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 lsmw idoc

    1/9

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

    2010 SAP AG 1

    Processing IDOC through LSMW

    Applies to:For more information, visit theABAP homepage.

    Summary

    LSMW stands for Legacy System Migration Workbench. This tool is used to transfer data from eitherlegacy or application to SAP. In below scenario, the data is transferred to SAP via IDOC using LSMW.

    Author: Bathula Banu H

    Company: Wipro Technologies Limited

    Created on: 9 September 2010

    Author Bio

    I have 3+ years of experience in ABAP. Worked in modules like HR, FI and PS.

    https://www.sdn.sap.com/irj/sdn/abaphttps://www.sdn.sap.com/irj/sdn/abaphttps://www.sdn.sap.com/irj/sdn/abaphttps://www.sdn.sap.com/irj/sdn/abap
  • 7/27/2019 lsmw idoc

    2/9

    Processing IDOC through LSMW

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

    2010 SAP AG 2

    Table of Content

    Processing IDOC through LSMW ....................................................................................................................... 3Step 1: Tcode: LSMW. .................................................................................................................................... 3Step 2: Maintain Object Attributes .................................................................................................................. 3Step 3: Maintain Source Structures ................................................................................................................ 4Step 4: Maintain Source Fields ...................................................................................................................... 4Step 5: Maintain Structure Relations .............................................................................................................. 5Step 6: Maintain Field Mapping and Conversion Rules .................................................................................. 5 Step 7: Specify Files ....................................................................................................................................... 5Step 8: Assign Files ........................................................................................................................................ 6Step 9: Read and convert the data ................................................................................................................. 6Step 10: Start IDoc Generation ....................................................................................................................... 7Step 11: Start IDoc Processing ....................................................................................................................... 7Step 12: Create IDoc Overview ...................................................................................................................... 8Step 13: Start IDoc Follow-Up ........................................................................................................................ 8

    Disclaimer and Liability Notice ............................................................................................................................ 9

  • 7/27/2019 lsmw idoc

    3/9

    Processing IDOC through LSMW

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

    2010 SAP AG 3

    Processing IDOC through LSMW

    The below steps explains on how to transfer data from legacy system to SAP via IDOC using LSMW tool.

    Step 1: Tcode: LSMW.

    Click on settings IDoc Inbound Processing.

    In the below screen maintain the File port (WE21), Partner Type (LS) and Partner Number (WE20).

    Design the Partner:a. Create custom basic type, message type using tcode WE30 and WE81 respectively.b. Link message type and basic type using tcode WE82.c. Create logical system using tcode BD54.d. Create an inbound function Module to link it to process code via We42.e. Maintain the function Module through BD51.f. Link the Basic Type, Message Type and function module using tcode WE57.g. Maintain partner profile in WE20 for partner RECEIVED.

    Create a project, sub project and object as shown tcode LSMW. Multiple process steps will now beavailable. Click on the first step and execute again. The first process step is Maintain Object Attributes.

    Step 2: Maintain Object Attributes

    Select the radio button IDoc and give the corresponding Message type and Basic Type.

    In this scenario, Basic Type: Y10_EMP_TABLE and Message Type: Y10_EMP_TABLE are created forthis purpose. Save and go back.

  • 7/27/2019 lsmw idoc

    4/9

    Processing IDOC through LSMW

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

    2010 SAP AG 4

    Step 3: Maintain Source Structures

    Create a source structure with any name as shown below by clicking on the Create button in applicationtoolbar. Save and Go back.

    Step 4: Maintain Source Fields

    Create an input structure. This structure should be same as the input file which has to be uploaded fromeither legacy or application. There are multiple ways to create a structure. Fields can be created one byone or all at a stretch by using the buttons Create Field orTable Maintenance respectively. Save andGo back.

  • 7/27/2019 lsmw idoc

    5/9

    Processing IDOC through LSMW

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

    2010 SAP AG 5

    Step 5: Maintain Structure Relations

    Maintain the structure relation by using the button Relationship in application toolbar.

    By default the structure relation exist between the IDoc segment and the source structure.

    Step 6: Maintain Field Mapping and Conversion Rules

    Link the source fields to IDoc segment fields by clicking on the button Source field in application toolbar.Save and go back.

    Step 7: Specify Files

    Specify the location of the input file.

    In this scenario, the input file is placed in the presentation server.

  • 7/27/2019 lsmw idoc

    6/9

    Processing IDOC through LSMW

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

    2010 SAP AG 6

    While specifying the file, specify the separator and other relevant parameters as required by clicking onCreate button in application toolbar.

    Step 8: Assign FilesAssign the input file to the source structure created by using the button Assignment .

    Save and go back.

    Step 9: Read and convert the data

    The below screen shot displays the number of records read from the input file.

  • 7/27/2019 lsmw idoc

    7/9

    Processing IDOC through LSMW

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

    2010 SAP AG 7

    The below screen shot shows the number of records converted to source structure format from the inputfile.

    Step 10: Start IDoc Generation

    The IDoc gets generated with the data available in the converted structure from the above step. Oncethe IDoc is generated, the below message is obtained.

    Step 11: Start IDoc Processing

    IDoc gets Processed in this step. The IDoc is processed based on the code written in the inboundfunction module.

    The first screen is displayed in the screen would be almost same as WE02/WE05.

    The Logical system (Partner) and partner type specified in step1 appears here.

    Execute it.

  • 7/27/2019 lsmw idoc

    8/9

    Processing IDOC through LSMW

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

    2010 SAP AG 8

    The Message above shows that the document is posted. Kindly check the relevant table for data update

    Step 12: Create IDoc Overview

    To have a look at the Control record, Data Record and Status Record execute this step. The screen obtainedin this step is same as WE02/WE05.

    Step 13: Start IDoc Follow-Up

    In case of any error/Warning use this step to reprocess or follow up.

    The above are the steps best describing to post IDoc using LSMW tool. Using this method, large volume ofdata can be posted to SAP.

  • 7/27/2019 lsmw idoc

    9/9

    Processing IDOC through LSMW

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com | UAC - uac.sap.com

    2010 SAP AG 9

    Disclaimer and Liability Notice

    This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is notsupported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

    SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,and anyone using these methods does so at his/her own risk.

    SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article orcode sample, including any liability resulting from incompatibility between the content within this document and the materials andservices offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of thisdocument.