Give a simple example of bdc by lsmw method...all steps if possible

any step by step procedure for LSMW ..pl
Thanks,
Balaji

Hi
  Check out these site for LSMW IDOC's
https://forums.sdn.sap.com/click.jspa?searchID=170104&messageID=2090878
https://forums.sdn.sap.com/click.jspa?searchID=170104&mess
http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc
http://www.sap-img.com/sap-data-migration.htm
http://www.sapgenie.com/saptech/lsmw.htm
http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf
http://www.sap.info/public/INT/int/glossary/int/glossaryletter/Word-17643ed1d6d658821_glossary/L#Word-17643ed1d6d658821_glossary
http://www.scmexpertonline.com/downloads/SCM_LSMW_StepsOnWeb.doc
http://www.sapgenie.com/saptech/lsmw.htm
http://service.sap.com/lsmw
http://www.sapbrain.com/TUTORIALS/TECHNICAL/LSMW_tutorial.html
Regards
Haritha.

Similar Messages

  • Give a simple example of BDC using Recording method

    give the various steps ...

    For a BDC upload you need to write a program which created BDC sessions.
    Steps:
    1. Work out the transaction you would use to create the data manually.
    2. Use transaction SHDB to record the creation of one material master data.
    Click the New recording button or the Menu - Recording - Create
    3. Save the recording, and then go back a screen and go to the overview.
    4. Select the recording and click on Edit - Create Program. Give the program a Z name, and select transfer from recording.
    5. Edit the program. You will see that all the data you entered is hard-coded into the program. You need to make the following changes:
    5.1 After the start-of-selection, Call ws_upload to upload the file (the excel file needs to be saved as TAB separated).
    5.2 After the open-group, Loop on the uploaded data. For each line, perform validation checks on the data, then modify the perform bdc_field commands to use the file data.
    5.3. After perform bdc_transaction, add the endloop.
    Execute the program. It will have options to create a batch session or to process directly.
    These are all my finds . Might be it will be useful to you.
    Direct call of transactions, session handling:
    /nxxxx This terminates the current transaction, and starts transaction xxxx
    /n This terminates the transaction. This generally corresponds to pressing F15 to go back.
    /nend This termiantes all separate sessions and logs off (corresponds to System - Logoff).
    /nex This terminates all separate sessions and logs off immediately (without any warning!).
    /oxxxx This opens a new session and starts transaction xxxx in This session.
    /o This lists existing sessions and allows deletion or opening of a new session.
    /i This terminates the current session (corresponds to System End
    /i1, /i2,... This terminates the session with the number given.
    .xyzw Fast path: 'xyzw' refers to the underlined letters in the menus. This type of navigation is uncommon and is provided more for emergencies (such as a defective mouse).
    Batch
    The following commands can be entered in correction mode ('Process in foreground' or 'Display errors only') when processing a batch input session:
    /n This terminates the current batch input transaction and characterizes it as
    /bdel This deletes the current batch input transaction.
    /bend This terminates batch input processing and sets the session to Failed
    /bda This switches from Display errors only to Process in foreground
    /bde This switches from Process in foreground to Display errors only
    ABAP/4
    /h This switches into debugging mode.
    /hs This switches into debugging mode and activates the debugging of system functions.
    Buffer
    WARNING: Resetting buffers can significantly change the performance of the entire system for a long time.
    It should therefore only be used where there is a good reason tdso. As of release 3.0B system administator authorization is required (authorization object (S_ADMI_FCD). The action is noted in the system log.
    /$SYNC This resets all buffers of the application server
    /$CUA This resets the CUA buffer of the application server
    /$TAB This resets the TABLE buffers of the application server
    /$NAM This resets the nametab buffer of the application server
    /$DYNP This resets the screen buffer of the application server
    SHDB recording helps you to identify the desired screen flow. It shows details like screen sequence, screen nos, screen element names and required user command keys. This all helps while designing / coding a BDC flow for a transaction in the custom program. If you have any more questions or if you are not clear about SHDB, please check this links -
    http://www.planetsap.com/Tips_and_Tricks.htm
    http://www.itcserver.com/blog/2006/07/12/shdb-the-transaction-recorder/
    Direct Input.
    Without calling the screens but all the validations should be done and only for master datas upload.
    Direct Input method:
    1. Only for error free datas and also master data
    updation.
    2. It will directly updates the database table. No
    screens involved.
    3. Transaction BMVO or Program RBMVSHOW has been
    used.
    BDC(Batch Input Session):
    1. Screens will be called programmatically.
    2. First sessions will be created then we'll run the seesions in SM35 transaction.
    3.Synchronous database update. After the processing the session only database update will occur.
    For BDC:
    http://myweb.dal.ca/hchinni/sap/bdc_home.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/bdc&
    http://www.sap-img.com/abap/learning-bdc-programming.htm
    http://www.sapdevelopment.co.uk/bdc/bdchome.htm
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/69/c250684ba111d189750000e8322d00/frameset.htm
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/BDC_tutorial.html
    Check these link:
    http://www.sap-img.com/abap/difference-between-batch-input-and-call-transaction-in-bdc.htm
    http://www.sap-img.com/abap/question-about-bdc-program.htm
    http://www.itcserver.com/blog/2006/06/30/batch-input-vs-call-transaction/
    http://www.planetsap.com/bdc_main_page.htm
    call Transaction or session method ?
    Check this sample one
    ******Internal Table for Header Data.
    TYPES : BEGIN OF type_header,
    kschl LIKE konv-kschl,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE komg-spart,
    matnr LIKE mvke-matnr,
    kbetr(11) TYPE c,
    datab(10) TYPE c,
    datbi(10) TYPE c,
    END OF type_header.
    ****Internal Table for Item Level.
    TYPES : BEGIN OF type_item,
    kschl LIKE konv-kschl,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE komg-spart,
    matnr LIKE mvke-matnr,
    kbetr(11) TYPE c,
    datab(10) TYPE c,
    datbi(10) TYPE c,
    END OF type_item.
    ******Error Table For not found in MVKE.
    TYPES : BEGIN OF type_error ,
    kschl LIKE konv-kschl,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE komg-spart,
    matnr LIKE mvke-matnr,
    kbetr LIKE konp-kbetr,
    datab(10) TYPE c,
    datbi(10) TYPE c,
    text(100) TYPE c,
    END OF type_error.
    ****For error Messages
    TYPES : BEGIN OF type_mtab,
    matnr LIKE mara-matnr,
    msgtyp LIKE bdcmsgcoll-msgtyp,
    msgid LIKE bdcmsgcoll-msgid,
    msgnr LIKE bdcmsgcoll-msgnr,
    text(100) TYPE c,
    END OF type_mtab.
    ****Internal Table
    TYPES: BEGIN OF type_mvke,
    matnr LIKE mvke-matnr,
    vkorg LIKE mvke-vkorg,
    vtweg LIKE mvke-vtweg,
    END OF type_mvke.
    ****Internal Table
    TYPES : BEGIN OF type_tvkov,
    vkorg LIKE tvkov-vkorg,
    vtweg LIKE tvkov-vtweg,
    END OF type_tvkov.
    Declaring Internal Tables
    DATA : t_header TYPE STANDARD TABLE OF type_header,
    t_item TYPE STANDARD TABLE OF type_item,
    t_mvke TYPE STANDARD TABLE OF type_mvke,
    t_tvkov TYPE STANDARD TABLE OF type_tvkov,
    t_error TYPE STANDARD TABLE OF type_error,
    t_mtab TYPE STANDARD TABLE OF type_mtab.
    Work Area Declaration.
    DATA : wa_header LIKE LINE OF t_header,
    wa_item LIKE LINE OF t_item,
    wa_error LIKE LINE OF t_error,
    wa_mtab LIKE LINE OF t_mtab,
    wa_tvkov LIKE LINE OF t_tvkov,
    wa_mvke LIKE LINE OF t_mvke.
    *Rows for Table with Excel Data*******
    DATA: t_xls_file LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    ***Constant.
    DATA : c_params LIKE ctu_params.
    DATA : c_ans(1) TYPE c.
    DATA : v_count(4) TYPE c. " To show No.of records
    DATA : bdctab LIKE bdcdata OCCURS 10 WITH HEADER LINE. " BDCDATA
    DATA : tmess_mtab LIKE bdcmsgcoll OCCURS 10 WITH HEADER LINE.
    SELECTION SCREEN
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS : p_fname LIKE rlgrap-filename OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    END OF SELECTION SCREEN.
    DATA : repid LIKE sy-repid.
    DATA : v_matnr(50) TYPE c, "used for line items
    v_kbetr(50) TYPE c, "used for line items
    v_dat1(50) TYPE c, "used for line items
    v_dat(50) TYPE c. "used for line items
    DATA : v_lindx(5) TYPE n ,"index counter for first 14 records.
    v_lindx1(5) TYPE n VALUE '01', "index counter for 13 records.
    v_item(5) TYPE c, "To increment the line index
    v_pgedwn2 TYPE i . "For Pagedown Counter
    DATA: v_currentrow TYPE i. "For Current Row
    DATA v_bdc(50) TYPE c." Text to apper in Confrim POPUP Window.
    ************AT SELECTION-SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_fname.
    PERFORM get_filename USING p_fname.
    *************START-OF-SELECTION
    START-OF-SELECTION.
    ******Values for Ctu_params to Transaction
    c_params-defsize = 'X'.
    c_params-dismode = 'N'.
    c_params-updmode = 'S'.
    ******Refresh
    PERFORM f_refresh.
    *********To upload File.
    PERFORM upload_file.
    ****User Confrimation only BDC will Process
    IF c_ans = '1'.
    *** BDC Process.
    PERFORM read_data.
    ELSE.
    FORMAT COLOR 3 INTENSIFIED .
    WRITE:/ 'Selected not to Process the Upload'.
    EXIT.
    ENDIF.
    ******On completion of Process Refresh the Internal Table
    REFRESH : t_xls_file,
    t_header,
    t_item,
    t_mvke,
    t_tvkov.
    CLEAR : t_xls_file,
    wa_header,
    wa_item,
    wa_mvke,
    wa_tvkov.
    ***********Display Messages
    WRITE : /01 'Status',19 'Status Text'.
    WRITE AT 0(150) sy-uline.
    LOOP AT t_mtab INTO wa_mtab.
    WRITE :/01 wa_mtab-msgtyp,19 wa_mtab-text.
    ENDLOOP.
    SKIP 2.
    SORT t_error BY matnr.
    WRITE AT 0(150) sy-uline.
    WRITE 'ERROR MESSAGES'.
    WRITE AT 0(150) sy-uline.
    WRITE :/01 'Material.No',20 'Status Text'.
    WRITE AT 0(150) sy-uline.
    LOOP AT t_error INTO wa_error WHERE matnr NE ' '.
    WRITE:/01 wa_error-matnr,20 wa_error-text.
    ENDLOOP.
    *& Form get_filename
    text
    -->P_FILENAME text
    FORM get_filename USING p_fname.
    *****To read the file from Presentation Server
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
    EXPORTING
    program_name = repid
    dynpro_number ! ; = syst-dynnr
    field_name = p_fname
    STATIC = ' '
    mask = '*.XLS'
    CHANGING
    file_name = p_fname
    EXCEPTIONS
    mask_too_long = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " get_filename
    *& Form upload_file
    text
    --> p1 text
    <-- p2 text
    FORM upload_file.
    DATA : frow VALUE 2 TYPE i,
    fcol VALUE 1 TYPE i,
    erow VALUE 10000 TYPE i,
    ecol VALUE 7 TYPE i,
    ecol1 VALUE 1 TYPE i,
    c_col1 TYPE i VALUE '0001',
    c_col2 TYPE i VALUE '0002',
    c_col3 TYPE i VALUE '0003',
    &nb! sp; c_col4 TYPE i VALUE '0004',
    c_col5 TYPE i VALUE '0005',
    c_col6 TYPE i VALUE '0006',
    c_col7 TYPE i VALUE '0007'.
    ***FM used to UPLOAD data from Flat file
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = p_fname
    i_begin_col = fcol
    i_begin_row = frow
    i_end_col = ecol
    i_end_row = erow
    TABLES
    intern = t_xls_file
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE e000.
    ENDIF.
    ****T_XLS_FILE is initial, stop the process & throw message
    IF t_xls_file[] IS INITIAL.
    FORMAT COLOR 6 ON INTENSIFIED ON.
    WRITE:/ 'No Data Exists '.
    FORMAT COLOR OFF INTENSIFIED OFF.
    STOP.
    ELSE.
    Sort table by rows and colums
    SORT t_xls_file BY row col.
    Get first row retrieved
    READ TABLE t_xls_file INDEX 1.
    Set first row retrieved to current row
    v_currentrow = t_xls_file-row.
    **Loop to move data in internal Table
    LOOP AT t_xls_file .
    Reset values for next row
    IF t_xls_file-row NE v_currentrow.
    APPEND wa_header TO t_header.
    CLEAR wa_header.
    v_currentrow = t_xls_file-row.
    ENDIF.
    CASE t_xls_file-col.
    WHEN c_col1. "Kschl
    wa_header-kschl = t_xls_file-value.
    WHEN c_col2. "Vkorg
    wa_header-vkorg = t_xls_file-value.
    WHEN c_col3. "vtweg
    wa_header-vtweg = t_xls_file-value.
    WHEN c_col4. "Matnr
    wa_header-matnr = t_xls_file-value.
    WHEN c_col5. "Kbetr
    wa_header-kbetr = t_xls_file-value.
    WHEN c_col6. "FROm
    wa_header-datab = t_xls_file-value.
    WHEN c_col7. "TO
    wa_header-datbi = t_xls_file-value.
    ENDCASE.
    ENDLOOP.
    APPEND wa_header TO t_header.
    CLEAR wa_header.
    ENDIF.
    ****To process the data
    PERFORM f_process.
    ENDFORM. " upload_file
    *& Form READ_DATA
    text
    --> p1 text
    <-- p2 text
    FORM read_data.
    ****To make Uniq Records in Header Level
    SORT t_header BY kschl vkorg vtweg.
    DELETE ADJACENT DUPLICATES FROM t_header COMPARING
    kschl vkorg vtweg .
    SORT t_item BY vkorg vtweg matnr.
    DATA : wa1_item TYPE type_item.
    DATA : l_cnt TYPE i.
    DATA : flag(1) TYPE c. "to process the Line item.
    ***Looping Header Table.
    LOOP AT t_header INTO wa_header.
    PERFORM bdc_dynpro US! ING 'SAPMV13A' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RV13A-KSCHL'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=ANTA'.
    PERFORM bdc_field USING 'RV13A-KSCHL'
    wa_header-kschl.
    PERFORM bdc_dynpro USING 'SAPLV14A' '0100'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'RV130-SELKZ(03)'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=WEIT'.
    PERFORM bdc_field USING 'RV130-SELKZ(03)'
    'X'.
    PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
    PERFORM bdc_field USING 'BDC_CURSOR'
    'KOMG-VKORG'.
    PERFORM bdc_field USING 'KOMG-VKORG'
    wa_header-vkorg.
    PERFORM bdc_field USING 'KOMG-VTWEG'
    wa_header-vtweg.
    ****To handle Line Items.
    LOOP AT t_item INTO wa1_item WHERE vkorg = wa_header-vkorg AND
    vtweg = wa_header-vtweg.
    wa_item = wa1_item.
    ******Flag Set only After processing first 14 records .
    IF flag = ' '.
    v_lindx = v_lindx + 01.
    SHIFT v_lindx LEFT DELETING LEADING '0'.
    v_item = v_lindx .
    CONCATENATE 'KOMG-MATNR(' v_item ')' INTO v_matnr.
    PERFORM bdc_field USING v_matnr
    wa_item-matnr.
    CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
    PERFORM bdc_field USING v_kbetr
    wa_item-kbetr.
    CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
    PERFORM bdc_field USING v_dat
    wa_item-datab.
    CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
    PERFORM bdc_field USING v_dat1
    wa_item-datbi.
    IF v_item = 14.
    flag = 'X'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=P+'.
    PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
    CLEAR v_lindx.
    CLEAR v_item.
    CONTINUE.
    ENDIF.
    ENDIF.
    ***Flag is Set after Processing of 14 records.
    TO process rest of Records
    IF flag = 'X'.
    v_pgedwn2 = v_pgedwn2 + 1.
    v_lindx1 = v_lindx1 + 01.
    SHIFT v_lindx1 LEFT DE! LETING LEADING '0'.
    v_item = v_lindx1 .
    CONCATENATE 'KOMG-MATNR(' v_it! em ')' INTO v_matnr.
    PERFORM bdc_field USING v_matnr
    wa_item-matnr.
    CONCATENATE 'KONP-KBETR(' v_item ')' INTO v_kbetr.
    PERFORM bdc_field USING v_kbetr
    wa_item-kbetr.
    CONCATENATE 'RV13A-DATAB(' v_item ')' INTO v_dat.
    PERFORM bdc_field USING v_dat
    wa_item-datab.
    CONCATENATE 'RV13A-DATBI(' v_item ')' INTO v_dat1.
    PERFORM bdc_field USING v_dat1
    wa_item-datbi.
    IF v_pgedwn2 = 13.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '/00'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=P+'.
    PERFORM bdc_dynpro USING 'SAPMV13A' '1004'.
    v_pgedwn2 = 0.
    v_lindx1 = 1.
    CLEAR v_item.
    CONTINUE.
    ENDIF.
    ENDIF.
    ENDLOOP.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=SICH'.
    Calling Transaction after Processing All items.
    CALL TRANSACTION 'VK11' USING bdctab
    OPTIONS FROM c_params MESSAGES INTO tmess_mtab.
    REFRESH bdctab.
    CLEAR : bdctab.
    CLEAR : wa_item.
    CLEAR : wa1_item.
    CLEAR : wa_header.
    CLEAR : l_cnt.
    CLEAR : v_lindx1.
    CLEAR: v_pgedwn2,v_lindx.
    LOOP AT tmess_mtab .
    l_cnt = l_cnt + 1.
    READ TABLE t_item INTO wa_item INDEX l_cnt .
    CALL FUNCTION 'MASS_MESSAGE_GET' "To get the Message Text
    EXPORTING
    arbgb = tmess_mtab-msgid
    msgnr = tmess_mtab-msgnr
    msgv1 = tmess_mtab-msgv1
    msgv2 = tmess_mtab-msgv2
    msgv3 = tmess_mtab-msgv3
    msgv4 ! = tmess_mtab-msgv4
    IMPORTING
    msgtext = wa_mtab-text
    EXCEPTIONS
    message_not_found = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    wa_mtab-matnr = wa_item-matnr.
    wa_mtab-msgtyp = tmess_mtab-msgtyp.
    wa_mtab-msgid = tmess_mtab-msgid.
    wa_mtab-msgn! r = tmess_mtab-msgnr.
    APPEND wa_mtab TO t_mtab.
    CLEAR wa_mtab-text.
    CLEAR wa_item.
    ENDLOOP.
    ENDLOOP.
    ENDFORM. " READ_DATA
    *& Form BDC_DYNPRO
    text
    -->P_0300 text
    -->P_0301 text
    Start new screen *
    FORM bdc_dynpro USING program dynpro.
    CLEAR bdctab.
    bdctab-program = program.
    bdctab-dynpro = dynpro.
    bdctab-dynbegin = 'X'.
    APPEND bdctab.
    ENDFORM. " BDC_DYNPRO
    *& Form BDC_FIELD
    text
    -->P_0305 text
    -->P_WA_HEADER_KSCHL text
    Insert field *
    FORM bdc_field USING fnam fval.
    CLEAR bdctab.
    bdctab-fnam = fnam.
    bdctab-fval = fval.
    APPEND bdctab.
    ENDFORM. " BDC_FIELD
    *& Form bdc_trc_ansaction
    text
    -->P_0527 text
    *& Form f_Process
    text
    --> p1 text
    <-- p2 text
    FORM f_process.
    DATA : l_todate(12) TYPE c,
    l_frdate(12) TYPE c.
    ***Select for all entries of material in Header "Flat File Materials".
    IF NOT t_header[] IS INITIAL.
    SELECT matnr vkorg vtweg FROM mvke INTO TABLE t_mvke FOR ALL ENTRIES
    IN t_header WHERE matnr = t_header-matnr AND
    vkorg = t_header-vkorg AND
    vtweg = t_header-vtweg.
    ENDIF.
    *********select Sales.org & Dist.channel.
    IF NOT t_header[] IS INITIAL.
    SELECT vkorg vtweg FROM tvkov INTO TABLE t_tvkov FOR ALL ENTRIES IN
    t_header WHERE vkorg = t_header-vkorg
    AND vtweg = t_header-vtweg.
    ENDIF.
    ***Checking for material in Sales Master Table
    SORT t_mvke BY matnr vkorg vtweg.
    SORT t_tvkov BY vkorg vtweg.
    LOOP AT t_header INTO wa_header.
    READ TABLE t_mvke INTO wa_mvke WITH KEY matnr = wa_header-matnr
    vkorg = wa_header-vkorg
    ! ; vtweg = wa_header-vtweg BINARY SEARCH.
    IF sy-subrc <> 0.
    wa_error = wa_header.
    &nb! sp; MOVE text-011 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ELSE.
    ********Date Validations
    IF ( wa_header-datab NE ' ! ; ' AND wa_header-datbi NE ' ' ) .
    l_todate = wa_header-datab.
    l_frdate = wa_header-datbi.
    REPLACE '.' INTO l_toda! te WITH ''.
    REPLACE '.' INTO l_todate WITH ''.
    CONDENSE l_todate NO-GAPS.
    REPLACE '.' INTO l_frdate WITH ''.
    REPLACE '.' INTO l_frdate WITH ''.
    CONDENSE l_frdate NO-GAPS.
    IF l_frdate < l_todate.
    wa_error = wa_header .
    MOVE text-012 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ENDIF.
    ELSE.
    wa_error = wa_header .
    MOVE text-016 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ENDIF.
    ENDIF.
    ********Rate Validation.
    IF wa_header-kbetr = ' '.
    wa_error = wa_header .
    MOVE text-017 TO wa_error-text.
    APPEND wa_error TO t_error.
    DELETE TABLE t_header FROM wa_header.
    ENDIF.
    READ TABLE t_tvkov INTO wa_tvkov WITH KEY vkorg = wa_header-vkorg
    BINARY SEARCH.
    IF sy-subrc = 0.
    READ TABLE t_tvkov INTO wa_tvkov WITH KEY vtweg = wa_header-vtweg
    BINARY SEARCH.
    IF sy-subrc <> 0.
    wa_error = wa_header.
    MOVE text-015 TO wa_error-text.
    WRITE wa_header-vtweg TO wa_error-text+13(4).
    APPEND wa_error TO t_error.
    ENDIF.
    ELSE.
    wa_error = wa_header.
    MOVE text-013 TO wa_error-text.
    WRITE wa_header-vkorg TO wa_error-text+9(4).
    APPEND wa_error TO t_error.
    ENDIF.
    CLEAR wa_header.
    ENDLOOP.
    *****Deleting Duplicate Material Form Header "Flat File Data".
    SORT t_header BY kschl vkorg vtweg matnr.
    DELETE ADJACENT DUPLICATES FROM t_header COMPARING
    kschl! vkorg vtweg matnr .
    ****Data Moving from Header to Item Level.
    t_item[] = t_header[].
    *To count No.of records in Item Table.
    DESCRIBE TABLE t_item LINES v_count.
    CONCATENATE text-014 ' ' v_count INTO v_bdc.
    ****Popup to get Confirmation from user to process BDC
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    titlebar = 'Confirmation of File Data'
    text_question = v_bdc
    text_button_1 = 'Confirm'
    text_button_2 = 'Cancel Run'
    default_button = '1'
    IMPORTING
    answer = c_ans.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-! MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM. " f_Process
    *& Form f_Refresh
    text
    --> p1 text
    <-- p2 text
    FORM f_refresh.
    REFRESH : t_xls_file,
    t_header,
    t_item,
    t_mvke,
    t_tvkov,
    t_error,
    t_mtab.
    CLEAR : t_xls_file,
    wa_header,
    wa_item,
    wa_mvke,
    wa_tvkov,
    wa_error,
    wa_mtab.
    ENDFORM. " f_Refresh
    ALSO PLEASE CHECK OUT
    sample code for call transaction method
    http://www.sapdevelopment.co.uk/bdc/bdc_ctcode.htm
    chk this for BDC recording with screen shots
    http://www.sapdevelopment.co.uk/bdc/bdc_recording.htm
    BDC
    http://www.sap-img.com/bdc.htm
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    best typical example is BDC for MM01
    check the below links for the same
    bdc for MM01.
    mm01
    bdc mm01
    BDC
    http://www.sap-img.com/bdc.htm
    http://www.guidancetech.com/people/holland/sap/abap/zzsni001.htm
    http://www.sappoint.com/abap/bdcconcept.pdf
    Difference between Genrate session& Call transaction
    Re: Steps in BDC

  • Simple doubt in BDC  Call Transaction Method

    Hi Friends,
      When i try to call vk13 transaction and pass the screen field values for the second screen and execute it it is displaying properly.But when i try to pass the different value in the bcddata internal table it is changing properly but in the screen it not updating that value.Alawly the screen fields are taking the values passed the first time.But in the internal table which we are oassing to the calltransaction it is changing correctly but not in the corresponding screen fields. Why it is happening so. Can any one help me out of this problem.
    Thanks in Advance.

    I am not passing through the selection screen . It is like iteractive report. when i select the particular line in the list output then the screen fields should take the values from that selected line. First time when i select the line it is taking properly.
    But next time when i select the line the content of the i_bdc_tbl is changing correctly but when it enter in to the transaction it is not taking the values from the i_bdc_tbl. Simply it is displaying the screen fields with the old values. It is not updating the screen fields with the values from the i_bdc_tbl. Why the screen fields are not replaced with the value of i_bdc_tbl? Why it is not getting refreshed with the new values?
    Just i am posting the bdc portion of my code here. So you can help me out on this.
    AT LINE-SELECTION.
      SELECT SINGLE kozgf FROM t685 INTO v_kozgf
                          WHERE kschl = wa_report-kschl.
      SELECT kolnr kotabnr FROM t682i INTO TABLE i_t682i
                     WHERE kozgf = v_kozgf.
      SORT i_t682i BY kolnr.
      READ TABLE i_t682i WITH KEY kotabnr = wa_report-tabna+1(3)
           TRANSPORTING NO FIELDS.
      CHECK sy-subrc = 0.
      v_index = sy-tabix.
      REFRESH i_bdc_tbl.
      l_tabix = '01'.
      PERFORM f_vk13.
      CONCATENATE 'RV13' wa_report-tabna  INTO v_bdc_val_field.
      PERFORM bdc_dynpro      USING v_bdc_val_field '1000'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'F004-LOW'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=ONLI'.
      CREATE DATA v_rec  TYPE (wa_report-tabna).
      ASSIGN v_rec->* TO <wa_table>.
      SELECT SINGLE *  FROM (wa_report-tabna) INTO <wa_table>
      WHERE kschl = wa_report-kschl AND matnr = wa_report-matnr AND knumh = wa_report-objectid.
      CALL FUNCTION 'DDIF_FIELDINFO_GET'
        EXPORTING
          tabname        = wa_report-tabna
        TABLES
          dfies_tab      = lwa_tabna
        EXCEPTIONS
          not_found      = 1
          internal_error = 2
          OTHERS         = 3.
      READ TABLE lwa_tabna WITH KEY fieldname = 'KSCHL'.
      p1 = sy-tabix + 1.
      READ TABLE lwa_tabna WITH KEY fieldname = 'MATNR'.
      p2 = sy-tabix.
      LOOP AT lwa_tabna.
        v_field = lwa_tabna-fieldname.
        IF lwa_tabna-position BETWEEN p1 AND p2.
          ASSIGN COMPONENT lwa_tabna-position OF STRUCTURE <wa_table> TO <fld>.
          PERFORM f_vk13_s2 USING lwa_tabna-fieldname <fld>.
        ENDIF.
      ENDLOOP.
      PERFORM bdc_field       USING 'RV130-DATAM'
                                       wa_report-fdate_value_new.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    'ONLI'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'F001'.
      CALL TRANSACTION 'VK13' USING i_bdc_tbl
                              MODE  'A'.
    FORM f_vk13.
      DATA: l_tabix(2) TYPE c.
    *Condition type
      PERFORM bdc_dynpro      USING 'SAPMV13A' '0100'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RV13A-KSCHL'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM bdc_field       USING 'RV13A-KSCHL'
                                     wa_report-kschl.
    *Key combination
      PERFORM bdc_dynpro      USING 'SAPLV14A' '0100'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RV130-SELKZ(01)'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=WEIT'.
      PERFORM bdc_field       USING 'RV130-SELKZ(01)'
      l_tabix = v_index.
      SHIFT l_tabix RIGHT.
      OVERLAY l_tabix WITH '00'.
      CONCATENATE 'RV130-SELKZ(' l_tabix ')' INTO v_bdc_field.
      PERFORM bdc_field       USING v_bdc_field
                                    'X'.
    ENDFORM.                                                    "f_vk13
          FORM BDC_DYNPRO
          This form accepts the program name and screen number
          and places the values into the I_BDC_TBL internal table.
    FORM bdc_dynpro USING program dynpro.
      CLEAR wa_bdc_tbl.
      wa_bdc_tbl-program  = program.
      wa_bdc_tbl-dynpro   = dynpro.
      wa_bdc_tbl-dynbegin = 'X'.
      APPEND wa_bdc_tbl TO i_bdc_tbl.
    ENDFORM.                    "BDC_DYNPRO
          FORM F_BDC_FIELD
        This form accepts the field name and the corresponding value
        for that field and places them into the I_BDC_TBL internal table.
    FORM bdc_field USING fnam fval.
      CLEAR wa_bdc_tbl.
      MOVE fnam TO wa_bdc_tbl-fnam.
      MOVE fval TO wa_bdc_tbl-fval.
      APPEND wa_bdc_tbl TO i_bdc_tbl.
    ENDFORM.                    "BDC_FIELD
    *&      Form  f_vk13_s2
          text
    -->  p1        text
    <--  p2        text
    FORM f_vk13_s2 USING p_fieldname p_fld.
      CONCATENATE wa_report-tabna '-' p_fieldname INTO v_bdc_val_field.
      CHECK NOT p_fld IS INITIAL.
      PERFORM bdc_field USING v_bdc_val_field p_fld.
    ENDFORM.                                                    " f_vk13_s2
    Thanks.

  • Simple example of mobile agent

    Hi,
    I'm studing mobile agent in java rmi,but I can't understand them because I haven't any example.Please,can you give a simple example of mobile agent in java rmi?
    Thanks very much,Filippo

    Hi,
    I'm studing mobile agent in java rmi,but I can't understand them because I haven't any example.Please,can you give a simple example of mobile agent in java rmi?
    Thanks very much,Filippo

  • Explaination and a simple example on TagExtraInfo class anyone ??

    Hi Guys,
    Could anyone please explain the concept of TagExtraInfo class and give a simple example with code. This one is really urgent !!
    Thanks
    Rasmeet

    Is this a genuine forum topic ? Or are we seeing the birth of some new encrytion algorithm here.
    Assuming its the former,...
    Have you seen http://java.sun.com/j2ee/tutorial/doc/JSPTags5.html#68067

  • Does anybody can give me a simple example about the labview programme calling dll ?

      Does anybody can give me a simple example about the labview programme calling dll ?And the dll is also writed  by using labview .I just want to study  the process of the labview programme calling dll file.Thank you!

    Hi,
    Please click on "Find Examples" in the "Getting Started Window"
     A window named "NI Example Finder" will pop up.
     In this go to "Search" tab
    Type "DLLs"
    You will see a lot of examples. 
    If you're online, you'll see user examples too...

  • Can someone give me an example of a very simple launchd.plist file that...

    Launches an agent and allows the agent general internet access?
    I have this simple plist but what happens is that launchd launches it and then kills it (abort) and then launches it again and does the same thing 10 times and quits. I have traced the 'action' that causes this. As soon as my app tries to get a socket and connect, it is killed.
    I did put in a socket thing in the launchd plist file, but then it seems that launchd answers the call, not the thing I want to, then my app gets stuck on a recv call thinking it has sent data to a server and is waiting for an answer which will never come.
    I do not know if they have these for macs (I am sure they do), but imagine a tool like ICQ or Instant Messenger. It loads when the user logs on, you have your contacts list, and it coordinates via some foreign server, although once a match is made direct connects to person you are chatting with.
    How would you launch an agent like that? I can't figure out the plist entries needed. I can either launch my app and have it get "locked" by a recv call cause launchd answered the connect, and accepted the send, or I can remove the socket stuff and get in this cycle of launches and aborts.
    A simple example would be of great help.

    An object is a good way to implement this. For the first, the object would look like this:
    var oT1 = {
        "5" : 0.1,
        "50" : 2,
        "75" : 6,
        "100" : 12
    To get the value associated with the 100 property, the code would look something like:
    var val = oT1["100"];
    The variable "val" would then contain the number 12.
    For the second, the value of each object property could be an array, something like:
    var oT2 = {
        "Debbie" : [5, 0, 16],
        "Carl" : [0, 20, 4],
        "Josh" : [2, 8, 19]
    To get the second item in the array for the "Josh" array, the code would look like:
    var val = oT2["Josh"][1];
    To get the last item in the "Debbie" array, you could do this:
    var val = oT2["Debbie"][2];
    Array indexes are zero-based, so the second item has an index of 1, third item is 2, etc..
    Good luck

  • What is BDC and LSMW? Difference

    Dear experts!
    Explore the concept of BDC and LSMW and their difference.
    Merits/Demerits.
    Transactions used for executing and viewing the same.
    Rishi.

    Rishi,
    Hope these links help you:
    http://sap-img.com/bdc.htm
    http://sap-img.com/sap-data-migration.htm
    http://sap-img.com/sap-data-migration.htm
    https://websmp206.sap-ag.de/lsmw
    <b>LSMW</b>
    Data Migration from Non-SAP Systems to SAP systems* Made Easy
    The LSM Workbench is an SAP R/3 based tool that supports the one-time or periodic transfer of data from non-SAP systems ("legacy systems") to SAP systems.
    The LSM Workbench helps you to organize your data migration project and guides you through the process by using a clear sequence of steps.
    The most common conversion rules are predefined. Reusable conversion rules assure consistent data conversion for different data objects.
    The LSM Workbench covers the following steps:
    Read the legacy data from one or several files (e.g. spreadsheet tables, sequential files).
    Convert the data from source format to target format.
    Import the data using standard interfaces (Batch Input, Direct Input, BAPI, IDoc).
    Detailed Information
    Objectives
    High Flexibility to Ensure the Optimal Solution
    The Data Transfer Workbench gives you control of the SAP data transfer interfaces: from proven batch input, through very fast direct input, to Business APIs (BAPIs), which are also suitable for permanent interfaces. This solution is sufficient if certified partner products are available for the transfer of open interfaces, or if you explicitly want to do interface programming in ABAP or the language of the legacy system. SAP provides its customers with the Legacy System Migration (LSM) Workbench, which dramatically reduces the considerable expenditure involved in individual programming. This tool makes it possible to transfer data without any programming. You define the rules for the changeover. The LSM Workbench then uses this definition to generate an ABAP program and thus gives you considerable support during the migration.
    Description
    Data Migration Controlled by your SAP System
    In contrast to many conventional approaches, the solution described here is a component of your SAP system. As a result it is no longer necessary to program in a number of different systems. All you need are basic unloading programs in the legacy system, or, alternatively, existing data interfaces can be used. Everything else takes place in the SAP system. With SAP R/3 Release 4.6C the LSM Workbench is also integrated into the Data Transfer Workbench, and can be called up there.
    Maximum Quality
    Data migration with the Data Transfer Workbench and the LSM Workbench guarantees maximum quality and consistency of your data in the SAP system. When data is imported, the system performs the same checks as it does during online entry. The update in your database is performed through the Standard Batch Input Program, the Standard Direct Input Program, IDOC interfaces, and R/3 System BAPIs.
    Proven Concepts
    SAP has already gathered over seven years of migration experience with its own products. The LSM Workbench has been developed on the basis of experience gained with the R/2-R/3 Migration Workbench. In the meantime, the LSM Workbench has also been successfully used over 500 times in the migration of legacy systems to R/3.Concepts and techniques that have proven their worth form the backbone of the LSM Workbench:
    Transfer of business data objects (such as material master data) instead of individual tables
    Definition of flexible conversion rules that are adapted as part of migration customizing
    Automatic generation of a conversion program
    Synergy Effects through Uniform Procedures
    SAP's experience shows that certain algorithms and techniques appear over and over again during data conversion projects. These techniques have been standardized in the LSM Workbench and can be called at the touch of a button. With this concept of central rules you can ensure, for example, that your vendor numbers are converted in the same way in both your vendor master data and in your purchase orders. This uniform procedure guarantees the consistency of your data and captures synergy effects in cases where you need to migrate data from disparate legacy systems.
    Importing Data from PCs
    More and more medium-sized firms are implementing SAP solutions, and many of them have their legacy data in desktop programs. In this case, the data is exported in a format that can be read by PC spreadsheet systems. As a result, the data transfer is mere child's play: Simply enter the field names in the first line of the table, and the LSM Workbench's import routine automatically generates the input file for your conversion program.
    Data Verification before Update in the Database
    The LSM Workbench lets you check the data for migration against the current settings of your customizing. The check is performed after the data migration, but before the update in your database.
    Substantial Reduction of Effort
    SAP's experiences show that using the Data Transfer Workbench in conjunction with the LSM Workbench can reduce the effort required for data migration by 30% and more.
    Project Library - A Knowledge Database
    The LSM Workbench is a learning tool: The experience gained in other implementation projects is continually fed into the LSM Workbench, where it directly benefits your project.

  • Looking for a simple example of the Minimax algorithm in java

    Hey everyone,
    I'm currently working on a Gameboy emulator program as a pet project, and for one of the game's I'd like for the enemy AI to use the Minimax algorithm, but I don't have any experience with it (or recursion in general, for that matter). Could anyone maybe post a simple example of how this algorithm works?

    WTF? I'm sure you can find plenty of examples on google. It's on you to take the time to go through them, study them, and, if you still don't understand something, post a clear, concrete question that indicates what you read and what you didn't understand about it.
    As is, you're essentially treating folks here as your research flunkies and saying, "Give me an example that's better than all the ones already easily available to me. Read my mind to know why I didn't like them."

  • Can't get "Simple Example Doclet" to run -- Cannot find

    I am trying to run the "Simple Example Doclet" at http://java.sun.com/j2se/1.3/docs/tooldocs/javadoc/overview.html.
    It appears to compile ok, but when I go to run it I get the message "javadoc: Cannot find doclet class ListClass".
    Listed below is:
         1. The execution command and error message
         2. The version (output of javadoc -J-version)
         3. The javac compile command and input and output files
    All directories have been kept the same as in the example.
    Any help would be appreciated.
    Thanks
    1. C:\jdk1.3>javadoc -doclet ListClass -classpath C:\jdk1.3\lib\tools.jar MyClass.java
    javadoc: Cannot find doclet class ListClass
    1 error
    2. javadoc -J-version
         gives
              java version "1.3.1_01"
              Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
              Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode).
    3. javac -classpath C:\jdk1.3\lib\tools.jar ListClass.java
         appears to give good compile ....
              e. g. Input source file ListClass.java is as follows:
                   import com.sun.javadoc.*;
                   public class ListClass {
                   public static boolean start(RootDoc root) {
                   ClassDoc[] classes = root.classes();
                   for (int i = 0; i < classes.length; ++i) {
                   System.out.println(classes);
                   return true;
              and.....
              decompiled ListClass.class file is as follows:
                   // Decompiled by DJ v2.8.8.54 Copyright 2000 Atanas Neshkov Date: 10/11/2001 4:09:46 PM
                   // Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
                   // Decompiler options: packimports(3)
                   // Source File Name: ListClass.java
                   import com.sun.javadoc.RootDoc;
                   import java.io.PrintStream;
                   public class ListClass
                   public ListClass()
                   public static boolean start(RootDoc rootdoc)
                   com.sun.javadoc.ClassDoc aclassdoc[] = rootdoc.classes();
                   for(int i = 0; i < aclassdoc.length; i++)
                   System.out.println(aclassdoc[i]);
                   return true;

    Sorry to be so late in getting back to you .. I was on vacation.
    ListClass is in the current directory. I did get it to work however... In order to get it to work I had to do two things:
    1. use -docletpath (even thought it was in the current path) e. g. -docletpath C:\jdk1.3\ListClass.jar
    AND
    2. Make the class file a jar file -- I could not get it to work otherwise.
    p.s. the typo was a decompiler error.

  • Simple example of chat

    I am needing a simple example of chat made with spry…
    using an archive xml I am not obtaining to bring up to date the
    messages!

    You can do it with a $1000 dollar server, and much much much more, just not Adobe's $1000 dollar "server".
    I would have to say that I have yet to come across even one client that wasn't completely pissed off when they bought the streaming version and realized how little it does. I can't even imagine how many support calls have gone in to Adobe for either a full refund or an upgrade to a now extremely disgruntled customer. It's a shame, gives FMS and Adobe a bit of a bad name despite the amazing product FMIS is.

  • I need an simple example on java-Oracle8i entreprise

    Hi,
    Could anyone give me an simple example of a Java method which will be loaded into Oracle.
    Let say, the method will read the email address based on employee_ID from a table called Employee. Thank you very much for all your help.
    Hellenie
    PS: I would like to see java code and to see how it could call a table without having to deal with connection object ,statement,etc...
    null

    This is the example from the Oracle's 8.1.6 Documentation - Java Stored pocedures Developer's guide -
    step 1 :
    import java.sql.*;
    import java.io.*;
    import oracle.jdbc.driver.*;
    public class RowCounter {
    public static int rowCount (String tabName) throws SQLException {
    Connection conn = new OracleDriver().defaultConnection();
    // here is the connection made
    String sql = "SELECT COUNT(*) FROM " + tabName;
    int rows = 0;
    try {
    Statement stmt = conn.createStatement();
    ResultSet rset = stmt.executeQuery(sql);
    // same old createStatement, executeQuery ...
    while (rset.next()) {rows = rset.getInt(1);}
    rset.close();
    stmt.close();
    } catch (SQLException e) {System.err.println(e.getMessage());}
    return rows;
    Step 2:
    use loadjava command line utility and
    specify the class name, username/password to
    load the code into the database.
    step 3:
    On sql prompt, the class and method name are
    mapped to stored procedure
    CREATE FUNCTION row_count (tab_name VARCHAR2) RETURN NUMBER
    AS LANGUAGE JAVA
    NAME 'RowCounter.rowCount(java.lang.String) return int';
    You can invoke the procedure using CALL method from SQL prompt.
    Cheers,
    Adithya
    null

  • HELP: JSP simple examples

    Hi:
    i am a newbie to JSP and am trying to come up with few SIMPLE example JSP pages QUICKLY e.g.
    -using URL variables
    -form submission
    -email
    etc.
    could you give reference to simple code or tutorial which covers it.
    appreciate your help
    -Z

    Did you try downloading Tomcat and running through their examples? They're pretty elementary, show all the examples you mention (including an email example) and show the source code.
    Download/install Tomcat, get it running, and go to http://localhost:8080/examples/jsp/ for the JSP examples.

  • Bdc and lsmw

    Hi All,
    I am presuming that both bdc's and lsmw are being used for data migration. if this is right then when would someone prefer bdc over lsmw or vice versa. if my assumption is wrong then tell me for what specifications we use lsmw and for what specs we use a bdc.

    Hi,
    "The Data Transfer Workbench (or DX Workbench, transaction SXDA) is an integrated SAP tool that supports data transfer and analysis. It
    does not have the built-in features for mapping for source structures to target structures, but it will allow you to integrate Legacy System Migration Workbench (LSMW) objects as processing tasks within a run definition. The DX workbench has many features for creating
    test data and performing data migrations - for example, logging of data migration runs.
    However, if you need to map or convert data, you should use the LSMW. Or, you can integrate
    your LSMW objects as task within a more user-friendly data migration run, in which the LSMW
    project steps "Read data", "Convert data," and "Start IDoc processing" are automated
    and use the features of both tools. If you donot need logging and automated data migration
    runs, you can perform your data migration without the DX Workbench."
    The following was taken at this site :
    http://www.info-sun.com/docs/wp_sapinter.pdf
    “Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided since the early versions of R/3. BDC is not a
    typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and so it is not bi-directional.
    BDC works on the principle of simulating user input for transactional screen, via an ABAP program. Typically the input comes in the form
    of a flat file. The ABAP program reads this file and formats the input data screen by screen into an internal table (BDCDATA). The
    transaction is then started using this internal table as the input and executed in the background.
    In ‘Call Transaction’, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling.
    It can also be used for real-time interfaces and custom error handling & logging features. Whereas in Batch Input Sessions, the ABAP
    program creates a session with all the transactional data, and this session can be viewed, scheduled and processed (using
    Transaction SM35) at a later time. The latter technique has a built-in error processing mechanism too.
    Batch Input (BI) programs still use the classical BDC approach but doesn’t require an ABAP program to be written to format the
    BDCDATA. The user has to format the data using predefined structures and store it in a flat file. The BI program then reads this and
    invokes the transaction mentioned in the header record of the file.
    Direct Input (DI) programs work exactly similar to BI programs. But the only difference is, instead of processing screens they validate
    fields and directly load the data into tables using standard function modules. For this reason, DI programs are much faster (RMDATIND - Material Master DI program works at least 5 times faster) than the BDC counterpart and so ideally suited for loading large volume data. DI programs are
    not available for all application areas.
    Remote Function Call (RFC) in SAP R/3 is based on UNIX’s Remote Procedure Call (RPC). RFC enables the real-time link between different R/3 instances and can connect SAP to Non-SAP systems. With Remote Function Call, both inbound (RFCServer) and outbound (RFCClient) interfaces are possible.
    SAP also provides a toolkit called RFC API for non-SAP systems to interact with SAP’s Function modules remotely.
    RFC is a very powerful tool for interfacing with SAP system in real time. Most other interfacing techniques like ALE, EDI, BAPI etc… are
    inherently based on the RFC technology.
    Electronic Data Interchange (EDI) is the industry standard format for exchanging Business data. SAP uses a neutral format called Intermediate Document
    (IDoc) for communicating EDI & ALE messages.
    The IDoc interface contains data structures and processing logic for each of the business transaction. These are grouped as Message
    Types. The external EDI Server is responsible for receiving the EDI messages sent by the trading partners. These EDI messages are then
    mapped onto the IDoc structure fields and stored in the IDoc interface layer by SAP.
    EDI/IDoc supports both inbound and outbound interfaces. The IDocs received through the EDI Server can be configured to automatically get
    processed, or can be stored in the IDoc interface layer for a future manual or scheduled processing. The IDoc interface layer also has a powerful error
    handling, reporting, monitoring and reprocessingmechanism built into it (Transaction WEDI). IDoc is also tightly integrated with the WorkFlow system
    of SAP for initiating other business tasks upon receiving/sending EDI messages.
    The IDoc interface can be employed for non-SAP applications to load or extract data from SAP system. But typically, EDI / IDoc is engaged when
    SAP system is to be integrated with any of its business partners (Customers, Suppliers and other partners) for carrying out standard business
    transactions (like Create Sales orders, Sending Purchase orders to Suppliers, etc…).
    Application Link Enabling (ALE) is a middleware tool, which is part of SAP’s Business framework Architecture (BFA). ALE can effectively be used
    for loosely coupled Asynchronous communication between SAP systems and with non-SAP systems. ALE is based on the distributed processing
    architecture and hence integrates applications with the local database rather than centralized one. ALE messages are based on the Intermediate
    Document (IDoc) format, similar to the EDI counterpart. Though ALE can be used to interface with non-SAP systems, usually it is used to
    distribute Master & Transactional data between SAP R/3 instances.
    The ALE distribution can be based on,
    • Business APIs
    • IDoc Message Types"
    Business API (BAPI) is the most important component of SAP Business Framework. BAPI enables SAP and third party applications to interact and integrate
    with each other at the Business Object / Process level.

  • Explain User exit concept with simple example

    Hi friends
    I am new member of this forum & i am learning ABAP.
    Kindly send me user exit concept with simple example to my mail ID so i can able to use it.
    mail ID  [email protected]
    thanks in advance
    Thanks & Regards

    Code SE18 is used to Identify the BADI available.
    Look for the string 'CL_EXITHANDLER' in the standard program. This is a class which has a method 'GET_INSTANCE' which is used to trigger BADI's from the Standard Program. The interface parameter for this static method 'EXIT_NAME' is used to pass the BADI to the method.
    Open Standard Program and do a global search 'CL_EXITHANDLER'.
    SE18 > give the BADI name found through above search.
    CUSTOMER_ADD_DATA > which has a method SAVE_DATA.
    T.Code SE19 is used to Implement BADI.
    SE19 > give the implementation name > Give the Definition name as CUSTOMER_ADD_DATA and the Short Text.
    Intro.....
    http://help.sap.com/saphelp_nw04/helpdata/en/e6/d54d3c596f0b26e10000000a11402f/content.htm
    Check these links for info about badi..
    BADI's
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    BADI's
    http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://members.aol.com/_ht_a/skarkada/sap/
    http://www.ct-software.com/reportpool_frame.htm
    http://www.saphelp.com/SAP_Technical.htm
    http://www.kabai.com/abaps/q.htm
    http://www.guidancetech.com/people/holland/sap/abap/
    http://www.planetsap.com/download_abap_programs.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    http://www.esnips.com/web/BAdI
    http://www.allsaplinks.com/badi.html
    New to Badi
    check any fo the below links. this will def help u.
    http://www.allsaplinks.com/badi.html
    And also download this file....
    http://www.savefile.com/files.php?fid=8913854
    There are other tutorials on this site...
    http://sapbrain.com/Tutorials/tuto_download.html
    What are BAdIs?
    -> is an anticipated point of extension – these points act like sockets and exist in the original source code
    -> based on ABAP Objects. BAdI defines an interface that can be implemented by BAdI-implementations that are transport objects of their own
    ->Important! There are 2 roles: Enhancement Option-provider & Implementer.
    -> In the above context, Enhancement Implementation can be done only if option (hook) is provided by the Option-provider. In simple words there are no implicit BAdIs.
    Note: In the following slides, Definitions are created so as to understand the method of BAdI definition & for example purpose. As stated above this is the role of Enhancement Option-Provider.
    Classic BAdIs already exist since SAP Release 4.6
    BAdIs have been Re-implemented in ECC7.0 under the new Enhancement Framework & Switch Framework
    Classic BAdIs
    To understand what a powerful pattern a BAdI is, we will now define & then implement a BAdI
    BADI Class is created automatically.
    The various options are described below in detail:
    1. Enhanceable: Enhanceability of filter types can only be specified for filter-dependent BADI definitions under very special conditions. For example, the domain belonging to the filter type must be linked with a value table that is of the type E or G. A BADI implementation can then be created in one step by creating a new filter value that is automatically entered into the value table at save and also copied into the transport order of the BADI implementation. In addition, it is also possible to create a new filter value and, at the same time, a BADI implementation with the same name. Naturally, you can also specify existing filter values.
    You should select this feature if there is a prerequisite that a new filter value is created together with a new BADI implementation - that is, that BADI implementations are not created solely with existing filter values, although this, too, is possible.
    2. Multiple-Use
    3. Filter-Dependent
    Instance Methods can access all of the attributes of a class and can trigger all events of a class. Static Methods can only access static attributes and static events.
    Exceptions:
    Events:
    Events can be defined in classes or in interfaces. Corresponding methods can trigger these events with the RAISE EVENT statement. Each class (or interface) that is going to handle the corresponding event must implement a relevant handler method, and register it using the SET HANDLER statement. When an event occurs, the system calls all of the handler methods registered for that event.
    Like method definitions, events have a parameter interface. The only difference is that events may only have EXPORTING parameters.
    BADI : Businees Add IN's
    Business Add-Ins are SAP enhancement technique based on ABAP Objects.
    Where the SAP standard program is not going to fullfill the client requirement , we are going to add our own program to SAP standard program, without changing the standard prog.
    Each Business Add-In has
    – at least one Business Add-In definition
    – a Business Add-In interface
    – a Business Add-In class that implements the interface
    Each BADI has two different Views.
    1.Definition view
    2.Implementation view
    T.C for BADI Definition is SE18.
    T.C for BADI Implementation is SE19.
    There are multiple ways of searching for BADI.
    • Finding BADI Using CL_EXITHANDLER=>GET_INSTANCE
    • Finding BADI Using SQL Trace (TCODE-ST05).
    • Finding BADI Using Repository Information System (TCODE- SE84).
    1. Go to the Transaction, for which we want to find the BADI, take the example of Transaction VD02. Click on System->Status. Double click on the program name. Once inside the program search for ‘CL_EXITHANDLER=>GET_INSTANCE’.
    Make sure the radio button “In main program” is checked. A list of all the programs with call to the BADI’s will be listed.
    The export parameter ‘EXIT_NAME’ for the method GET_INSTANCE of class CL_EXITHANDLER will have the user exit assigned to it. The changing parameter ‘INSTANCE’ will have the interface assigned to it. Double click on the method to enter the source code.Definition of Instance would give you the Interface name.
    2. Start transaction ST05 (Performance Analysis).
    Set flag field "Buffer trace"
    Remark: We need to trace also the buffer calls, because BADI database tables are buffered. (Especially view V_EXT_IMP and V_EXT_ACT)
    Push the button "Activate Trace". Start transaction VA02 in a new GUI session. Go back to the Performance trace session.
    Push the button "Deactivate Trace".
    Push the button "Display Trace".
    The popup screen "Set Restrictions for Displaying Trace" appears.
    Now, filter the trace on Objects:
    • V_EXT_IMP
    • V_EXT_ACT
    Push button "Multiple selections" button behind field Objects
    Fill: V_EXT_IMP and V_EXT_ACT
    All the interface class names of view V_EXT_IMP start with IF_EX_. This is the standard SAP prefix for BADI class interfaces. The BADI name is after the IF_EX_.
    So the BADI name of IF_EX_CUSTOMER_ADD_DATA is CUSTOMER_ADD_DATA
    3. Go to “Maintain Transaction” (TCODE- SE93).
    Enter the Transaction VD02 for which you want to find BADI.
    Click on the Display push buttons.
    Get the Package Name. (Package VS in this case)
    Go to TCode: SE84->Enhancements->Business Add-inns->Definition
    Enter the Package Name and Execute.
    Here you get a list of all the Enhancement BADI’s for the given package MB.
    Have a look at http://help.sap.com/saphelp_nw04/helpdata/en/04/f3683c05ea4464e10000000a114084/content.htm
    http://help.sap.com/saphelp_erp2005/helpdata/en/73/7e7941601b1d09e10000000a155106/frameset.htm
    http://support.sas.com/rnd/papers/sugi30/SAP.ppt
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/abapindx.htm
    http://members.aol.com/_ht_a/skarkada/sap/
    http://www.ct-software.com/reportpool_frame.htm
    http://www.saphelp.com/SAP_Technical.htm
    http://www.kabai.com/abaps/q.htm
    http://www.guidancetech.com/people/holland/sap/abap/
    http://www.planetsap.com/download_abap_programs.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/content.htm
    /people/thomas.weiss/blog/2006/04/03/how-to-define-a-new-badi-within-the-enhancement-framework--part-3-of-the-series
    /people/thomas.weiss/blog/2006/04/18/how-to-implement-a-badi-and-how-to-use-a-filter--part-4-of-the-series-on-the-new-enhancement-framework
    How to develop BADI
    Rewards if useful.

Maybe you are looking for