BDC Mapping

Hi abaper,
How we can map uploaded data in SAP to flatefile data??
it means how we can understand which record in SAP is correspond to flate file record?
thanks.
Edited by: Rajesh Kumar on Jun 23, 2008 1:04 PM

Hi rajesh,
   This question does not belong here.
Anyhow,
there are a number of methods to upload legacy data into SAP.
1)BDC -session or call transaction method.
2)Upload using a BAPI
3) Direct Input method.
You can search the forum for any of the above (Especially abap forums).
Regards,
Ravi

Similar Messages

  • BDC mapping of LT11 Running Slow

    Hello
    I have a couple questions, answers for either one will be greatly appreciated.
    I have a BDC mapping for transaction LT11 that runs very slow, thus causing lot of locks.  Is there a BAPI or Function module that can do a LT11 (Confirm TO Line Item), is there a way to control all the locks?
    Is there a Function Module to allow confirmation of multiple TO's at same time?
    Thanks
    Gary

    Specifically for the locks - there is someting called "late material lock" in the configuration. I know it applies to the goods movements, but am not sure about TOs. Look it up.

  • Automatical processing of BDC map...

    hi all,
    is there any way of automated processing of BDC map through ABAP?
    in my case, RFBIBL00 called in direct input creates BDC error map in case some
    documents can't be posted. Since this is done in background,
    my idea was to process these maps automatically and then to read
    Logs with 'RSBDCLOG' to determine what the error was...
    is this possible?
    is there more elegant solution to this problem?...
    ah yes, i understand that report 'RSBDCREO' can delete
    sessions that were processed OK, is there any way of
    deleting error sessions through ABAP. As i mentioned, reason for this
    is because everything is done with no user intervention in background...
    Thank you all for help.
    Cheers

    hi all,
    is there any way of automated processing of BDC map through ABAP?
    in my case, RFBIBL00 called in direct input creates BDC error map in case some
    documents can't be posted. Since this is done in background,
    my idea was to process these maps automatically and then to read
    Logs with 'RSBDCLOG' to determine what the error was...
    is this possible?
    is there more elegant solution to this problem?...
    ah yes, i understand that report 'RSBDCREO' can delete
    sessions that were processed OK, is there any way of
    deleting error sessions through ABAP. As i mentioned, reason for this
    is because everything is done with no user intervention in background...
    Thank you all for help.
    Cheers

  • Msg of type 'S' in BDC program and same msg of type 'A'

    We have to upload data for ABZON transaction of assets. When we use LSMW with recording method and try to upload say 3 records. All teh records are updated successfully but the batch input session log says last two records with a message of type 'A' "leave transaction is not possible in batch input"
    But when we upload the same data with BDC program with call transaction then teh log shows same message with type 'S'.
    what could be the reason for this?
    Though data gets uploaded successfully the 'A' message is being displayed in LSMW batch input log.
    if anyone has encountered a similar problem pls let us know how to resolve this asap.
    Thanks,
    Simmi

    hi,
    one crucial point I remember by using enjoy tcodes for bdc is the change of field bukrs.
    you must create one bdc-map for each company - program sth like this:
        LOOP AT itab.
          AT NEW bukrs.
            IF bk ne itab-bukrs.                    "not for 1st bk
              PERFORM open_btci_group USING map '00000000' 'X'.
              ADD 1 TO cnt.
              PERFORM bdc_dynpro      USING 'SAPLSPO4' '0300'.
              PERFORM bdc_field       USING 'BDC_OKCODE' '=FURT'.
              zeile = '01'.
              PERFORM bdc_field_loop USING  zeile 'SVALD-VALUE' itab-bukrs.
            ENDIF.
          ENDAT.
    hope that helps

  • Problems using BDC and/or HR_INFOTYPE_OPERATION

    Hi Gurus.
    Our team is developing several inbound HR interfaces but in integrated test in QAS env something really strange is happening during the tests.
    We are using BDC data for data input in infotypes 0000 and 0001 through PA30 and for all the other infotypes we use HR_INFOTYPE_OPERATION.
    Sometimes data input for 0000 and 0001 works, sometimes no, our table log gives us that the data was processed but when we check on the infotypes there is no data there. The BDC mapping was checked several times and we did some tests in another enviroment, everything is ok, the data is processed but in QAS we are having this problems.
    With HR_INFOTYPE_OPERATION, when we run in background mode it give us strange error logs like "a complex application error occurs" but when i did a debug inside of that FM there is nothing missing or nothing wrong.
    The enviroment seems to be very instable but basis teams says that there is no log error, but i've never seems errors like these, sometimes works, sometimes no.
    The last info that i had is QAS instance that we are using was deleted 3 weeks ago and restored again.
    Any suggestions?
    Thanks a lot.

    Hi,
    If your BDC mapping is correct, check the return code after your BDC is excuted with - BDCMSG. Make sure that you give Refresh BDCDATA for every loop.
    Having said this, I have also had issues with BDC every there was no error at the end, however the infotype never got updated.
    Please double check all the relevant screens. I found that for a particular Inf that I was updating, the subtypes belonged to differnt screens. Can you test with the same data in your Dev or some other box? If that doesnt work, there might be a data issue.
    Generally the complex application error occurs when a screen have been modified to prohibit batch processing. It is very difficult to diagnose the error in such cases. Make sure that you are passing all the important data to the FM. You might be able to get more help by searching in this forums as well.
    Regards, Liz

  • Issue related to BDC for ME52

    Hi,
    I'm trying to create a BDC for ME52 by SHDB transaction. My requirement is to delete Service Items of a specific Purchase Requisition Item.
    I've noticed that the behavior of the ME52 by using SHDB is not the same regarding its direct execution. The called screens is different.
    Does anyone know why does that happen?
    Thanks in advance,
    Tiago.

    Hi,
    When SHDB record is created, it's displayed the option "No BI mode". When that option is chosen, the sequence of the necessary screens to delete the service items is run, but the bdc mapping generated is quite strange. FVAL fields are filled with subscreen names only.
    When ME52 is executed, the sequence of the screens is: 1) Purchase Requisition Number, 2) Purchase Requisition Items and 3) Service Items. From this one it's only necessary to click on the Button ' - ' to delete the service item. However, when I try to do it by SHDB, The button ' - ' calls another screen.
    Any help is welcome.
    Thanks in advance.
    Tiago.

  • How can i see log in sm35 after i run my program  ?

    i ahve some problem in my recording  , but i cant get what screen couse
    to the error .
    i get message in the end of the session  "Start screen does not exist in batch input data".
    i try to fix ( remark or open some lines ) but i cant find
    the problem  , so i wan to see the log in sm35 but i cant see .
    how can i do it  ?
    i now about "RSBDC_PROTOCOL " , but it didn't help .
    my program/record   :
      LOOP AT IT_AGR_LIST .
        PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0205'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RM06E-EVRTN'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'RM06E-EVRTN'
                                      IT_AGR_LIST-EVRTN . " '4610000065'.
        PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0220'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RM06E-EBELP'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=NP'.
        PERFORM BDC_FIELD       USING 'RM06E-EBELP'
                                      '10'.
        PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0220'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'EKPO-PEINH(02)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'RM06E-EBELP'
                                        '20'.
        LOOP AT IT_BKPF WHERE EVRTN = IT_AGR_LIST-EVRTN .
          PERFORM BDC_FIELD       USING 'EKPO-EMATN(02)'
                                        IT_BKPF-EMATN  . " '7000305'.
          PERFORM BDC_FIELD       USING 'EKPO-NETPR(02)'
                                   IT_BKPF-NETPR .     "'2552'.
          PERFORM BDC_FIELD       USING 'EKPO-PEINH(02)'
                                        '1000'.
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0220'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'RM06E-EVRTP(02)'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=TXP'.
          PERFORM BDC_FIELD       USING 'RM06E-EBELP'
                                        COUNTR .                "'20'.
          PERFORM BDC_FIELD       USING 'RM06E-TCSELFLAG(02)'
                                        'X'.
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0106'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'RM06E-LTEX1(01)'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=TEDE'.
          PERFORM BDC_FIELD       USING 'RM06E-SELKZ(01)'
                                        'X'.
          PERFORM BDC_DYNPRO      USING 'SAPLSTXX' '1100'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'RSTXT-TXLINE(02)'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=EDNP'.
          PERFORM BDC_FIELD       USING 'RSTXT-TXLINE(02)'
                                        IT_BKPF-STR_LEN1.
             'aaaaaaaaa1aaaaaaaaa2aaaaaaaaa3aaaaaaaa'  &
                          *'a4aaaaaaaaa5aaaaaaaaa6aaaaaaaaa7aa'.
         PERFORM BDC_DYNPRO      USING 'SAPLSTXX' '1100'.
         PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                       'RSTXT-TXLINE(03)'.
    if not IT_BKPF-STR_LEN2  is initial .
         PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                       '=EDNP'.
          PERFORM BDC_FIELD       USING 'RSTXT-TXLINE(03)'
                                   IT_BKPF-STR_LEN2.
             'aaaaaaaaa1aaaaaaaaa2aaaaaaaaa3aaaaaaaa'  &
                          *'a4aaaaaaaaa5aaaaaaaaa6aaaaaaaaa7aa'.
    endif.
         PERFORM BDC_DYNPRO      USING 'SAPLSTXX' '1100'.
         PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                       'RSTXT-TXLINE(04)'.
         PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                       '=EDNP'.
          PERFORM BDC_FIELD       USING 'RSTXT-TXLINE(04)'
                                   IT_BKPF-STR_LEN3.
             'aaaaaaaaa1aaaaaaaaa2aaaaaaaaa3aaaaaaaa'  &
                          *'a4aaaaaaaaa5aaaaaaaaa6aaaaaaaaa7aa'.
         PERFORM BDC_DYNPRO      USING 'SAPLSTXX' '1100'.
         PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                       'RSTXT-TXLINE(05)'.
      if not IT_BKPF-STR_LEN2  is initial .
         PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                       '=EDNP'.
         PERFORM BDC_FIELD       USING 'RSTXT-TXLINE(05)'
    **'ssssssssssssssssssssssssssssssssssssss'
    ***'sendif.sssssssssssssssssssssssssssssssss'.
    **endif.
         PERFORM BDC_DYNPRO      USING 'SAPLSTXX' '1100'.
         PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                       'RSTXT-TXLINE(06)'.
         PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                       '=EDNP'.
         PERFORM BDC_FIELD       USING 'RSTXT-TXLINE(06)'
    **'ssssssssssssssssssssssssssssssssssssss'
    ***'ssssssssssssssssssssssssssssssssss'.
         PERFORM BDC_DYNPRO      USING 'SAPLSTXX' '1100'.
         PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                       'RSTXT-TXLINE(07)'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=TXBA'.
          PERFORM BDC_DYNPRO      USING 'SAPMM06E' '0106'.
          PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                        'RM06E-SELKZ(01)'.
          PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                        '=BU'.
          PERFORM BDC_FIELD       USING 'RM06E-SELKZ(01)'
                                        'X'.
          CALL TRANSACTION 'ME32K' USING BDCDATA
                                           MODE   P_DMODE  "A"
                                           UPDATE 'S'
                                           MESSAGES INTO ITAB_MSG1.

    hi,
    goto se38 - find - rsbdc*:
    you'll find a lot of prg. to analyse your bdc-map
    like RSBDCLOG  or RSBDC_ANALYSE 
    A.

  • LSMW issue with Popups

    Hello,
    can me help anyone. I've an LSMW with an recorded transaction. I generate a BDC-map. Sometimes the transaction gives me a popup sometimes not. the popup show me only an information. It is possible to check when the popups comes up and quit it. Otherwise I got an error. And I've no chance to split the data in this with popup information and woth no popup information.
    Any ideas?
    Thank you!
    Best regards
    MartinS

    Is this a parameter? Where can I find this? Or did you mean the Batch-Input option in the Gui-Settings:
    - Click on the GUI settings button.
    - Click on the 'options'.
    - Goto the 'Expert' Tab.
    - Switch off the 'Dialog Box for OK-Code' Check box in the 'Batch Input' section.
    - Save the settings by clicking 'Apply' and 'OK'.
    Thank's for help!

  • I have mapped the fields on the selection-screen  to the BDC on transaction

    I have mapped the fields on the selection-screen  to the BDC on transaction F110.
    When I am selecting a particular any value in select-option on the selection screen, it is giving some default value and the value given by me,for example:
    Payment methods:C
    but in BDC recording for F110 Payment methods:IEQC when the programs is running in foreground mode.
    how can I rectify it?

    This is because payment methods may be a table and what you see IEQC is actually, I for include, EQ for equal and C as your payment method. This is standard structure for ranges or select-options. You can use variable-low which will give you only C.

  • Data Conversion mapping u0096 BDC

    I am coming across a scenario, as we are working on conversions, we are getting data from some 3rd party system into SAP and we need to update Infotypes using uploads.
    Right now we are facing problem, which they have the separate data I mean their naming standard like they have different codes 01, 02, 03 and in SAP we have different ones.
    What are the different ways that we map and validate our data before uploading it into SAP? They give us a master file extract from their 3rd party system and they want us to upload into SAP. In Sap we might have lot of difference of fields and value, which we might need to make sure and validate before we upload it in to SAP.
    Could you please write your suggestions/inputs, how I can achieve this task.
    Thanks

    Hi,
    You can also pre-populate an internal table with all the mapping values.  For example: if the input value is 01, the corresponding SAP value = 'One'.
    So you create an internal table with two fields, first with the legacy values and second with SAP values.
    Then when you are looping through the internal table of the input file read the above internal table with key = input file value and then use the corresponding value.
    And if it is an interface (not conversion) and the values keep changing, they I would suggest you t maintian a Ztable.
    Good luck.
    Venu

  • BDC to ELM Mapping of Business Partner - Error Message Collection??

    Dear Experts,
    I'm working on BDC for External List Management (ELM) : CRMD_MKTLIST transaction in CRM 5.0 System with Mappping format:
    <b>org_title_key; org_name1; org_name2;org_postl_cod1;org_countryiso.</b>
    I want to know the where the error or any messages are collected/?? <b>tables, FM, Error logs by using BDC(Call Transaction Method)?? and How ??</b>
    Can Any body help in this regard??
    Regards,
    Arjun

    Check the following notes:-
    1)  Note 882726 - SAP BP: Error message R11 244 (BP Transaction + BAPIs)
    2)  Note 1380576 - ECC BP to CRM BP address repln fails due to validity periods
    thanks
    G. Lakshmipathi

  • Doubt in mapping of fields in BDC

    Hi
    Iam presently doing on conversions realed to Finacial postings.my work in this task is "iam uploading an excel file from work station and save it in unix file,before sending into unix iam doing mapping of some financial realeted fields ".how can i map that fields.iam doing on the T9AFF Strcture it is belonfg to the finacial batch interface.
    plz give sample example and code..?
    Map the T9AFF fields as GL-GL, GL-AP, GL-AR, AP-AP, AR-AR, etc posting Use the format as in SAP (date, number, leading 0-s)
    thanks

    Use FM ALSM_EXCEL_TO_INTERNAL_TABLE
    TYPES:
    BEGIN OF ty_upload,
    field1 TYPE c length 12,
    field2 TYPE c length 12,
    field3 TYPE c length 12,
    END OF ty_upload.
    DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.
    DATA wa_upload TYPE ty_upload.
    DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.
    FIELD-SYMBOLS: <wa> type alsmex_tabline.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = filename
    i_begin_col = 1
    i_begin_row = 1
    i_end_col = 3
    i_end_row = 65535
    TABLES
    intern = itab.
    LOOP AT itab ASSIGNING <wa>.
    CASE <wa>-col.
    WHEN '0001'.
    wa_upload-field1 = <wa>-value.
    WHEN '0002'.
    wa_upload-field2 = <wa>-value.
    WHEN '0003'.
    wa_upload-field3 = <wa>-value.
    ENDCASE.
    APPEND wa_upload TO it_upload.
    CLEAR wa_upload.
    ENDLOOP.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Unable to update the serial number through bdc in Sales Order

    Hi experts,
    I written the inboud FM for to update the 3rd party items serial number to the sales orders through BDC Call transaction Method.
    Here i am facing a problem when i have the 19 item Quan ,it is updating correct through idoc , when ever there is moe than 19 and at that if any serial number repeated for that if i am changing at that time it is loosing the control of the BDC and giving the control to the salesorder screen.
    how can i handle that control again has to come to BDC prgrm......
    Thnks,
    Regards,
    Bharani

    Hi,
    Can you please let me know the segment in ORDERS05 Idoc to process the Payment card information and if the standard Function Module can handle the creation of a Sales Order with data for Payment Card.
    We have a requirement to map the Tokenized Number of the Credit Card send from a store front end to ECC mapping via SAP-PI.
    Thanks in Advance,

  • Fields in a BDC table

    hai gurus....
    What are the fields in a BDC table???
    Thanks
    Pavan

    hi,
    i hope this answer will helps you..........,
    the BDCDATA table contains fields are...
    <b>BDCDATA-PROGRAM</b>-----> this field describes the module pool program name which we are used for vaidating and updating the data.
    <b>BDCDATA-DYNPRO</b>----
    > this field describes the currently active screen.
    <b>BDCDATA-DYNBEGIN</b>-------> this field describes the default or initial screen.
    <b>BDCDATA-FNAM</b>----
    > this field describes the field name which we are used in validations.
    <b>BDCDATA-FVAL</b>----
    > this field describes the field value which we are used in validations.
    by using the above table we perfome the mapping logic in BDC for validating and updating the legacy system data.
    regards,
    Ashok Reddy
    Message was edited by:
            Ashok Reddy

  • I want in LSMW SAME CODING. THIS IS USING BDC CALL TRANSACTION

    REPORT  ZXX_BDC_PRA NO STANDARD PAGE HEADING LINE-COUNT 20
                                                LINE-SIZE 150 .
    Program Name  :ZXX_BDC_PRA                             *
    Object Id     :                                        *
    Develper Name : praveen                                *
    Start Date    : 25.06.07                               *
    Description   : uploading flat file to sap system      *
    *--structure for Data Uploading.
    DATA: BEGIN OF IT_STR ,
            VKORG LIKE RF02D-VKORG,
            VTWEG LIKE RF02D-VTWEG,
            SPART LIKE RF02D-SPART,
            KTOKD LIKE RF02D-KTOKD,
            NAME1 LIKE KNA1-NAME1,     
            SORTL LIKE  KNA1-SORTL,     
            ORT01 LIKE KNA1-ORT01,     
            PSTLZ     LIKE KNA1-PSTLZ,     
            LAND1 LIKE KNA1-LAND1,     
            SPRAS LIKE KNA1-SPRAS,
            END OF IT_STR.
    *--Internal Table for Data Uploading.
    DATA: ITAB  LIKE IT_STR OCCURS 0.
    *--Internal Table to sucessfull Records.
    DATA:   ITAB1 LIKE IT_STR OCCURS 0.
    *--Internal Table to Store Error Records.
    DATA:    ITAB2 LIKE STANDARD TABLE OF IT_STR WITH HEADER LINE.
    *--Internal Table for Storing the BDC data.
    DATA: BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE.
    *--Internal Table for storing the messages.
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA:   COUNT TYPE I VALUE 1,
            S VALUE 0, E VALUE 0.
    Selection screen *
    SELECTION-SCREEN BEGIN OF BLOCK b1
                     WITH FRAME TITLE TEXT-001.
    PARAMETERS: P_FILE TYPE IBIPPARMS-PATH.
    SELECTION-SCREEN END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
    *functionality to use drill down list
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
        IMPORTING
          FILE_NAME     = P_FILE.
    Start-of-selection *
    START-OF-SELECTION.
      DATA FILENAME TYPE STRING.
      FILENAME = P_FILE.
    *-- Form to upload flatfile data into the internal table.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                = FILENAME
          FILETYPE                = 'ASC'
          HAS_FIELD_SEPARATOR     = 'X'
        TABLES
          DATA_TAB                = 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
          OTHERS                  = 17.
    *--Generating the BDC table for the fields of the internal table.
      LOOP AT ITAB INTO IT_STR.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0107'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RF02D-KTOKD'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'RF02D-VKORG'
                                      IT_STR-VKORG.
        PERFORM BDC_FIELD       USING 'RF02D-VTWEG'
                                       IT_STR-VTWEG.
        PERFORM BDC_FIELD       USING 'RF02D-SPART'
                                      IT_STR-SPART.
        PERFORM BDC_FIELD       USING 'RF02D-KTOKD'
                                        IT_STR-KTOKD.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0110'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNA1-SPRAS'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'KNA1-NAME1'
                                    IT_STR-NAME1.
        PERFORM BDC_FIELD       USING 'KNA1-SORTL'
                                        IT_STR-SORTL.
        PERFORM BDC_FIELD       USING 'KNA1-ORT01'
                                        IT_STR-ORT01.
        PERFORM BDC_FIELD       USING 'KNA1-PSTLZ'
                                      IT_STR-PSTLZ.
        PERFORM BDC_FIELD       USING 'KNA1-LAND1'
                                      IT_STR-LAND1.
        PERFORM BDC_FIELD       USING 'KNA1-SPRAS'
                                        IT_STR-SPRAS.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0120'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNA1-TXJCD'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0125'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNA1-NIELS'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0360'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNVK-NAMEV(01)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0310'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNVV-BEGRU'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02D' '0324'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'KNVP-PARVW(01)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
    *--Calling the transaction 'Vd01'.
        CALL TRANSACTION 'VD01' USING BDCDATA MODE 'N' UPDATE 'S'
        MESSAGES INTO MESSTAB.
        PERFORM MESSAGES.
        REFRESH : BDCDATA, MESSTAB.
      ENDLOOP.
    END-OF-SELECTION.
    *--Populating the Success records internal table.
      IF ITAB1[] IS NOT INITIAL.
    format color 5.
        WRITE: /'SUCCESSFUL RECORDS'.
        format color off.
        LOOP AT ITAB1 INTO IT_STR.
          WRITE:/ IT_STR-VKORG,IT_STR-VTWEG,
                  IT_STR-SPART,IT_STR-KTOKD,
                  IT_STR-NAME1,IT_STR-SORTL,     
                  IT_STR-ORT01,
                  IT_STR-PSTLZ,
                  IT_STR-LAND1,      
                  IT_STR-SPRAS.
          S = S + 1.
        ENDLOOP.
    REFRESH : ITAB1.
        WRITE:/ 'TOTAL RECORDS',S.
      ENDIF.
    *--Populating the error records internal table.
      IF ITAB2[] IS NOT INITIAL.
    FORMAT COLOR 3.
        WRITE :/ 'ERRORS RECORDS ARE'.
    FORMAT COLOR OFF.
        LOOP AT ITAB2.
          WRITE:/ ITAB2-VKORG,
                  ITAB2-VTWEG,
                  ITAB2-SPART,ITAB2-KTOKD,
                  ITAB2-NAME1,ITAB2-SORTL,     
                  ITAB2-ORT01,
                  ITAB2-PSTLZ,
                  ITAB2-LAND1,      
                  ITAB2-SPRAS.
            E = E + 1.
        ENDLOOP.
    REFRESH : ITAB2.
        WRITE: / 'TOTAL RECORDS',E.
    REFRESH : ITAB2.
      ENDIF.
    End of Selection *
    END-OF-SELECTION.
    TOP-OF-PAGE *
    TOP-OF-PAGE.
      WRITE:/ SY-ULINE.
      WRITE:/10 'REPORT ID',21 SY-REPID,35 'USERNAME',46 SY-UNAME,
      60 'SYSTEM DATE',70 SY-DATUM,80 'SYSTEM TIME',90 SY-UZEIT,
      100 'PAGE NO',108 SY-PAGNO.
      WRITE:/ SY-ULINE.
    FOrm to Populate the BDC table.
           Start new screen                                              *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
           Insert field                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> SPACE.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.                    "BDC_FIELD
    *&      Form  messages
    FORM MESSAGES .
      LOOP AT MESSTAB.
        IF MESSTAB-MSGTYP = 'I'.
         WRITE : / MESSTAB-MSGV1.
        ELSEIF
    MESSTAB-MSGTYP = 'S'.
          INSERT LINES OF ITAB FROM COUNT TO COUNT INTO TABLE ITAB1 .
          COUNT = COUNT + 1.
         WRITE : / MESSTAB-MSGV1.
        ELSEIF
        MESSTAB-MSGTYP = 'E'.
          INSERT LINES OF ITAB FROM COUNT TO COUNT INTO TABLE ITAB2.
          COUNT = COUNT + 1.
         WRITE : / MESSTAB-MSGV1.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " messages

    Hi
    Go through the doc and do the same using LSMW
    BDC is the way to transfer data by writing a batch input program which can use either session or call transaction method.
    LSMW used to transfer data without/less code.
    What type of data we transfer using LSMW?
    LSMW is best suited for transferring master data.
    Actually BDC and LSMW are not comparable at all.
    for example LSMW itself can use BDC as a way of mass data transfer.
    BDC is a mass data transfer technique via screen logic of existing SAP Data entry transactions. It behaves as if you are manually making thousand of entires into sap system as a background job. And that is probably the reason why BAPI's are preffered over BDC's.
    On the other hand LSMW is a tool to facilitate DATA migration from other legacy systems ... It contains step by step procedure for data migration.
    Like Managing Data Migration Projects , Creating Source Structures , Mapping Source structures wid Target structures , etc etc
    LSMW internally might well be using the following techniqes for data transfer..
    1. IDOX
    2. Direct Input / BDC
    4. BAPI's
    LSMW is an encapsulated data transfer tool. It can provide the same functionality as BDC infact much more but when coming to techinical perspective most the parameters are encapulated. To listout some of the differences :
    LSMW is basicaly designed for a fuctional consultant who do not do much coding but need to explore the fuctionality while BDC is designed for a technical consultant.
    LSMW offers different techinque for migrating data: Direct input ,BAPI,Idoc,Batch input recording. While bdc basically uses recording.
    LSMW mapping is done by SAP while in BDC we have to do it explicitly .
    LSMW is basically for standard SAP application while bdc basically for customized application.
    Coding can be done flexibly in BDC when compared to LSMW
    1. Maintain Attributes:
    Here you have to choose the second option and you can do the recording how this should work. Then assign the same to the Batch Input Recording name.
    2. Maintain Source structure:
    Create a structure name
    3. Maintain Source field:
    In this you have to create a structure same as that of the input file
    eg: name
    age
    4. Maintain structure relations:
    This will link the structure to the input file.
    5. Maintain field mapping and conversion rules:
    Here is the place where you can do coding, depending upon the code you have written or assignment you have done the values will get picked up from the file and get processed.
    6. Maintain field mapping and conversion rules:
    If you have any fixed values you can define here.
    7. Specify files:
    Specify the input file path and type.
    8. Assign files:
    This will assign ur file to the Input file
    9. Read Data:
    This will read ur data from teh file.
    10. Dispaly Read Data:
    You can see the uploaded data
    11. Convert Data
    This will convert the data to the corresponding format for processing
    12. Display Converted data:
    13. Create batch input session
    Here this will create a batch input session for processing
    14. Run Batch Input session:
    By clicking on the session and process the same you can do teh needfu.
    http://www.sapbrain.com/TOOLS/LSMW/SAP_LSMW_steps_introduction.html
    http://esnips.com/doc/8e732760-5548-44cc-a0bb-5982c9424f17/lsmw_sp.ppt
    http://esnips.com/doc/f55fef40-fb82-4e89-9000-88316699c323/Data-Transfer-Using-LSMW.zip
    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
    http://esnips.com/doc/7582d072-6663-4388-803b-4b2b94d7f85e/LSMW.pdf
    for Long texts Upload
    Please take a look at this..
    http://help.sap.com/saphelp_erp2005/helpdata/en/e1/c6d30210e6cf4eac7b054a73f8fb1d/frameset.htm
    Reward points for useful Answers
    Regards
    Anji

Maybe you are looking for