Query on BAPI -LSMW

Hi All,
I have a requirement on LSMW,  Can any body send me step-by-step procedure
to create SD-pricing conditions by using BAPI in LSMW.
Thanks,
Naga

hi naga,
FOR BAPI/IDOC METHOD, WE NEED TO MAINTAIN IDOC INBOUND PROCESSING EXPLICITLY. IN THE INITIAL TRANSACTION OF LSMW, GO TO SETTINGS AND CLICK IDOC INBOUND PROCESSING. WE NEED TO PERFORM THE FOLLOWING STEPS.
     DEFINE OR SELECT A FILE PORT FOR TRANSPORTING THE FILE. OPTIONALLY, YOU CAN ALSO CREATE A TRFC PORT.
     THE PARTNER TYPE HAS TO BE DEFINED OR SELECTED.
     THE PARTNER NUMBER HAS TO BE DEFINED OR SELECTED.
     IDOC INBOUND PROCESSING MUST BE ACTIVATED AND THE WORKFLOW CUSTOMIZING MUST BE CHECKED. BOTH OF THESE TASKS ARE PERFORMED ONCE IN EACH SYSTEM.
EXPORTING AND IMPORTING
EXPORTING - IT IS A GOOD IDEA TO PERFORM THE MIGRATION FROM A LEGACY SYSTEM TO THE SAP SYSTEM IN A TEST SYSTEM FIRST. THIS FUNCTION IS USED TO TRANSFER THE FIELD ASSIGNMENTS DEVELOPED TO THE PRODUCTION SYSTEM.
IMPORTING - IMPORT THE MAPPING AND FIELD ASSIGNMENTS INTO A DIFFERENT SAP SYSTEM.
1) MAINTAINING OBJECT ATTRIBUTES
SPECIFY WHETHER THE DATA IS TO BE TRANSFERRED ONCE OR PERIODICALLY. AND THEN SPECIFY WHICH METHOD YOU GONNA USE FOR THE DATA TRANSFER.
2) MAINTAING SOURCE STRUCTURE
WE CAN CREATE SOURCE STRUCTURES EITHER AT THE SAME LEVEL OR AT THE LOWER LEVEL.
3) MAINTAINING SOURCE FIELDS
WE CAN DIRECTLY CREATE THE SOURCE FIELDS. OR WE CAN COPY THE FIELDS USING THE FOLLOWING METHODS.
     UPLOAD – TAB DELIMITED TEXT
     COPY FROM OTHER OBJECT
     COPY FROM DATA REPOSITORY – FROM A STRUCTURE OF ABAP DICTIONARY.
     FROM DATA FILE.
