How to use LSMW to upload database table directly from flat file extract

Hi Guru's,
I am new to LSMW tool. I have searched the fourm before posting this thread for my issue but i didn't find any good posts for the same.
my requirement is : I will have a flat ( tab -delimited ) or Excel file with number of records downloaded using the databrowser for some of standard tables from one SAP systesm  . I wanted to upload the records using the LSMW  to the same tables  in some other SAP systesm . Please help me to How to upload the same using the LSMW.
Thanks & Regards,
Praveen.

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

Similar Messages

  • How to upload products in CRM from flat file

    Hi,
    My requirement is to uplaod products from flat file. Flat file contains Products details. I have tried BDC method but didnt help much.
    Please tell me is there any BAPI or other methods avialble to  useiin CRM 4.0.
    Regards
    Ramprasad

    Hi ,
    Can you tell for which transaction you want BAPI or Function Module to upload data ?
    What issue you are facing in BDC so that I can help you.

  • How to use 'Execute Procedure' to retrieve table data from an ext. MS SQL ?

    Hi,
    We have to call a stored procedure from an external MS SQL database . We are able to connect to the database and are able to successfully do a SQL (Select ) on the SQL tables. However to maintain data integrity and other security issues, we have to call a stored procedure on that database  from SAP. The stored rocedure will return a table which will contain multiple records .
    We have tried using the EXECUTE PROCEDURE command. However it returns SQL errors?
    Our SAP instance is on MS SQL.
    Please note we have gone through all SAP notes and SDN already. The query is not about connecting to the database. It is solely to find out the correct way for calling the stored procedure. The example in the SAP help documentation is for single IN and OUT parameters. We are able to do that successfully. Our requirement is to get a table back from the stored procedure.
    Please help with the correct syntax and code example if you have one.
    I would be glad to provide any other information that may be helpful.
    Thanks in advance.

    Hi,
    I too have a similar issue, I have a stored procedure written in MS SQL and it executes but I need the result in an internal table; How do I get it into an internal table?
    Following code is being used. Now the output of the query that is being executed, I need it in my internal table
    EXEC SQL.
      EXECUTE PROCEDURE d01.Z_PRICINGREPORT ( IN :i_mandt,
                                              IN :i_kschl,
                                              IN :i_vkorg,
                                              IN :i_vtweg,
                                              IN :i_matkll,
                                              IN :i_matklh,
                                              IN :i_matnrl,
                                              IN :i_matnrh,
                                              IN :i_inco1,
                                              IN :i_inco2,
                                              IN :i_zsalel,
                                              IN :i_zsaleh,
                                              IN :i_kunnrl,
                                              IN :i_kunnrh,
                                              IN :i_chargl,
                                              IN :i_chargh,
                                              IN :i_vkburl,
                                              IN :i_vkburh,
                                              IN :i_vkgrpl,
                                              IN :i_vkgrph,
                                              IN :i_wrkstl,
                                              IN :i_wrksth,
                                              IN :i_mtf,
                                              IN :i_mtt,
                                              IN :i_datbi,
                                              IN :i_werks,
                                              IN :i_stock
    ENDEXEC.
    CATCH cx_sy_native_sql_error.
        MESSAGE `Error in procedure handling` TYPE 'I'.
    endtry.
    Warm Regards,
    Abdullah

  • Uploading/Downloading table to/from *.csv - file

    Hi all.
    First I need to upload this internal table (actually it is a copy of database table) to a file *.csv, and then to be able to download the table back from it.
    All this should be done using field symbols and methods GUI_UPLOAD, GUI_DOWNLOAD from class CL_GUI_FRONTEND_SERVICES.
    *-- STRUCTURE OF INTERNAL TABLE
    TYPES: BEGIN OF in_tab,
            mandt TYPE zng_so_head-mandt,
            so_num TYPE zng_so_head-so_num,          "type numc
            vend_num TYPE zng_so_head-vend_num,      "type numc
            cust_num TYPE zng_so_head-cust_num,      "type numc
            so_date TYPE zng_so_head-so_date,        "type dats
           END OF in_tab.
    *-- INTERNAL TABLE HOLDING LIST DATA
    DATA res_tab TYPE TABLE OF in_tab WITH HEADER LINE.
    START-OF-SELECTION.
    SELECT h~mandt h~so_num h~vend_num h~cust_num h~so_date
    INTO TABLE res_tab FROM zng_so_head AS h.
    thanks all.
    Message was edited by:
            nikolai gurlenia

    Hi,
    I hope following code will solve your problem.
    DATA : it_itab  TYPE TABLE OF string WITH HEADER LINE,
           v_file1  TYPE rlgrap-filename,
           v_file2  TYPE string.
    CALL FUNCTION 'F4_FILENAME'
      IMPORTING
        file_name = v_file1.
    v_file2 = v_file1.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      EXPORTING
        filename                = v_file2
      CHANGING
        data_tab                = it_itab[]
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        not_supported_by_gui    = 17
        error_no_gui            = 18
        OTHERS                  = 19.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    IF it_itab[] IS NOT INITIAL.
      CALL METHOD cl_gui_frontend_services=>gui_download
        EXPORTING
          filename                = v_file2
        CHANGING
          data_tab                = it_itab[]
        EXCEPTIONS
          file_write_error        = 1
          no_batch                = 2
          gui_refuse_filetransfer = 3
          invalid_type            = 4
          no_authority            = 5
          unknown_error           = 6
          header_not_allowed      = 7
          separator_not_allowed   = 8
          filesize_not_allowed    = 9
          header_too_long         = 10
          dp_error_create         = 11
          dp_error_send           = 12
          dp_error_write          = 13
          unknown_dp_error        = 14
          access_denied           = 15
          dp_out_of_memory        = 16
          disk_full               = 17
          dp_timeout              = 18
          file_not_found          = 19
          dataprovider_exception  = 20
          control_flush_error     = 21
          not_supported_by_gui    = 22
          error_no_gui            = 23
          OTHERS                  = 24.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDIF.
    Reward points if the answer is helpful.
    Regards,
    Mukul

  • How to create BOM(Bill Of Material) item data from flat file?

    I have two flat files one is BOM(Bill Of Material) header data and BOM item data. BOM header is already created, now I want to create BOM item data with reference to the header data. Is there any standard direct batch input method in LSMW or Is there any standard BAPI or Is there any standard BDC report program to do the task? CS01 is the TCode to create BOM.

    Hi,
    The DI program works for create step CS01 and not for CS02.
    Perhaps this ( adding items in header by Tx: CS02 ) could be achieved by a Recording step in LSMW.
    Best Regards, Murugesh

  • How to get the column name and table name from xml file

    I have one XML file, I generated xsd file from that xml file but the problem is i dont know table name and column name. So my question is how can I retrieve the data from that xml file?

    Here's an example using binary XML storage (instead of Object-Relational storage as described in the article).
    begin
      dbms_xmlschema.registerSchema(
        schemaURL       => 'my_schema.xsd'
      , schemaDoc       => xmltype(bfilename('TEST_DIR','my_schema.xsd'), nls_charset_id('AL32UTF8'))
      , local           => true
      , genTypes        => false
      , genTables       => true
      , enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS
      , options         => dbms_xmlschema.REGISTER_BINARYXML
    end;
    genTables => true : means that a default schema-based XMLType table will be created during registration.
    enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS : indicates that a repository resource conforming to the schema will be automatically stored in the default table.
    If the schema is not annotated, the name of the default table is system-generated but derived from the root element name :
    SQL> select table_name
      2  from user_xml_tables
      3  where xmlschema = 'my_schema.xsd'
      4  and element_name = 'employee';
    TABLE_NAME
    employee1121_TAB
    (warning : the name is case-sensitive)
    To annotate the schema and control the naming, modify the content to :
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
      <xs:element name="employee" xdb:defaultTable="EMPLOYEE_XML">
        <xs:complexType>
    Next step : create a resource, or just directly insert an XML document into the table.
    Example of creating a resource :
    declare
      res  boolean;
      doc  xmltype := xmltype(
    '<employee>
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>'
    begin
      res := dbms_xdb.CreateResource(
               abspath   => '/public/test.xml'
             , data      => doc
             , schemaurl => 'my_schema.xsd'
             , elem      => 'employee'
    end;
    The resource has to be schema-based so that the default storage mechanism is triggered.
    It could also be achieved if the document possesses an xsi:noNamespaceSchemaLocation attribute :
    SQL> declare
      2 
      3    res  boolean;
      4    doc  xmltype := xmltype(
      5  '<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      6             xsi:noNamespaceSchemaLocation="my_schema.xsd">
      7    <details>
      8      <emp_id>1</emp_id>
      9      <emp_name>SMITH</emp_name>
    10      <emp_age>40</emp_age>
    11      <emp_dept>10</emp_dept>
    12    </details>
    13   </employee>'
    14   );
    15 
    16  begin
    17    res := dbms_xdb.CreateResource(
    18             abspath   => '/public/test.xml'
    19           , data      => doc
    20           );
    21  end;
    22  /
    PL/SQL procedure successfully completed
    SQL> set long 5000
    SQL> select * from "employee1121_TAB";
    SYS_NC_ROWINFO$
    <employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceS
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>
    Then use XMLTABLE to shred the XML into relational format :
    SQL> select x.*
      2  from "employee1121_TAB" t
      3     , xmltable('/employee/details'
      4         passing t.object_value
      5         columns emp_id   integer      path 'emp_id'
      6               , emp_name varchar2(30) path 'emp_name'
      7       ) x
      8  ;
                                     EMP_ID EMP_NAME
                                          1 SMITH

  • Uploading contracts into SRM from flat file...

    I am asked to develop this program but I am not sure what transactions are involved and what approach to take.
    I know how to upload the file but not sure how to upload the contracts to SRM.
    Thanks for the help.

    Hi Rakesh,
    I have encountered the same difficulty in creating the contract as well. Thanks for your code sample. I have tried to follow it closely but still i am not successful. Is it possible for you to take a look at my code?
    data: pc_id like CRMD_ORDERADM_H-OBJECT_ID.
    data: pc_header_out like BBP_PDS_CTR_HEADER_IC.
    data: pc_header_in like BBP_PDS_CTR_HEADER_D.
    *data: pc_item type table of BBP_PDS_CTR_ITEM_D with header line.
    data: pc_item type table of BBP_PDS_CTR_ITEM_ICU with header line.
    data: pc_text type table of BBP_PDS_LONGTEXT.
    data: pc_partner type table of BBP_PDS_PARTNER.
    data: wa_part like line of pc_partner.
    data: pc_org type table of BBP_PDS_ORG with header line.
    data: pc_message type table of BBP_PDS_MESSAGES with header line.
    Insert dummy data*****************************************************
    pc_header_out-CURRENCY = 'SGD'.
    pc_header_out-PROCESS_TYPE = 'PCTR'.
    Insert Purchase Org data *********************************************
    pc_org-PROC_ORG_RESP_ID = 'O 50000026'.
    pc_org-PROC_ORG_ID = 'O 50000025'.
    pc_org-PROC_GROUP_ID = 'O 50000026'.
    Insert BP data - vendor, employee Purch Org and DSTA******************
    *DSTA
    wa_part-PARTNER_ID = '0000000001'.
    wa_part-PARTNER_GUID = '4BD22A16AFA2B74D844E1595998AE7E5'.
    wa_part-PARTNER_FCT = '00000038'.
    wa_part-ADDR_TYPE = '1'.
    wa_part-ADDR_NO = '0000010469'.
    append wa_part to pc_partner.
    clear wa_part.
    *employee
    wa_part-PARTNER_ID = '0000000006'.
    wa_part-PARTNER_GUID = 'E3D4AAE842930D41B7B107F3CC60B44D'.
    wa_part-PARTNER_FCT = '00000026'.
    wa_part-ADDR_TYPE = '3'.
    wa_part-ADDR_NO = '0000010472'.
    wa_part-PERS_NO = '0000010474'.
    append wa_part to pc_partner.
    clear wa_part.
    *vendor
    wa_part-PARTNER_ID = '0000000311'.
    wa_part-PARTNER_GUID = 'F0BC646129BE2D4BB7E301F8F3708B1E'.
    wa_part-PARTNER_FCT = '00000019'.
    wa_part-ADDR_TYPE = '1'.
    append wa_part to pc_partner.
    clear wa_part.
    *purch org
    wa_part-PARTNER_ID = '0000000002'.
    wa_part-PARTNER_GUID = '48459C575651D04091BAF1B9A554CF51'.
    wa_part-PARTNER_FCT = '00000051'.
    wa_part-ADDR_TYPE = '1'.
    wa_part-ADDR_NO = '0000010470'.
    append wa_part to pc_partner.
    clear wa_part.
    Item data
    pc_item-CATEGORY_ID = 'ARMOUR'.
    pc_item-QUANTITY = '233'.
    pc_item-PRICE = '1234'.
    pc_item-VALUE = '4321'.
    pc_item-UNIT = 'EA'.
    pc_item-PRODUCT = 'B78A60018B6018418F6D0F1632E10F69'.
    pc_item-DESCRIPTION = 'Russian T72 Tanks'.
    *--Reset Buffer Tables
    CALL FUNCTION 'BBP_PROCDOC_RESET_BUFFER'.
    Create PC*************************************************************
    call function 'BBP_PD_CTR_CREATE'
    exporting
    I_HEADER = pc_header_out
    importing
    E_HEADER = pc_header_in
    tables
    I_ITEM = pc_item
    E_PARTNER = pc_partner
    I_ORGDATA = pc_org
    I_LONGTEXT = pc_text
    E_MESSAGES = pc_message.
    write: pc_header_in-guid.
    the guid return all 0s. The error message in pc_message is supply only one type of vendor and one type of responsible employee. Thanks for taking time to read this. I will really appreciate if anyone is able to help me solve this. Of course point will be rewarded. Thanks again!

  • How to upload the BP master details in huge amount from flat file to CRM database

    Hi,
    Could you any body please help me initially the best method to upload Business partner data from flat file and if possible with any sample code available?
    Basically I am an ABAP consultant. In ERP I used to do BDC or lsmw  in generally?
    This is a mission critical thing for me.

    Hi Chitturi,
    I did not come across the scenario for custom include fields from BAPI of partner creation. But if the fields are not appearing in the import/tables structure fields then you probably need to update the corresponding DB Table for those fields separately,else BAPI will update the same. You will get partner guid and partner number from export parameters of the BAPI.
    Regards,
    Dipesh
    Message was edited by: Joaquin Fornas

  • How to upload  schedule line from flat files to sap file

    dear all,
    i want to upload the schedule lines from flat files to sap schedulle lines
    but the flat files have 15 schedule lines and the data is as per date
    so how to upload that and the fields available in flat files are more than the sap screen
    we are having more than 6 items
    and 15scedule lines its abt 90data to be upload
    for one customer in every 15 day
    so how to do this
    is there any direct use in functional side
    with out the help of any abap
    but my user will do it
    so he need a permanent solution
    with regards
    subrat

    Hi Subrat ,
    u can upload the data either ( Master /Transaction) data with the help of lsmw. for that all u need to do is go through the lsmw and do it. in that u can go Batch input recording/ BAPI/ IDOC any of that. here i am sending the LSMW Notes go through it and do the work.
    once u create the LSMW project then u can ask the data from user or u can explain the user about the program and can run the flat file to upload the data.
    if u require LSMW material Just send me blank mail from u. my mail id is [email protected]
    Reward if Helpful.
    Regards,
    Praveen Kumar.D

  • How to update a Z d/b table record from report - urgent

    Dear SDN Team Members,
    I have created a ztable for list of all active customers. 
    This ztable has link with other SAP Standard D/b tables and I need to compare the entries with my ztable. 
    After doing so, I need to update a DATE field (called last_req_date) from the program.
    Until now, i only worked on internal tables and update the fields in internal table.  But this time I need to update my zTable and i've not updated any records of the database tables directly from the program.
    Please kindly provide the complete syntax and procedure on how to update z database table.
    Your help will be appreciated and points will be awarded for the same.
    Thanks in Advance.
    Best Regards!
    Krishna.

    Hi,
    To update or Insert fields into teh dbase table.
    INSERT INTO dbtab [CLIENT SPECIFIED] VALUES wa.
    INSERT INTO (dbtabname) [CLIENT SPECIFIED] VALUES wa.
    2. INSERT dbtab [CLIENT SPECIFIED] FROM TABLE itab. oder
    INSERT (dbtabname) [CLIENT SPECIFIED] FROM TABLE itab.
    3. INSERT dbtab [CLIENT SPECIFIED]. oder
    INSERT *dbtab [CLIENT SPECIFIED]. oder
    INSERT (dbtabname) [CLIENT SPECIFIED] ...
    1.TABLES SCUSTOM.
    SCUSTOM-ID        = '12400177'.
    SCUSTOM-NAME      = 'Robinson'.
    SCUSTOM-POSTCODE  = '69542'.
    SCUSTOM-CITY      = 'Heidelberg'.
    SCUSTOM-CUSTTYPE  = 'P'.
    SCUSTOM-DISCOUNT  = '003'.
    SCUSTOM-TELEPHONE = '01234/56789'.
    INSERT INTO SCUSTOM VALUES SCUSTOM.
    2.TABLES SAIRPORT.
    SAIRPORT-ID   = 'NEW'.
    SAIRPORT-NAME = 'NEWPORT APT'.
    INSERT SAIRPORT.
    To UPDATE
    TABLES SFLIGHT.
    UPDATE SFLIGHT SET   SEATSOCC = SEATSOCC + 3
                   WHERE CARRID   = 'LH'   AND
                         CONNID   = '0400' AND
                         FLDATE   = '19950228'.
    TABLES SFLIGHT.
    UPDATE SFLIGHT CLIENT SPECIFIED
                   SET   SEATSOCC = SEATSOCC + 3
                   WHERE MANDT    = '002'  AND
                   WHERE CARRID   = 'LH'   AND
                         CONNID   = '0400' AND
                         FLDATE   = '19950228'.
    TABLES SCUSTOM.
    SCUSTOM-ID       = '00017777'.
    SCUSTOM-DISCOUNT = '003'.
    UPDATE SCUSTOM.
    OR UPDATE dbtab FROM TABLE itab.

  • Va31 shedule line agreement data upload from flat file

    Hi abapers
    I have to upload some data (va31) from flat file to my database (shedule line agreement data) I am using user exit for it...Cant get which user exit will solve the purpose and where to check it from..I tried using SDTRM001 , meeta001 and and the va45A series but its not working. I used break point on these user exits but its not stoping at break point.
    Can any one help me where to find which user exit will work in this case?
    Thanks in Advance
    Annu

    Hi Prash,
    Check these posts:
    Re: Increasing the length of Infoobject from 60 to 240 characters
    Re: InfoObject > 60
    Bye
    Dinesh

  • 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

  • How to send  changes in the Database Table Periodically using Change Pointe

    Hi,
           How to send  changes in the Database Table to the external system Periodically using Change Pointers.
    Thanks & Regards,
    Gopi.

    That depends on what table you are referring to.

  • How to use JSTL create a dynamic table according to a database???

    How to use JSTL create a dynamic table according to a database in a web page? Who can help me? Thanks.

    How to use JSTL create a dynamic table according to a
    database in a web page? Who can help me? Thanks.???
    Could you rephrase your quesion?
    Do you want to display records by reading from a table in DB?

  • How to use LSMW on CRM for bulk master data creation?

    Hello Experts,
    I need your help to able to use LSMW on CRM for bulk master data creation. Below is described my detailed requirement; -
    We have CRM 2007 integrated with SAP ISU (ECC6.0). As per business process all Business Master Data (BP details, Business Agreement details etc) and Technical Master Data (Connection Object, PoD etc.) is created in CRM and then it is replicated in ISU. We are going to start Assembly Test soon. Now we need to have all master data in place. Tool we want to use is LSMW.
    Now can you help me right from scratch on how to use LSMW for bulk master data creation in CRM?
    Please give me documents / links etc that is relevant.
    Regards,
    Rohit

    Hi,
    I have looked into your query.
    These are some information which might be useful to you.
    What is LSMW?
    Legacy System Migration Workbench or LSMW is SAP standard program that can be used to easily load / change master data or transactions in SAP without any programming at all. It can be used to upload data at cutover, such as: open orders, contracts, materials, vendors, stock on hand. It can also be used in a production system to make changes to existing data. Very limited authorization checks are available on the transaction, so the use of it must be very well controlled.
    One input file can be used to create all the views of the material master. For all the material types. Even if different views and fields are used for the different materials.
    Steps to take
    1. Create text file with data to be loaded
    2. Set up and run LSMW
    The following link will provide good information on LSMW Idoc method:
    [http://help.sap.com/saphelp_nw04/helpdata/en/ad/2d54a41d7011d2b42e006094b944c8/frameset.htm]
    I hope this helps.
    Regards,
    Venkat

Maybe you are looking for