LSMW : BAPI vs IDOC

hi xperts
In LSMW, given the choices between Idoc and BAPI,which processing method is good and why? And when to opt one of the methods?
thkx
Prabhu

Hi
See the links
http://esnips.com/doc/1cd73c19-4263-42a4-9d6f-ac5487b0ebcb/LSMW-with-Idocs.ppt
http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI.ppt
Step-by-Step Guide for using BAPI in LSMW
Note! The screen prints in this article are from ECC 5.0. They may differ slightly in other versions.
Introduction:
This document details the usage of BAPI in LSMW. We have used the example of migration of the purchase order data into SAP.
Pre-requisites:
It is assumed that the reader of this article has the minimum knowledge required on the Business Object, BAPI, Message Types and IDoc Types.
Step-by-Step Procedure:
Details of the BAPI used in this scenario:
Business Object: BUS2012
Method: CreateFromData
Details of Message Type and Basic IDoc Type:
Message Type: PORDCR
Basic IDoc Type: PORDCR02
Let’s have a look at the BAPI first, before proceeding to the LSMW:
1. Go to Transaction BAPI
2. Click on Search Button
3. Enter the value “BUS2012” and select “Obj.type(Technical Object Name”
4. Press ENTER
5. Following screen appears:
6. On the left side of the screen, Expand the “PurchaseOrder”.
7. Select “PurchaseOrder” and double-click on the same for details.
Building LSMW using BAPI:
1. Go to Transaction LSMW.
2. Enter the Project, Subproject and Object information and click on CREATE.
3. Enter the descriptions for Project, Subproject and Object.
4. Now select Settings à IDoc Inbound Processing
5. “IDoc Inbound Processing” screen appears. Enter the required details as shown below:
6. Click on “Activate IDoc Inbound Processing”.
7. Click on “Yes” when prompted for “Activate IDoc Inbound?”
8. Hit on “Back” to return to the main screen.
9. Click on Continue (F8). Following Screen appears:
10. Select the Step 1 “Maintain Object Attributes” and select “Execute”.
11. Select the radio button “Business Object Method” and enter the following details:
Business Object: BUS2012
Method: CreateFromData
Hit ENTER
12. Save and click on BACK button. Following information message is displayed.
13. Now select step 2 “Maintain Source Structures” and click “Execute”.
14. In this step, we need to maintain the source structure. In our example, lets consider the example of a file with 2 structures Head and Item data as shown below:
Click on Create and name the source structure as HEADERDATA. Now select HEADERDATA and click on “Create” again to create the child structure. Following popup appears:
Select “Lower Level” and click on Continue. Enter the Item data structure name.
Click Save and hit BACK button to go to the main screen.
15. Select step 3 “Maintain Source Fields” and hit execute.
16. Enter the fields as shown below:
17. Click SAVE and return to main screen.
18. Select step 4 “Maintain Structure Relations” and click Execute.
Select E1PORDCR and click on CREATE RelationShip. Following screen appears:
Select HEADERDATA and hit ENTER
Similarly do the same for the structure E1BPEKKOA, E1BPEKPOC and E1BPPEKET.
Click Save and return to main screen.
19. Select the step “Maintain Field Mapping and Conversion Rules” and click on execute. Maintain the Field Mapping as seen below:
20. Select step 7 “Maintain Source Files” and provide the link for the test file created. (Create a test file with the same structure as defined earlier).
Save and return to main screen.
21. Select the step “Assign Files” and click on Execute.
Assign the file provided to the source structure. Here the same file is provided for both the structures.
Save and return to the main screen.
22. Select the step “Read Data” and click on Execute.
Click on Execute.
Return to the main screen.
23. Select the step “Display read data” and click on execute.
Click on the structure name to get the field level values.
24. Return to main screen and now select “Convert Data”.
25. Return to the main screen and select “Display Converted data”.
26. Return to main screen and select “Start IDoc generation”.
27. Now select the step “Start IDoc Processing” on the main screen.
28. Return to main screen and click on “Create IDoc overview”. Here the data record and status records of the IDoc could be viewed
It is given in screen shot.
http://www.****************
Regards,
Padmam.

Similar Messages

  • Non English characters conversion issue in LSMW BAPI Inbound IDOCs

    Hi Experts,
    We have some fields in customer master LSMW data load program which can
    contain non-English characters. We are facing issues in LSMW BAPI
    method with non-English characters Conversion. LMSW steps read and
    conversion are showing the non-English characters properly with out any
    issue. While creating inbound IDOCs most of the non-English characters
    replaced with '#' and its causing issues in creating customer master data in
    system. In our scenario customer data with non-English characters in
    the first name, last name and address details. Any specific setting
    needs to be done from our side? Please suggest me to resolve this issue.
    Thanks
    Rajesh Yadla

    If your language is a unicode tehn you need to change the options  like IN SAP you need to change it to unicode  in the initial screen Customize local layout(ALT F12) options 118  --> Encoding ....

  • Retail Site and LSMW(BAPI or IDOC)

    Hello,
    I'm trying to upload retail site through LSMW but I can't find a method to do so. Online we use TCode WB01 to create a retail site and I don't want to create a BDC for it since it uses multiple screens. Does anyone know a method to do so? Thanks in advance!
    Arash

    if you know lsmw mwthod then you can upload site data.
    but the question is why do u want upload site with lsmw.
    site is a very imp master data in retail. so it will be good if you enter all these by using t-code wb01 manually.
    regards
    santosh jaiswal

  • Sales Order Creation using LSMW-BAPI.

    Hai,
         While executing a 14th step in LSMW-BAPI,the IDOC is generated.While Testing the IDoc the values for the Header segment alone is displayed.The Segment sfor Item is not Displayed.Should there be any link between Header & the ITem.
    Regards,
    Padmam.

    Hi,
    Can u tell me the steps to create a sales order using idoc, i've created a bapi but thats a temprory use. I wanted to created a sales order automatically when a purchase order is saved.
    Please let me know if u can help me, i wanted to do it using idoc
    Regards
    Sanju

  • In LSMW, what is diff between LSMW-BAPI and LSMW-IDOC

    hello all
    In LSMW, what is diff between LSMW-BAPI and LSMW-IDOC

    Hi Swamy,
    The differences between IDoc and BAPI are as follows: 
    IDOC
    IDocs are text encoded documents with a rigid structure that are used to exchange data between R/3 and a foreign system.
    Idocs are processed asynchronously and no information whatsoever is returned to the client.
    The target system need not be always online. The IDOC would be created and would send the IDOC once the target system is available (tRFC concept). Hence supports guaranteed delivery.
    With asynchronous links the sub-process on the client can be finished even if the communication line or the server is not available. In this case the message is stored in the database and the communication can be done later.
    The disadvantage of asynchronous links is that the sub-process on the server cannot return information to the calling sub-process on the client. A special way for sending information back to the client is required. In addition, a special error handling mechanism is required to handle errors on the receiving side.
    IDOCs may be more changeable from release to release.
    IDOCs  are poorly documented.
    BAPI
    BAPIs are a subset of the RFC-enabled function modules, especially designed as Application Programming Interface (API) to the SAP business object, or in other words: are function modules officially released by SAP to be called from external programs.
    BAPIs are called synchronously and (usually) return information.
    For BAPIs the client code needs to do the appropriate error handling.
    Problems with synchronous links occur if the communication line or the server is temporarily not available. If this happens, the sub-process on the client cannot be finished (otherwise there would be data inconsistencies).
    Synchronous links have the advantage that the sub-process on the server can return values to the sub-process on the client that has started the link.
    BAPIs are not totally immune to upgrades.
    BAPIs are reasonably well documented.
    Reward points if useful.
    Best Regards,
    Sekhar

  • LSMW Methods - BAPI and IDOC - why used together?

    Hi,
    There are four mathods available in LSMW:
    - Direct Input
    - BAPI
    - IDOC
    - BDC
    Among these BAPI and IDOC always go hand in hand. In case we choose to go in for IDOC, we will have to enter the partner profile settings for an inbound IDOC. But in case we choose to go with th BAPI method, even then we have to mention the inbound IDOC settings.
    I would like to know why is this so; if there is a provision for two separate methods, why do we need to use IDOC if a BAPI is selected.
    Please advise.
    Regards,
    Namrata

    In LSMW, BAPI method by default uses iDoc as a medium exchange in order to be passed as parameters to it. Actually, a text file is created when you convert the data with iDoc format. From there, you have two options: Either go on with LSMW steps (create idocs from text file, then run idoc transactions) OR go on with SXDA workbench (create a project there and run a job which essentially calls the BAPI).
    There are two different methods because SAP developed them at different times. First, they had the ALE layer (as middleware for SAP to SAP/non-SAP communication) that uses the idoc as medium exchange, then at a later time BAPIs were developed as RFC function modules/object methods. Since idoc were already in place, they used that as medium exchange for BAPIs, too.
    I hope that is clearer now.

  • Screen shots of lsmw using bapi and idoc.

    hi
    can anybody plz send me the step by step lsmw procedure using
    bapi and idoc screen shots.
    regards
    vijay

    Refer this link... it has step by step procedure with screen shots....
    http://www.****************/Tutorials/LSMW/LSMWMainPage.htm
    Regards,
    Pavan

  • LSMW  bapi idocs

    Hello evryone,
    I am trying to make a lsmw using BAPI with IDoc inbound processing,
    But at the time of step Start IDoc Processing
    status is 51----  Application Document is not posted
    and reason is----  No Master Record Exist for Vendor 10001
    could anyone  please explain me  the reasons for this
    Thanx in advance
    Jeet Chauhan
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on May 3, 2011 2:44 PM

    Hello evryone,
    I am trying to make a lsmw using BAPI with IDoc inbound processing,
    But at the time of step Start IDoc Processing
    status is 51----  Application Document is not posted
    and reason is----  No Master Record Exist for Vendor 10001
    could anyone  please explain me  the reasons for this
    Thanx in advance
    Jeet Chauhan
    Moderator message: duplicate post locked.
    Edited by: Thomas Zloch on May 3, 2011 2:44 PM

  • Unable to create PO with multiple line items through LSMW-BAPI method

    Hi All,
    I have a requirement of creating PO through LSMW. I can't use LSMW standard batch input program since there are some fileds not available and also it has many limitations. I'm using LSMW-BAPI method ( Business object BUS2012) which create IDOC and uses BAPI_PO_CREATE1 to ultimately post the PO in the system. I am trying to create PO from a single file which contains both Header and Item data.
    Now my problem is that everytime PO is being created with Single line item only. Everytime I am giving multiple item data in the source file LSMW is preparing multiple IDOCs for multiple line items. As per my understanding this is happenng since header and item is in the same hierarchy level of IDOC type PORDCR102 and the control record is inserted for every line item in the source file.
    It seems that through LSMW-BAPI  it is not possible to create PO with multiple line items. Can anybody provide some input regarding this? Thanks in advance.
    BR,
    Atanu Mukherjee

    Solved by myself.
    Earlier the problem was that LSMW was not being able to recognize items under same header. It was creating new IDOCs every time it gets a new item. To enable this we need to create two structure HEADERDATA and ITEMDATA.  Two additional identifier fields with identifier value 'H' and 'I' should be added in these two structures respectively. Then we need one sequential file with the identifiers field followed by the header and Item data. Example:
    H~header data
    I~item data
    I~item data 
    This would help the standard program to understand what are the items under same header and ultimately create PO with multiple line items.
    BR,
    Atanu Mukherjee

  • Handling unit creation in existing shipment via BAPI or IDOC

    Dear all,
    Dose any one tried and succeed packing deliveries items in an existing shipment in the shipment level via BAPI or IDOC.
    I tried to use IDOC massage type SHPADV. The problem was that it's creates a new shipment with the same deliveries and pack their items, although I entered the existing shipment number.
    With regards to "BAPI_SHIPMENT_CHANGE", it is seems like this BAPI is not an option. It is update the shipment in any shipment field but not creating HU in shipment level.
    Dose there any solution via those options or there is any other solution.
    Thanks in advance,
    Itai

    I tried simulating this LSMW (message type-  PREQCR1, Baisc type -PREQCR101) and it is working fine. I used creation indicator = R in item segment - E1BPMEREQITEM and have not updated value for this field in Header. So try without any value for CREATE_IND in HEADER and just pass R in item.
    yogesh

  • How to use LSMW using the IDOC to upload and maintain cost center group

    Hi Everyone,
    Is there anyone who knows how to use LSMW using the IDOC functions instead of the recording. I wanted to upload the alternative cost center group I created in the system. 
    reply would be greatly appreciated
    Warm Regards

    Hi Praveen,
    There is a risk trying to migrate data directly into standard tables because this can generate database inconsistences or wrong inserted data according to what is customized in the target system. I do not recommend migrate like this. 
    With LSMW you use objects like direct input programs, idocs, bapis and recorded batch input. Try to create a project and use an standard object for your data. Also, check in SXDA transaction (Goto-->DX programs) if there is a standard program for your data.
    Anyway, if you want to upload data directly to tables, read below thread:
    ["UPLOAD  CSV  FILE";
    [how to upload .csv file into a custom table;
    Regards,
    Roger

  • GL Balance upload using LSMW (BAPI bus6035)

    Hello everyone,
    We are uploading GL balances from legacy to SAP using the LSMW Bapi
    object - bus6035
    method - post
    message type - ACC_DOCUMENT
    Basic type - ACC_DOCUMENT03
    When we run the lsmw, idoc is created, however with an error 51 saying
    "Function module not allowed - APPL_IDOC_INPUT1'
    The partner no. is the logical system (the system on which the lsmw is executed)
    In the partner profile, we have defined this as LS. In the inbound parameters, we have defined message type = ACC_DOCUMENT, the process code is APL1 and the corresponding function module is - APPL_IDOC_INPUT1
    Please let me know if we are missing something or doing anything wrong ?
    Since the data in the LSMW will be read frmo a file on the presentation server, do we need to have a port configuration for the same ?
    Thanks,
    Sushil Joshi

    Hi Sameer,
    Have a look at these threads, they might help you
    Chart of Accounts Upload
    Problem: LSMW with transaction FS00 create account (BI is not generated)
    Thanks
    Janani
    award points if helpful

  • LSMW-BAPI Sales order creation

    Hi All,
    I was trying to create sales order through the LSMW BAPI method.
    For the first line item i'm getting the correct quantity that i''m passing.
    But from second line item onwards quantity field is appearing as 0 (zero) even though i pass the different quantity values.
    i'm assiging the quantity to the REQ_QTY field in the schedule line items structure.
    Please suggest any solution for this.
    Thanking you.
    with regards,
    Bharath

    Hi,
    Can u tell me the steps to create a sales order using idoc, i've created a bapi but thats a temprory use. I wanted to created a sales order automatically when a purchase order is saved.
    Please let me know if u can help me, i wanted to do it using idoc
    Regards
    Sanju

  • Bapi or IDOC  which create material master in ECC

    Hi Guys,
    Can any one let me to know by which function modules or Bapi or IDOC available to create material master in ECC?
    Regards,
    Veera

    hi,
    there are lot many ways of creating Mat master.
    1: you can go for idocs: /CWM/MATMAS_BAPI, /SAPSLL/MATMAS_SLL, ARTMAS, MATMAS..
    2: you can use LSMW batch method:
    Object               0020   Material master
    Method               0000
    Program Name         RMDATIND
    Program Type         D   Direct Input
    3: you can use BAPI as suggested above:
    Business Object      BUS1001006   Standard material
    Method               SAVEDATA                    Create and change materia
    Message Type         MATMAS_BAPI                 Create and change materia
    Basic Type           MATMAS_BAPI03               Create and Change Materia
    ags.

  • Require the Standard BAPI or IDOC

    Hi all
    I am using LSMW for Packing Instruction Determination (T-code POF1).
    Is there any Standard BAPI or IDOC available in LSMW for data transformation for Packing Instruction Determination. If it is available please share.
    regards,
    Aboli

    Hi All,
    Creating an idoc via WE19 concerning /ISDFPS/PACKVOR, I still get the error message "The target quantity must be 1 for the load carrier item" when processing it.
    But my target quantity for my load carrier item is already 1.
    I tried several formats such as leading zeros, but nothing would pass this message...
    Any idea?
    Mike

Maybe you are looking for

  • Inserting a clip at the beginning of a edited string of clips?

    I have five clips edited together. I need to put one more clip at the beginning of the string. Is there a way to move an entire string of clips forward all at once so that I can slip the clip in? Hope this makes sense?

  • PDF Generator - Error Occerued During Native App Invocation

    ALC-PDG-016-004-Error occurred during native application invocation I receive this error message when trying to convert a DOC to a PDF. At first I was trying to do this as part of a workflow, but then determined that the issue is bigger. I get the ex

  • Can I install two versions of SOA suite using same Oracle database

    Condition: I installed Weblogic server(10.3.5) and SOA Suite(11.1.1.5), and I used RCU 11.1.1.5 to create the schemas(Oracle DB 11g-111170) for it. Plan: Now I plan to install another Weblogic server(10.3.6) and SOA Suite (11.1.1.6) and I will used R

  • Cannot open .project file

    b I have a Turnkey installation of ES 801. It is running in a VM. When I login to Workbench, the eclipse log records this exception (only the first few lines are listed, followed by the 'Caused by' line is listed below): !ENTRY com.adobe.ide.singlesi

  • Getting a Filename

    I have a task to do with Indesign XML workflow. Is there any option for getting a file name to a variable in the corresponding folder for example: "test.xml" the filename "test" needs to be saved in a variable, i.e., any xml file which i placed in th