4) MAINTAING STRUCTURE RELATIONS
HERE WE ARE ESTABLISHING THE STRUCTURE RELATIONSHIPS BETWEEN THE PROJECT AND THE SAP SYSTEM.
5) MAINTAIN FIELD MAPPING AND CONVERSION RULES
HERE WE ARE MAINTAINING THE FILED RELATIONSHIP BETWEEN THE SOURCE AND TARGET STRUCTURE.
AUTO FIELD MAPPING
AUTO FIELD MAPPING IS USEFUL IN CASE IF FIELDS WITH IDENTICAL OR SIMILAR NAMES/DESCRIPTIONS EXIST IN THE SOURCE AND TARGET STRUCTURES. THIS IS PARTICULARLY THE CASE IF DATA IS TRANSFERRED FROM ONE SAP SYSTEM TO ANOTHER SAP SYSTEM.
CONVERSION RULES
THE DEFAULE CONVERSION RULE IS TRANSFER (MOVE).
INITIAL, CONSTANT, TRANSFER (MOVE), PREFIX, SUFFIX, CONCATENATION, TRANSFER LEFT- ALIGNED, ABAP CODE, X FIELD, MOVE WITH LEADING ZEROS, [(R) FIXED VALUE, TRANSLATION AND USER-DEFINED ROUTINE].
THERE IS A CHECKBOX ‘ONLY IF SOURCE FIELD NOT INITIAL’.
GLOBAL VARIABLES
WE CAN USE THESE GLOBAL VARIABLES IN ABAP CODE.
G_PROJECT     CURRENT PROJECT                     
G_SUBPROJ     CURRENT SUBPROJECT                 
G_OBJECT     CURRENT OBJECT                      
G_RECORD     CURRENT TARGET STRUCTURE                 
PROCESSING TIMES
__BEGIN_OF_PROCESSING__     BEFORE PROCESSING OF DATA IS STARTED.
__BEGIN_OF_RECORD__     BEFORE THE CONVERSION RULE FOR A SOURCE STRUCTURE IS APPLIED.
__END_OF_RECORD     AFTER THE CONVERSION RULE FOR A SOURCE STRUCTURE HAS BEEN APPLIED.
__END_OF_TRANSACTION__     AFTER PROCESSING OF THE TRANSACTION HAS BEEN COMPLETED.                       
__END_OF_PROCESSING__     AFTER PROCESSING OF DATA HAS BEEN COMPLETED.                       
__BEGIN_OF_TRANSACTION__     BEFORE PROCESSING OF DATA FOR A TRANSACTION IS STARTED                       
GLOBAL FUNCTIONS
TRANSFER_RECORD.     THE CURRENT RECORD (THAT IS, THE RECORD FOR THE CURRENT TARGET  STRUCTURE) IS TRANSFERRED TO THE OUTPUT BUFFER.
TRANSFER_THIS_RECORD '...'.     A RECORD OF A DIFFERENT TARGET STRUCTURE IS TRANSFERRED TO THE OUTPUT BUFFER. THE NAME OF THE TARGET STRUCTURE HAS TO BE SPECIFIED AS ARGUMENT BETWEEN QUOTATION MARKS.
AT_FIRST_TRANSFER_RECORD.     THE CURRENT RECORD IS TRANSFERRED TO THE OUTPUT BUFFER IF IT IS THE FIRST TRANSACTION INVOLVED.
ON_CHANGE_TRANSFER_RECORD.     THE CURRENT RECORD IS TRANSFERRED TO THE OUTPUT BUFFER IF IT HAS CHANGED AS COMPARED TO THE LAST RECORD.
TRANSFER_TRANSACTION.     THE CURRENT TRANSACTION IS WRITTEN TO THE OUTPUT FILE. THIS TRANSFERS ALL THE RECORDS OF THE OUTPUT BUFFER TO THE OUTPUT FILE.
SKIP_RECORD.     THE CURRENT RECORD IS NOT TRANSFERRED TO THE OUTPUT BUFFER.
SKIP_TRANSACTION.     THE CURRENT TRANSACTION IS NOT WRITTEN TO THE OUTPUT FILE.
6) MAINTAIN FIXED VALUES, TRANSALTIONS, USER-DEFINED ROUTINES
REUSABLE RULES ALLOW YOU TO DEFINE CONVERSION RULES THAT CAN BE USED SEVERAL TIMES.
7) SPECIFY FILES
WE CAN SPECIFY FILES IN PC OR IN APPLICATION SERVER. IN CASE YOUR DATA IS STORED IN MULTIPLE SETS OF FILES, YOU CAN SPECIFY A WILDCARD (*) FOR THE NAME OF YOUR FILE. A WILDCARD CAN BE USED EVERY TIME THE FILES FOR SEVERAL IMPORT RUNS COME FROM DIFFERENT FILES; WITH THE FILE NAME BEING DIFFERENT IS SOME CHARACTERS ONLY.
FOR READ DATA, THE FILE NAME IS IN THE FORMAT OF PROJECT_SBPROJ_OBJ.LSMW.READ
FOR CONVERTED DATA, THE FILE NAME IS IN THE FORMAT OF PROJECT_SBPROJ_OBJ.LSMW.CONV
8) ASSIGN FILES
ASSIGNS THE FILES ALREADY DEFINED TO THE SOURCE STRUCTURES.
CONVERSION PROGRAM - /1CADMC/SAP_LSMW_CONV_OBJN.
9) READ DATA
THE FILES MUST HAVE BEEN SPECIFIED BEFORE AND MADE KNOWN TO THE LSMW. IN THIS STEP, THE DATA IS READ INTO THE APPLICATION SERVER.
WE CAN READ THE SELECTED DATA BY GIVING TRANSACTION NUMBER.
10) CONVERT DATA
THE FILE OF READ DATA IS TRANSFERRED TO THE FILE OF CONVERTED DATA DURING MIGRATION.
WHEN THE LSMW OBJECT IS BASED ON A BAPI OR AN IDOC, ADDITIONAL SELECTION PARAMETERS ARE AVAILABLE ON THE SELECTION SCREEN OF THE DATA CONVERSION PROGRAM:
CREATE IDOCS DIRECTLY:     IDOCS ARE COLLECTED AND THEN PASSED FOR IDOC GENERATION PACKAGE BY PACKAGE.
NO. OF IDOCS PER PACKAGE:     THE DEFAULT IS 50 (THIS VALUE CAN BE CHANGED).
THE ABOVE MENTIONED STEPS ARE COMMON FOR ALL THE TYPES OF IMPORTING METHODS IN LSMW.
IN THE CASE OF STANDARD BATCH INPUT/ BATCH INPUT RECORDING, CREATING BATCH INPUT SESSION AND PROCESSING THAT.
IN THE CASE OF STANDARD DIRECT INPUT, START A DIRECT INPUT SESSION.
IN THE CASE OF BAPI/ IDOC,
     STARTING IDOC GENERATION
     STARTING IDOC PROCESSING
     CREATING AN IDOC OVERVIEW
     STARTING IDOC POSTPROCESSING
