LSMW/ BAPI method for Document upload (CV01N)

Hi All,
Could you please let me know if it is possible to use LSMW (BAPI method) for creation of document ?(using CV01N) and linking files.
If yes, what is the business object for doing the same?
I did came across a BAPI "BAPI_DOCUMENT_CREATE2", but in order to use it for mass upload , we will have to develop a program. SO I was trying to see of the LSMW method could be used.
Thanks and Regards,
Narendra

Hi Narendra,
LSMW is not supporting for attachements. Please check and confirm. If you have to upload bulk files then use BDC(Batch data collection) it's very useful for uploading thousands documents at a time. Ask abap'r to write a bdc program.
I hope this will resolve the query.
Regards,
Ravindra

Similar Messages

  • LSMW using BAPI method for ME21N

    Hi to all,
    I am using LSMW BAPI method for the transaction ME21N Iam able to post a PO document successfully, But in my flat file I have a header and followed by item in the same line, while I was posting with same header for different line items its posting different PO's for different  line items but suppose it has to post one document with multiple items.
    My flat file fields are like this : (where as ABCD my header and rest are line items) I am using only one structure 'podata' in LSMW and I am not using any identifier.
    header--Line items
    A B C D S P Q W E X
    A B C D 1 D 3  F K L
    Business Object -     BUS2012     
    Method                -    CREATEFROMDATA1
    Message Type    -    PORDCR1
    Basic Type         -     PORDCR101
    As per my requirement if I have multiple line items for the same header then only one PO should be posted.
    Could you suggest me, How can I achieve this.
    Thanks,
    Lahari

    Hi Jurgen,
    Thanks for your reply.
    As poer your suggestion, I passed my flat file data into a single file and in the begin of transaction, I divided the data into 2 structures as Header & Item.
    Still I am unable to achieve the desired results, can you please elaborate more on how SAP internally joins the structures again.
    To be more clear my flat file data look like this :
    217836     NB     1826162667     0127     00   1     LEAN SIX SIGMA PRIMER     MRO     Z     4.00     EA     60.00     1     EA     
    217836     NB     1826162667     0127     00     2     LEAN SIX SIGMA PRIMER     MRO     Z     4.00     EA     860.00     1     EA     
    217836     NB     1826162668     0127     00     1     LEAN SIX SIGMA PRIMER     MRO     Z     4.00     EA     160.00     1     EA
    217836     NB     1826162668     0127     00     2     LEAN SIX SIGMA PRIMER     MRO     Z     4.00     EA     560.00     1     EA     
    The bold ones being header and the remaining Items, the underlined field is PO number.
    In normal process this file is considered to have 4 records, and tries to create 4 PO's.But my requirement is to create only 2 PO's with 2 items each.
    Thanks.
    Lahari

  • LSMW -BAPI method

    hi frndz..
    I am trying LSMW - BAPI method for PO creation.
    in have done 7 steps upto "assign file"
    But system is not reading line item data.
    it is reading header data only...
    I want to knw, what should i have in my file, that system will read both data's.
    or provide the file contents.
    njoy SAP..
    njoy Lyf..
    Regards,
    Amit P Hiran

    Check these LSMW links, you might get what you are looking for
    http://www.sap123.com/showthread.php?t=98
    http://help.sap.com/saphelp_erp2004/helpdata/en/7f/b6f45805b111d2b41c006094b944c8/content.htm
    http://www.mydatabus.com/visitor.php?pt=downloadFile&tc=6289701541332&cl=53&cn=000003&uid=6659
    http://www.erpgenie.com/sap/saptech/lsmw.htm
    /people/hema.rao/blog/2006/09/14/lsmw--step-by-step
    http://www.sap-img.com/sap-data-migration.htm
    http://www.erpgenie.com/sap/saptech/lsmw.htm
    http://www.allsaplinks.com/lsmw.html
    http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc

  • Netprice Picked up from last document-Open PO load using LSMW BAPI method.

    Hi Experts,
    I m doing Open PO load using LSMW BAPI method...(BAPI_PO_CREAT1).
    Inside the LSMW BAPI picks up the NETPR value from the last document and doesnt consider the value from load file...
    Please advice me how to handle this issue...
    I tried giving values to field CALCTYPE at item level or POCOND table with with carry out new pricing options....but nothig works for me...
    PLease give your valuable inputs to achieve the requirement....
    Bharathi.J

    read OSS Note 580225 - Purchasing BAPIs: Conditions and pricing

  • 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

  • Passing Multiple Tax classification in LSMW BAPI method

    Dear All,
    Iam using LSMW BAPI method to create and change material master. I need to pass multiple tax classification values for a single material. How can I do this. The structure used in the BAPI for passing the tax classification data is MLAN. How can I create multiple numbers of this structure. Can anybody help me please.
    Thanks in advance
    Prathib

    do you have this multiple records already in the source? Or not at all in the source?
    background for tax classification
    There is customizing to assign plants to sales organization.
    Each plant has an adress with a country.
    SAP collects all the plant countries and saves them in the tax classification table MLAN.
    Eg. if this material A has a sales org EAST that can sell from plants in JP, AU, and SG
    then you will see these 3 countries in the sales org view segment tax classification
    In case you dont have any tax classification data in the source, then it you can do it like this:
    goto the __END_OF_RECORD__  statement of  E1BP_MLAN segment in your LSMW and enter it directly as code:
    do the transfer_record as often as you need .
    DEPCOUNTRY = 'JP'
    TAX_TYPE_1 = 'MWST'
    TAXCLASS_1 = '1'
    transfer_record.
    DEPCOUNTRY = 'AU'
    TAX_TYPE_1 = 'MWST'
    TAXCLASS_1 = '1'
    transfer_record.
    DEPCOUNTRY = 'SG'
    TAX_TYPE_1 = 'MWST'
    TAXCLASS_1 = '1'
    transfer_record.

  • How to add Text fields while doing SO through LSMW-BAPI method

    Hi Friends,
    I am doing Sales Order data migration using LSMW-BAPI method. The BAPI that i'm using is SALESORDER_CREATEFROMDAT2
    I am able to handle all the fields except for the text fields such "Material sales text"  in the Item info and "Layoout Set Header Text" in the Header.
    Please do help me in solving my problem in whatever possible way you can.
    I am waiting for your reply.
    Thanks in advance,
    ur friend

    Dear Gaurav Anand,
    Thanks a lot.
    Can you please be a more descriptive.
    I am unable to handle the E1BPSDTEXT structure.
    When I am giving the Text field, and the corresponding TEXT_ID , It is showing an error that the address is not handled properly.
    Please explain me how to handle this error.
    Once again Thanks in advance.
    Warm regards,
    Your friend

  • Error while creating the ASSET using LSMW BAPI method ( BUS1022 )

    Hello,
    Im creating assets using the below LSMW BAPI method
    Business Object      BUS1022     
    Method                     CREATEINCLVALUES
    Message Type         FIXEDASSET_CREATEINCLVALU
    Basic Type              FIXEDASSET_CREATEINCLVALU
    the following errors were triggered while populating the values to ACQ_VALUE and ORD_DEP value.
    Correction to ordinary dep. greater than acc. dep. in area 01
    Correction to ordinary dep. greater than acc. dep. in area 30
    Correction to ordinary dep. greater than acc. dep. in area 31
    Correction to ordinary dep. greater than acc. dep. in area 32
    if i pass only ACQ_VALUE, I am able to create the asset with out any issues.
    Can you guys plz guide me to fix this issue to create the asset with both ACQ_VALUE and ORD_DEP values??
    Cheers,
    Sriram.

    Hello,
    Review AO21.
    Regards
    Waza

  • While doing LSMW standard method for Customer master creation..

    while doing LSMW standard method for Customer master creation.....
    In 13th step I am getting this king of error
    FB012                    Session 1 : Special character for 'empty field' is /
    FB007                    Session 1 session name ZPROJ was opened
    FB109                    Trans. 1 : Transaction xd01 is not supported
    FB016                    ... Last header record ...
    FB014                    ... BKN00-STYPE 1
    FB014                    ... BKN00-TCODE xd01
    FB014                    ... BKN00-KUNNR
    FB014                    ... BKN00-BUKRS
    FB014                    ... BKN00-VKORG A1
    FB014                    ... BKN00-VTWEG 00
    FB014                    ... BKN00-SPART 0
    FB014                    ... BKN00-KTOKD
    FB014                    ... BKN00-KKBER BP01
    FB013                    ....Editing was terminated
    Can anyone help how to solve this?

    Hello TJK,
    <b>FB012 Session 1 : Special character for 'empty field' is /</b>
    This is the special function in LSMW, for empty field system will put / sign automatically, so you need not to worry about that.
    <b>FB007 Session 1 session name ZPROJ was opened</b> It is opening session ZPROJ which is your project name/object name.
    <b>FB109 Trans. 1 : Transaction xd01 is not supported</b>
    Check out your field mapping and conversion rule for object.
    <b>FB013 ....Editing was terminated</b>
    It is not finding proper field mapping rule / file inputs so the sytem terminates the LSMW object.
    Check your field mapping and conversion rule, check your source fields, save the file in tab delimited format.
    Hope this helps.
    Regards
    Arif Mansuri

  • Multiple files in LSMW-BAPI method

    Hi,
    I am facing the following problem with the LSMW-BAPI method...
    I got around 20,000 record to be posted....and my LSMW-BAPI method is taking 4 hours to load them..so how can i reduce my time...??? is there any change of loading multiple same structure file...??? or can we run our LSMW background...
    Thanks !!

    hi
    just refer to the links,. hope they may help u some or the other way.
    BAPI
    http://help.sap.com/saphelp_46c/helpdata/en/9b/417f07ee2211d1ad14080009b0fb56/frameset.htm
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    http://www.sapgenie.com/abap/bapi/example.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf
    http://www.sapmaterial.com/?gclid=CN322K28t4sCFQ-WbgodSGbK2g      <b>(SAP link- ultimate material )</b>
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • Hello !  pls give some ti[ps how to use bapi's for data uploading?

    hello !
      pls give some ti[ps how to use bapi's for data uploading?
    regards,
    Arjun

    Hi,
    See the below report extract:
    where it_data is having uploaded data.
    LOOP AT<b> it_data</b> INTO wa_data.
        line_count = sy-tabix.
        "Date Validation
        CONCATENATE wa_data-uplft_date4(4) wa_data-uplft_date2(2) wa_data-uplft_date+0(2)
        INTO wa_data-uplft_date.
        "READ TABLE it_ekko INTO wa_ekko WITH KEY lifnr = wa_data-vendor.
        LOOP AT it_ekko_temp INTO wa_ekko_temp WHERE lifnr = wa_data-vendor.
          IF wa_ekko_temp-kdatb <= wa_data-uplft_date AND wa_ekko_temp-kdate >= wa_data-uplft_date.
            MOVE-CORRESPONDING wa_ekko_temp TO wa_ekko.
            APPEND wa_ekko TO it_ekko.
          ENDIF.
        ENDLOOP.
        "IF sy-subrc = 0 AND wa_ekko-kdatb <= wa_data-uplft_date AND wa_ekko-kdate >= wa_data-uplft_date.
        LOOP AT it_ekko INTO wa_ekko.
          wa_data_header-pstng_date = wa_data-uplft_date.
          wa_data_header-doc_date = sy-datum.
          wa_data_header-bill_of_lading = wa_data-bill_of_lad.
          wa_data_header-ref_doc_no = wa_data-del_no.
          CONCATENATE wa_data-header_text1 '-'
                      wa_data-header_text2 '-'
                      wa_data-header_text3 '-'
                      wa_data-header_text4
                      into wa_data_header-HEADER_TXT.
          IF wa_data-indicator = 'Y'.
            wa_data_item-material = '000000000000200568'.
          ELSE.
            wa_data_item-material = '000000000000200566'.
          ENDIF.
          LOOP AT it_ekpo INTO wa_ekpo WHERE ebeln = wa_ekko-ebeln AND matnr = wa_data_item-material.
            "Collect Item Level Data
            wa_data_item-plant = '1000'.
            wa_data_item-stge_loc = '1001'.
            wa_data_item-move_type = '101'.
            wa_data_item-vendor = wa_data-vendor.
            wa_data-qnty = wa_data-qnty / 1000.
            wa_data_item-entry_qnt = wa_data-qnty.
            wa_data_item-po_pr_qnt = wa_data-qnty.
            wa_data_item-entry_uom = 'KL'.
            wa_data_item-entry_uom_iso = 'KL'.
            wa_data_item-orderpr_un = 'KL'.
            wa_data_item-orderpr_un_iso = 'KL'.
            wa_data_item-no_more_gr = 'X'.
            wa_data_item-po_number = wa_ekpo-ebeln.
            wa_data_item-po_item = wa_ekpo-ebelp.
            wa_data_item-unload_pt = wa_data-unload_pt.
            wa_data_item-mvt_ind = 'B'.
            APPEND wa_data_item TO it_data_item.
            CLEAR wa_data_item.
          ENDLOOP.
          CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
            EXPORTING
              goodsmvt_header = wa_data_header
              goodsmvt_code   = goodsmvt_code
              testrun         = 'X'
            TABLES
              goodsmvt_item   = it_data_item
              return          = return.
          READ TABLE return INTO wa_return WITH KEY type = 'S'.
          IF sy-subrc <> 0.
            DESCRIBE TABLE return LINES sy-tfill.
            IF sy-tfill = 0.
              CALL FUNCTION <b>'BAPI_GOODSMVT_CREATE'</b>   
            EXPORTING
                  goodsmvt_header = wa_data_header
                  goodsmvt_code   = goodsmvt_code
                  testrun         = ' '
                TABLES
                  goodsmvt_item   = it_data_item
                  return          = return.
              CALL FUNCTION <b>'BAPI_TRANSACTION_COMMIT'</b>
               EXPORTING
                 WAIT          = 'X'
              IMPORTING
                RETURN        =
            ENDIF.
          ENDIF.
          LOOP AT return INTO wa_return.
            WRITE: 'Messsage TYPE  ', wa_return-type,
                  /,'ID  ', wa_return-id,
                  /, 'Number  ', wa_return-number,
                  /, 'Message  ', wa_return-message,
                  /, 'Long Text  ', wa_return-message_v1,
                                    wa_return-message_v2,
                                    wa_return-message_v3,
                                    wa_return-message_v4,
                 /, 'Failed at line', line_count.
          ENDLOOP.
          CLEAR: wa_ekko, wa_ekpo, wa_data, it_data_item[], wa_data_header.
        ENDLOOP.
    Reward if useful!

  • FM/BAPI/Method for Sales Order Costing

    Hi,
    I need the FM/BAPI/Method for Sales Order Costing.
    Which is calculating at run time while process of Sales Order Costing
    Can any one please help me out.
    Thanks
    Chinni
    Edited by: Tirumula Rao Chinni on Mar 10, 2010 3:04 PM
    Edited by: Tirumula Rao Chinni on Mar 10, 2010 3:35 PM

    Vinraaj, thank you very much for your advice and the time you've spent for the ask.
    I am searching for whether there is any SAP offered FM. Therefore, I did not think to check the background (code side) of the process by debugging.
    There is not any documentation about the FM that you have offered, in the system.
    So , I can not be sure about the usage of it, too.
    Thank you very much.

  • Uploading subcontracting PO using LSMW-BAPI method

    I am trying to upload the subcontracting Purchase order using LSMW-BAPI .
    Bapi name -Create from Data1
    Business Object  -    BUS2012                             Purchase Order
    Method               -    CREATEFROMDATA1          Create Enjoy Purchase Ord
    Message Type     -    PORDCR1                           Create Purchase Order
    Basic Type          -    PORDCR102                        Create Purchase Order
    In this BAPI - for subcontracting material (component), required quantity & plant values are provided in a input file .
    When I trying to upload this PO, PO gets created but component data not getting uploaded.
    In documentation of BAPI -under restriction section -there is a restriction for subcontracting.
    So can we create Subcontracting PO using this PO.
    any solution on same.
    Because most of the conversion part is done. Only for subcontracting PO this bapi is not working.
    Please anybody know about the solution guide me ASAP.
    Thanks

    Hi Vikram,
    I am also having same scenario , I m using BAPI - BAPI_GOODSMVT_CREATE To create GR  for Subcontracting PO
    Can u please tell me how can solve this problem.
    Normal GR its working but for Subcontracting PO its not working.
    Regards,
    Sanket

  • Step by step instruction for Using LSMW Recoding method for Material Master

    Guys,
    Can some one explain step by step procedure for uploading the materials master data to R/3 by using LSMW Recoding method. By the time you reply I will go through the rule of uploading the data..
    Thanks guys,
    Dhanu.

    Hi,
    The Legacy System Migration Workbench (LSMW) is a tool recommended by SAP that you can use to transfer data once only or periodically from legacy systems into an R/3 System.
    The LSM Workbench covers the following steps:
    (1)Read the legacy data from one or several files (e.g. spreadsheet tables, sequential files)
    (2)Convert the data from source format to target format
    (3)Import the data using standard interfaces (Batch Input, Direct Input, BAPI, IDoc).
    The Steps for LSME are:
    Example: Customer Master upload:
    LSMW to Update Customer Master Records with Transaction Recording
    Call Legacy System Migration Workbench by entering transaction code LSMW. Every conversion task is grouped together as Project / Subproject / Object structure. Create a Project called LSMW_DEMO and a Subproject as CUSTOMERS and Object as CUST_REC
    Step 1: Maintain Object attributes
    In this example, you will be updating the customer master records with the help of recording a transaction (XD02). Choose radio button Batch Input Recording and click on the recording overview icon to record the R/3 transaction. Enter the Recording name as XD02_REC, the description as Customer Master Updates Recording, and the transaction code as XD02.
    Step 2. Maintain Source Structures
    Give a name and a description to the source structure
    Step 3. Maintain Source Fields
    In this step, you need to list what fields are present in the source structure. The easiest way is to click on u2018Table Maintenanceu2019 icon to enter Fieldname, Type and Length for each field
    Step 4: Maintain Structure Relations
    Execute a step to u2018Maintain Structure Relationsu2019. Since, there is only one Source and Target Structure, the relationship is defaulted automatically.
    Step 5: Maintain field mapping and conversion rules
    Field RF02D-D0310 represents that you chose u2018Sales viewu2019 for the customer Master screen accordingly its value should be set to X. Keep your cursor on field RF02D-D0310 and click on Constant rule icon to choose the constant value of u2018Xu2019.
    If your source file already has the field value, you choose rule u2018Source Fieldu2019.
    Keep cursor on field u2018KUNNRu2019 and click on u2018Assign Source fieldu2019 icon to choose source field CUSTOMER from structure XD02S
    Step 6: Maintain fixed values, translations, user-defined routines
    You can also maintain re-usable translations and user-defined routines, which can be used across conversion tasks. In this case, that step is not required.
    Step 7: Specify files
    In this step, we define how the layout of the input file is. The input file is a [Tab] delimited with the first row as field names. It is present on my PC (local drive) as C:\XD02.txt.
    Step 8: Assign files
    Execute step u2018Assign Filesu2019 and the system automatically defaults the filename to the source structure.
    Step 9: Read data
    In this step, LSMW reads the data from the source file (from your PCu2019s local drive). You have the option to read only selected rows and convert data values to Internal format.
    Step 10: Display read data
    This step is optional. If required, you can review the field contents for the rows of data read.
    Step 11: Convert data
    This is the step that actually converts the source data (in source format) to a target format. Based on the conversion rules defined, source fields are mapped to target fields.
    Step 12: Display Converted data
    Again this is an optional step to view how the source data is converted to internal SAP format
    Step 13: Create batch input session
    Once the source data is converted in an internal format, you can create a batch session to process updates.
    Step 14: Run Batch Input Session
    You can execute the BDC session by Run Batch input session. Executing a batch input session is a standard SM35 transaction for managing BDC sessions. Once you have successfully executed the batch input session, the customer master records are updated in the system. You can confirm this by viewing the customer master records (XD03).
    Follow the link for material master
    http://www.sap123.com/showthread.php?t=98
    Regards,
    Biju K

  • Issues in using LSMW IDOC method for Article Hierarchy

    Hi Experts,
    I am working on a scenario for uploading article hierarchy using LSMW idoc method.
    Details:
              Message type WMATGRP
              IDoc type WMATGRP01
    But as per my understanig, for processing, there should be a inbound Function module/Process code. But I am unable to find out any process code for this in tcode WE42/We60.
    Could you please help in this problem.
    Regards
    Krishan Kumar

    Hi Saeed,
    For example if you want t create bom through lsmw then we will *** two files one header and other item one.In the same way .In lsmw start by keeping the idoc method i will only propose at second step how many files it need. Just map the idoc and see. Post if need more help.
    Regards,
    Madhu.

Maybe you are looking for