FOR DIRECT INPUT METHOD, WE CAN USE EITHER THE PROGRAM RMDATIND OR THE TRANSACTION BMV0.
STARTING IDOC GENERATION FIRST, THE FILE WITH THE CONVERTED DATA IS READ. THE PACKETS OF INFORMATION IN THIS FILE ARE THEN SAVED TO THE SAP DATABASE IN IDOC FORMAT, BUT NOT TO THE DATABASE OF THE CORRESPONDING APPLICATION. THE SYSTEM ASSIGNS A NUMBER TO EACH IDOC. THE FILE WITH THE CONVERTED DATA IS THEN DELETED.
STARTING IDOC PROCESSING THE IDOCS CREATED IN THE FIRST STEP ARE SENT TO THE ASSOCIATED APPLICATION PROGRAM. THIS APPLICATION PROGRAM CHECKS THE DATA AND UPDATES IT IN THE APPLICATION DATABASE, IF NECESSARY.
Pls reward if helpful.

Similar Messages

  • Query on Bapi

    HI
    This is the query on BAPi,I have got one FS on Enhancement.i.e EPOS Upload program,that means i have to upload the data from Excel sheet to sap by using BAPI.I have one BAPI Name also,i.e XBAPI_RE_CN_SALES_REP_REPORT.This was given from onsite,i am workig in offshore,Actually in the excel sheet the fields are comp code,contact number,sale type,report name ,report to,and sales netvolume.But in that BAPI i could not find all the parameters which are existing in the excel sheet.If we want to upload the data from excel sheet,we shud have the same fields in the BAPI na!! to pass from that fucntion module(BAPI).So please tell me the process and coding ,I know its very simple procedure.But I am unable to do it.Please help me out

    it is necessary to have fields...but there might be a  case where company code in BAPI will hold some other field, means it might not be company code but some other field and when executed it transfers data to company code field. also, XBAPI_RE_CN_SALES_REP_REPORT is not a BAPI...check it...

  • Querying a BAPI Function Module

    Is it possible to write a query on the BAPI Function Module. For example I have a views in oracle database and i can query the views based on some condition and get the required data from the views. In the same way is it possible to query the BAPI function module to get the data based on given condition

    Hi Nikki,
       You can use FM RFC_READ_TABLE to read data from any SAP table.
      Also check following post by Raja -
         RFC_READ_TABLE for SAP Web AS - Code Sample
    Cheers,
    Sanjeev

  • Difference between lsmw using BAPI & lsmw using IDOC?

    HI everybody
    can anybody tell me  difference between lsmw using BAPI & lsmw using IDOC?

    IDocs and BAPI are very different, so it should be easy to choose between them depending on your requirements.
    IDOCS
    Advantages
    System can work even if target system not always online. The IDoc will be created and sending will just continue once you get connected to the other system.
    No additional programming required. You just need to set up the configuration.
    Disadvantages
    Receipt/processing on the target system may not be immediate.
    The sending system has no way to know whether the target system actually received what you sent (unless you use ALE).
    If there is no SAP standard IDoc available for your requirement, it's harder to create a customized IDoc than a customized BAPI.
    BAPIS
    Advantages
    You can tell if your sending was successful or not
    Sending to/processing on the other side is immediate
    Easier to create your own BAPI than your own IDoc
    Disadvantages
    Will only work if you have an active online connection.
    Some programming required to call the BAPI.
    Others interface methods you might also want to consider are ALE and RFCs.

  • Query in BAPI.................Urgent

    Hi Friends,
      Here is my query in BAPI,
      I need a BAPI to upload asset information (which is currently held in Physical data) data  to SAP.
    Its very very urgent for me,plz help me on this.
    Thanks a lot in Advance.
    mrutyun^

    hi Mrutyunjaya,
    try using BAPI_FIXEDASSET_CREATE1.
    You will get lot of information about asset in business object ‘BUS1022’.
    regards,

  • BAPI / LSMW for Accounts Receivable open items and G/L  Accounts balance

    I want to transport legacy data to SAP.
    Please provide me with a BAPI or LSMW for creating entries for
    Accounts Receivable open items
    General Ledger Accounts balances

    Thomas,
    Program RFBIBL00 is traditionally used for converting FI transactions.  In LSMW, it's object 0100, sub object 0000.
    -nathan

  • Data tranfer using bapi(lsmw)

    please explain the steps that are used to upload legacy data into sap using lsmw (bapi method)
    Message was edited by:
            neela renganathan

    Hi,
      is step by step process .
    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 as prompted.
    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:
    Please Go through these Links ,
    BAPI with LSMW
    http://esnips.com/doc/ef04c89f-f3a2-473c-beee-6db5bb3dbb0e/LSMW-with-BAPI
    For document on using BAPI with LSMW, I suggest you to visit:
    http://www.****************/Tutorials/LSMW/BAPIinLSMW/BL1.htm
    http://myweb.dal.ca/hchinni/sap/lsmw_home.htm
    http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf
    Regards

  • Assign file creating problem in BAPI LSMW

    Hello Experts!
    Iu2019m trying to upload PO (Header/Item data) though BAPI Method. Iu2019ve one file having Header and Item data. At Assign Files Step when I try to assign file to PO Item Data. System gives me a message
    (File 'C:\MySAP\ABAP Programing\LSMW\PORec.txt'
    only be assigned to one source structure.)
    Looks like system is not letting me give the same file which Iu2019ve given to PO Header data. Can anybody please tell me how I can assign the same file for Header and Item data.
    Thanks.

    check this weblog by niamesh how to handle header and item in lsmw.
    LSMW with RFBIBL00

  • BAPI LSMW

    Why is BAPI method of LSMW considered the most reliable & fast of all methods . I would think the IDOC is most reliable because of the tracing features and Direct Input would be the fastest method

    BAPI is faster than any other method as they are integrated properly with the SAP tables and designed specially to fill them.
    In LSMW we create BDC to execute.
    Refer the links -
    scenarios of using direct input,batch input,,bapi,idoc methods in lsmw
    /message/3407272#3407272 [original link is broken]
    Regards,
    Amit
    Reward all helpful replies.

  • BAPI LSMW -  Partner Profile - VCHARVAL

    Hi,
    I´m trying to use a LSMW to load data to vendor characteristic, I´m using BAPI method with message type: VCHARVAL, but when I´m going to configure "Maintain Partner Numbers", I need to fit in the Inbound Parameters the field "Process Code", I already tried some values but it doesn´t work.
    Can someone tell me what the "process code" is necessary to put in that configuration?

    I created a LSMW project, using Business Object Method(BAPI), with Business Object: LFA1, Method: SAVECHARVALUEREPLICAS, Message Type: VCHARVAL and Basic Type: VCHARVAL01, to load data into vendor characteristic values.
    When I try to Start IDoc Processing I receive an error: "Function module not allowed: IDOC_INPUT_CHRMAS", I know that error is about the configuration of IDoc Inbound Processing, but I don´t know how configurate in the partner profiles, the Inbound parameters to the message type VCHARVAL.

  • Query related to LSMW

    I am using lsmw for recording transaction pa30 .In LSMW when I click on MAINTAN FIELD MAPPING & CONVERSION RULE (step 5)
    the screen shows  fields ,under that tabname   and tcode .
    nowhere i can  find the actual field names which i had recorded using batch i/p recording using step1.
    actual field name is required for mapping  corresponding field with source fields.
    how should i proceed ???

    Hi,
    Place the Cursor on the field and then press the MAP button then the Recorded structure will open then select the desired field to map and [place the cursor on that field and select ok, then the fields will be mapped with MOVE statment.
    if the Source fields and the Recoring structure fields names are same then you can directly MAP in a Single shot, you will have a Icon there to MAP in single shot, press that one
    Regards
    Ashok Reddy

  • BEx Query and BAPI RSR_OLAP_BADI

    Implemented the badi so that Virtual Key Figure could be populated.  (Cube does not have std cost, so it's defined as VKF.  Std cost resides in custom table.  By providing Material number from query it could be retrieved thru BADI.)
    Unfortunately, cube is cumulative, thus in badi I need to pass 'I_NCUM' as 'X'.  I am unable to do so, as parameter I_NCUM is not changeable.  I may have to implement it differently.  Do not know how.  Any help would be appreciated.
    Thank you

    Hi,
       You could use a formula variable directly in the query. Create it of type customer exit and then code it to retrieve the standard cost.
    Regards.

  • Query Regarding BAPI

    Hi All,
    I have a requirement where-in I would need to change the Expiration Date of a Credit Card.
    Is there any FM or BAPI through which i can have my requirement achieved?
    If not, then i guess i would need to create a Custom BAPI i.e. "Z" BAPI.
    Thanks in Advance,
    Rajesh

    I don't think there is a standard BAPI available to do that.
    Regards,
    Ravi
    Note :Please mark all the helpful answers

  • BAPI/LSMW/BDC/ALE-Idoc-Best One

    Hi Folks,
    What would be the best method to migrate master and transactional data.(One time upload).
    I am suggesting BAPI as we have internal thirdparty RFC calls while creating masterdata.(I guess we wouldnot get this RFC calls in recording).
    I gone through the forum but i didnot get convincing answer.
    Please help me in deciding.........
    Thanks,
    Krishna.

    Hi
    I am suggesting BAPI as we have internal thirdparty RFC calls while creating masterdata.(I guess we wouldnot get this RFC calls in recording).
    As BAPI's are Remote Enabled Function Module. I think in your scenario BAPI's should work well for you.
    Regards,
    Vishwa.

  • Query in BAPI BAPI_GOODSMVT_CREATE

    Hi,
    I am usnig a BAPI BAPI_GOODSMVT_CREATE for creating good movement. I am succefully able to update the document flow. But when i try to delete the material through MIGO then not able to update the document flow.
    If the goods movement is created through standard then i am successfully able to delete the material document and document flow is updated successfully.
    I am passing the following parameters in the BAPI.
    At Item Level:      gs_item-move_type = '101'.
          gs_item-mvt_ind   = 'B'.
          gs_item-po_number
          gs_item-po_item 
          gs_item-deliv_numb_to_search
          gs_item-deliv_item_to_search
          gs_item-deliv_numb
          gs_item-deliv_item
          gs_item-entry_qnt
          gs_item-entry_uom
          gs_item-stge_loc 
    At Header Level:
      gs_header-pstng_date = p_bldat.
      gs_header-doc_date = sy-datum.
      gs_code-gm_code = '01'.
    Please suggest if i am getting wrong or have to pass some other parameters at header or item level so that when user delete the record through MIGO then also document flow will occur.
    I have searched on SDN a lot for this but just found how to update document flow while creating... not while deleting through MIGO.
    Regards,
    Pankaj Aggarwal

    Hi,
    please suggest how can i achieve..

Maybe you are looking for