Commit each record while insert using DB adapter

Hi,
I am working on an ESB process, wherein i use the DB adapter to insert multiple records into a table.
The ave count of records could easily be more that 50.
Appears, the default behaviour of the adapter is to commit only once after all records have been inserted. However, need is to commit each row as i insert it. Will help even if i can commit in batches of say, 10.
Please advice how this may be done.
Regards,
Sambhav.

The DBAdapter does this in single commit, so that a rollback can take place in case of failure.
You will need to use compensate activity if at all you want to commit mid way.
Is there any particular reason that you are looking to commit them in shorter batches?
Every Little Helps
Kalidass Mookkaiah
MyBlog

Similar Messages

  • Commit each record while insert

    Hi All,
    I am using ESB for my project.
    I have a requirement that I select multiple records from a database using a select operation, which need to be inserted into a local DB.
    Need is to commit each record as it writes into the local DB.
    becoz, assuming that I may select around 500 records from the souce, and while inserting,the 375th record fails, I would not want to roll back the other 374 records that are inserted, and also miss on the other remaining 125!
    Please advice how this can be done. Thanks in anticipation. Urgent need!
    Regards,
    Sambhav.

    The DBAdapter does this in single commit, so that a rollback can take place in case of failure.
    You will need to use compensate activity if at all you want to commit mid way.
    Is there any particular reason that you are looking to commit them in shorter batches?
    Every Little Helps
    Kalidass Mookkaiah
    MyBlog

  • How to commit each record in Oracle Form Personalization

    Hi,
    how to commit each record with out using save button in form...my requirement is when cursor goes to next record it vil automatically stored in database please give me your valuable suggestion...
    Actual Requirement:
    here we need to give the locators(it is  number) whenever the cursor goes to next record it vil automatically incremented by 1(i wrote query for incremetation) and previous one vil be stored in database.
    Here i am using WHEN NEW ITEM INSTANCE IS USED Trigger..
    Thank You,
    Regards,
    Putta

    Hi,
    The commit should be done by the form, or whatever raises the business event.
    The API fires the event in the same transaction (unless the subscription is deferred), and then the commit is issued. This commits the transaction, and all actions of the event subscription.
    If the subscription is deferred, then the concurrent request which processes the subscription will issue the commit on completion.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Avoiding duplicate records while inserting into the table

    Hi
    I tried the following insert statement , where i want to avoid the duplicate records while inserting itself
    but giving me the errror like invalid identifier, though the column exists in the table
    Please let me know Where i'm doing the mistake.
    INSERT INTO t_map tm(sn_id,o_id,txt,typ,sn_time)
       SELECT 100,
              sk.obj_id,
              sk.key_txt,
              sk.obj_typ,
              sysdate,
              FROM S_KEY sk
        WHERE     sk.obj_typ = 'AY'
              AND SYSDATE BETWEEN sk.start_date AND sk.end_date
              AND sk.obj_id IN (100170,1001054)
               and   not exists  (select 1
                                                                   FROM t_map tm1 where tm1.O_ID=tm.o_id
                                                                        and tm1.sn_id=tm.sn_id
                                                                        and tm1.txt=tm.txt
                                                                        and tm1.typ=tm.typ
                                                                        and tm1.sn_time=tm.sn_time )

    Then
    you have to join the table with alias tml where is that ?do you want like this?
    INSERT INTO t_map tm(sn_id,o_id,txt,typ,sn_time)
       SELECT 100,
              sk.obj_id,
              sk.key_txt,
              sk.obj_typ,
              sysdate,
              FROM S_KEY sk
        WHERE     sk.obj_typ = 'AY'
              AND SYSDATE BETWEEN sk.start_date AND sk.end_date
              AND sk.obj_id IN (100170,1001054)
               and   not exists  (select 1
                                                                   FROM t_map tm where sk.obj_ID=tm.o_id
                                                                        and 100=tm.sn_id
                                                                        and sk.key_txt=tm.txt
                                                                        and sk.obj_typ=tm.typ
                                                                        and sysdate=tm.sn_time )

  • Partial Records insertion using DB Adapter - SOA 11g

    Hi,
    We have a BPEL process in which we are inserting records in a table using DB Adapter. Currently if the input data has any problem of data type miss-match then all the records are rejected. None of the records are inserted in the table. Whole batch is rejected.
    We have a new requirement that when there is problem is any record, then only that problematic record is rejected and rest of the records are inserted in the table. Is it possible to do so?
    Thanks,
    Sanjay

    In that case, its better to move the insert statement into procedure and do the insert and return value, if the insert statement is more then this will increase the performance time.
    How many rows you will insert at very worst case ? like 100 lines ?
    Thanks,
    Vijay

  • How to use header information in line records while inserting into table?

    Hi,
    Requirement: Data in flat file needs to be loaded into Oracle Tables.
    File has header information (basically file information, some account info) and Line information ( Actual data need to be loaded to oracle tables).
    File has position based data, first 2 char for Header is 00 and line is 50
    Now, header has some extra info which needs to be loaded along with details lines ( This has to be done using sql loader control file).
    What should be the control file logic to capture header information in details lines?
    Please suggest.
    I am calling this control file from Unix, so I can change the control file definition dynamically by retrieving the first line of the data file and modify the control file before executing the sql loader command. Is there any option to achieve this using SQL LOADER commands?
    Thanks,
    Venkat.

    Pl post details of OS and database versions.
    Use the WHEN clause to load header and detail lines into separate tables, then write PL/SQL code to perform needed post-processing.
    See the examples in section titled "Distinguishing Different Input Record Formats" here http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_control_file.htm
    HTH
    Srini

  • How to skip first record while inserting data from a flat file to BW system

    Hi Experts,
    In my project we have to upload flat file into a BW system. I have written a program and it is working fine.
    Now we have got another requirement. The flat file will have a header record (first row). While uploading the flat file we have to skip this record. How I can do so?
    The code is as below:
    FORM upload1.
      DATA : wf_title    TYPE string,
              lt_filetab  TYPE filetable,
              l_separator TYPE char01,
              l_action    TYPE i,
              l_count     TYPE i,
              ls_filetab  TYPE file_table,
              wf_delemt TYPE rollname,
              wa_fieldcat TYPE lvc_s_fcat,
              tb_fieldcat TYPE lvc_t_fcat,
              rows_read TYPE i,
              p_error   TYPE char01,
              l_file      TYPE string.
      DATA: wf_object(30)  TYPE c,
              wf_tablnm TYPE rsdchkview.
      wf_object = 'myprogram'.
      DATA i TYPE i.
      DATA:
           lr_mdmt                TYPE REF TO cl_rsdmd_mdmt,
           lr_mdmtr               TYPE REF TO cl_rsdmd_mdmtr,
           lt_idocstate           TYPE rsarr_t_idocstate,
           lv_subrc               TYPE sysubrc.
      TYPES : BEGIN OF test_struc,
               /bic/myprogram TYPE  /bic/oimyprogram,
               txtmd   TYPE rstxtmd,
               END OF test_struc.
      DATA :    tb_assum TYPE TABLE OF /bic/pmyprogram.
      DATA: wa_ztext TYPE  /bic/tmyprogram,
            myprogram_temp TYPE ziott_assum,
            wa_myprogram TYPE /bic/pmyprogram.
      DATA : test_upload TYPE STANDARD TABLE OF test_struc,
             wa2 TYPE  test_struc.
      DATA : wa_test_upload TYPE test_struc,
             ztable_data TYPE TABLE OF /bic/pmyprogram,
             ztable_text TYPE TABLE OF /bic/tmyprogram,
             wa_upld_text TYPE /bic/tmyprogram,
             wa_upld_data TYPE /bic/pmyprogram,
              t_assum TYPE ziott_assum.
      DATA : wa1 LIKE  test_upload.
      wf_title = text-026.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
          window_title            = wf_title
          default_extension       = 'txt'
          file_filter             = 'Tab delimited Text Files (*.txt)'
        CHANGING
          file_table              = lt_filetab
          rc                      = l_count
          user_action             = l_action
        EXCEPTIONS
          file_open_dialog_failed = 1
          cntl_error              = 2
          OTHERS                  = 3.                          "#EC NOTEXT
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
      LOOP AT lt_filetab INTO ls_filetab.
        l_file = ls_filetab.
      ENDLOOP.
      CHECK l_action = 0.
      IF l_file IS INITIAL.
        EXIT.
      ENDIF.
      l_separator = 'X'.
      wa_fieldcat-fieldname = 'test'.
      wa_fieldcat-dd_roll = wf_delemt.
      APPEND wa_fieldcat TO tb_fieldcat.
      CALL FUNCTION 'MESSAGES_INITIALIZE'.
      CLEAR wa_test_upload.
    Upload file from front-end (PC)
    File format is tab-delimited ASCII
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = l_file
          has_field_separator     = l_separator
        TABLES
         data_tab                = i_mara
        data_tab                   = test_upload
        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.
      IF sy-subrc <> 0.
        EXIT.
      ELSE.
       CALL FUNCTION 'MESSAGES_INITIALIZE'.
        IF test_upload IS NOT INITIAL.
          DESCRIBE TABLE test_upload LINES rows_read.
          CLEAR : wa_test_upload,wa_upld_data.
          LOOP AT test_upload INTO wa_test_upload.
            CLEAR :  p_error.
            rows_read = sy-tabix.
            IF wa_test_upload-/bic/myprogram IS INITIAL.
              p_error = 'X'.
              MESSAGE s153 WITH wa_test_upload-/bic/myprogram sy-tabix.
              CONTINUE.
            ELSE.
              TRANSLATE wa_test_upload-/bic/myprogram TO UPPER CASE.
              wa_upld_text-txtmd  = wa_test_upload-txtmd.
              wa_upld_text-txtsh  = wa_test_upload-txtmd.
              wa_upld_text-langu =  sy-langu.
              wa_upld_data-chrt_accts = 'xyz1'.
              wa_upld_data-co_area = '12'.
              wa_upld_data-/bic/zxyzbcsg = 'Iy'.
              wa_upld_data-objvers = 'A'.
              wa_upld_data-changed = 'I'.
              wa_upld_data-/bic/zass_mdl = 'rrr'.
              wa_upld_data-/bic/zass_typ = 'I'.
              wa_upld_data-/bic/zdriver = 'yyy'.
              wa_upld_text-langu = sy-langu.
              MOVE-CORRESPONDING wa_test_upload TO wa_upld_data.
              MOVE-CORRESPONDING wa_test_upload TO wa_upld_text.
              APPEND wa_upld_data TO ztable_data.
              APPEND wa_upld_text TO ztable_text.
            ENDIF.
          ENDLOOP.
          DELETE ADJACENT DUPLICATES FROM ztable_data.
          DELETE ADJACENT DUPLICATES FROM ztable_text.
          IF ztable_data IS NOT INITIAL.
            CALL METHOD cl_rsdmd_mdmt=>factory
              EXPORTING
                i_chabasnm     = 'myprogram'
              IMPORTING
                e_r_mdmt       = lr_mdmt
              EXCEPTIONS
                invalid_iobjnm = 1
                OTHERS         = 2.
       CALL FUNCTION 'MESSAGES_INITIALIZE'.
       **Lock the Infoobject to update
            CALL FUNCTION 'RSDG_IOBJ_ENQUEUE'
              EXPORTING
                i_objnm      = wf_object
                i_scope      = '1'
                i_msgty      = rs_c_error
              EXCEPTIONS
                foreign_lock = 1
                sys_failure  = 2.
            IF sy-subrc = 1.
              MESSAGE i107(zddd_rr) WITH wf_object sy-msgv2.
              EXIT.
            ELSEIF sy-subrc = 2.
              MESSAGE i108(zddd_rr) WITH wf_object.
              EXIT.
            ENDIF.
    *****Update Master Table
            IF ztable_data IS NOT INITIAL.
              CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
                    EXPORTING
                      i_iobjnm                     = 'myprogram'
                      i_tabclass                   = 'M'
           I_T_ATTR                     = lt_attr
                    TABLES
                      i_t_table                    = ztable_data
                      EXCEPTIONS
                     attribute_name_error         = 1
                     iobj_not_found               = 2
                     generate_program_error       = 3
                     OTHERS                       = 4.
              IF sy-subrc <> 0.
                CALL FUNCTION 'MESSAGE_STORE'
                  EXPORTING
                    arbgb  = 'zddd_rr'
                    msgty  = 'E'
                    txtnr  = '054'
                    msgv1  = text-033
                  EXCEPTIONS
                    OTHERS = 3.
                MESSAGE e054(zddd_rr) WITH 'myprogram'.
              ELSE.
                CALL FUNCTION 'MESSAGE_STORE'
                  EXPORTING
                    arbgb  = 'zddd_rr'
                    msgty  = 'S'
                    txtnr  = '053'
                    msgv1  = text-033
                  EXCEPTIONS
                    OTHERS = 3.
              ENDIF.
    *endif.
    *****update Text Table
              IF ztable_text IS NOT INITIAL.
                CALL FUNCTION 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
                  EXPORTING
                    i_iobjnm               = 'myprogram'
                    i_tabclass             = 'T'
                  TABLES
                    i_t_table              = ztable_text
                  EXCEPTIONS
                    attribute_name_error   = 1
                    iobj_not_found         = 2
                    generate_program_error = 3
                    OTHERS                 = 4.
                IF sy-subrc <> 0.
                  CALL FUNCTION 'MESSAGE_STORE'
                    EXPORTING
                      arbgb  = 'zddd_rr'
                      msgty  = 'E'
                      txtnr  = '055'
                      msgv1  = text-033
                    EXCEPTIONS
                      OTHERS = 3.
                ENDIF.
              ENDIF.
            ELSE.
              MESSAGE s178(zddd_rr).
            ENDIF.
          ENDIF.
          COMMIT WORK.
          CALL FUNCTION 'RSD_CHKTAB_GET_FOR_CHA_BAS'
            EXPORTING
              i_chabasnm = 'myprogram'
            IMPORTING
              e_chktab   = wf_tablnm
            EXCEPTIONS
              name_error = 1.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
    ****Release locks on Infoobject
          CALL FUNCTION 'RSDG_IOBJ_DEQUEUE'
            EXPORTING
              i_objnm = 'myprogram'
              i_scope = '1'.
        ENDIF.
      ENDIF.
      PERFORM data_selection .
      PERFORM update_alv_grid_display.
      CALL FUNCTION 'MESSAGES_SHOW'.
    ENDFORM.
    Please let me know how I can skip first record of the flat file?
    Regards,
    S

    go through this hope u can get some idea
    REPORT  ztest no standard page heading line-size 255.
                          Declaration                            *
    TYPES t_itab1 TYPE alsmex_tabline.
    types: begin of t_csks,
           kostl like csks-kostl,
          end of t_csks.
    types: begin of t_cska,
           kstar like cska-kstar,
          end of t_cska.
    data: begin of t_flatfile,
          docdate like COHEADER-BLDAT,
          postdate like COHEADER-BUDAT,
          doctext like COHEADER-BLTXT,
           costele like RK23F-KSTAR,
           amount like RK23F-WTGBTR,
           scostctr like RK23F-SKOSTL,
           rcostctr like RK23F-EKOSTL,
           rintorder like RK23F-EAUFNR,
         end of t_flatfile.
    data: begin of t_flatfile1,
          docdate like COHEADER-BLDAT,
          postdate like COHEADER-BUDAT,
          doctext like COHEADER-BLTXT,
           costele like RK23F-KSTAR,
           amount like RK23F-WTGBTR,
           scostctr like RK23F-SKOSTL,
           rcostctr like RK23F-EKOSTL,
           rintorder like RK23F-EAUFNR,
           NUM LIKE SY-INDEX,
         end of t_flatfile1.
    data: itab like table of t_flatfile with header line.
    data: itab2 like table of t_flatfile1 with header line.
    DATA: it_itab1 TYPE STANDARD TABLE OF t_itab1 WITH HEADER LINE,
          MESSTAB1 LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE,
          MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    data: begin of bdcdata occurs 0.
            include structure bdcdata.
    data: end of bdcdata.
    data:t_lin type i VALUE '0',
         u_rec type i VALUE '0',
         s_rec type i VALUE '0'.
    data: it_csks type standard table of t_csks,
          wa_csks type t_csks.
    data: it_cska type standard table of t_cska,
          wa_cska type t_cska.
    *Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME  TITLE text-010.
    parameters: p_docdat  LIKE  COHEADER-BLDAT obligatory,
                p_postda LIKE  COHEADER-BUDAT obligatory,
                p_doctxt  LIKE  COHEADER-BLTXT.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME  TITLE text-011.
    parameters: p_file LIKE RLGRAP-FILENAME obligatory,
                DIS_MODE LIKE CTU_PARAMS-DISMODE DEFAULT 'N'.
    SELECTION-SCREEN END OF BLOCK b2.
                  A T  S E L E C T I O N   S C R E E N                  *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM get_local_file_name USING p_file.
    *Start of Selection
    START-OF-SELECTION.
      Perform get_Excel_data.
      perform validate_data.
      Perform Process_Data.
                    end-of-selection
    end-of-selection.
      perform display_data.
    *&      Form  get_local_file_name
          text
         -->P_P_FILE  text
    FORM get_local_file_name  USING    P_P_FILE.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
          file_name = p_file.
    ENDFORM.                    " get_local_file_name
    *&      Form  get_Excel_data
          text
    -->  p1        text
    <--  p2        text
    FORM get_Excel_data .
      FIELD-SYMBOLS : <FS>.
      DATA : V_INDEX TYPE I.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = p_file
          i_begin_col             = 1
        i_begin_row             = 2
          i_begin_row             = 1
          i_end_col               = 256
          i_end_row               = 9999                        "65536
        TABLES
          intern                  = it_itab1
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        Message text-013 type 'E'.
      ENDIF.
      IF IT_ITAB1[] IS INITIAL.
        Message text-001 type 'E'.
      else.                                    "IF IT_ITAB1[] IS INITIAL.
        data: itab2 like itab occurs 0 with header line.
        SORT IT_ITAB1 BY ROW COL.
        LOOP AT IT_ITAB1.
          MOVE :IT_ITAB1-COL TO V_INDEX.
          ASSIGN COMPONENT V_INDEX OF STRUCTURE itab2 TO  <FS>.
          MOVE : IT_ITAB1-VALUE TO <FS>.
          AT END OF ROW.
            MOVE-CORRESPONDING itab2 TO itab.
            APPEND itab.
            CLEAR:itab,itab2.
          ENDAT.
        endloop.
        describe table itab lines t_lin.
      endif.               "IF IT_ITAB1[] IS INITIAL.
    ENDFORM.                    " get_Excel_data
    *&      Form  Process_Data
          text
    -->  p1        text
    <--  p2        text
    FORM Process_Data .
      data:l_tabix type sy-tabix.
      data:l_periv like t001-periv,
           l_monat like bkpf-monat,
           l_gjahr like bkpf-gjahr,
           l_amt(21) type c.
      data: l_ddate(10),
            l_pdate(10).
      WRITE p_docdat TO l_ddate.
      WRITE p_postda TO l_pdate.
      clear: l_periv,l_monat,l_gjahr.
      select single periv from t001 into l_periv where bukrs = '5000'. "P_bukrs
      if sy-subrc eq 0.
        l_gjahr = p_postda+0(4).
        call function 'FI_PERIOD_DETERMINE'
          EXPORTING
            i_budat = p_postda
            i_bukrs = '5000'     "p_bukrs
            i_periv = l_periv
            i_gjahr = l_gjahr
          IMPORTING
            e_monat = l_monat.
        clear:l_periv.
      endif.
      loop at itab2.
        refresh:bdcdata.
        clear:bdcdata.
        l_tabix = sy-tabix.
        perform bdc_dynpro      using 'SAPLK23F1' '1200'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '/00'.
        perform bdc_field       using 'COHEADER-SEND_REC_REL'
                                      '10SAP'.
        perform bdc_field       using 'RK23F-STATUS'
                                      'S'.
        perform bdc_field       using 'COHEADER-BLDAT'
                                 itab-docdate.
                                      l_ddate.
        perform bdc_field       using 'COHEADER-BUDAT'
                                 itab-postdate.
                                      l_pdate.
        perform bdc_field       using 'COHEADER-PERIO'
                                       l_monat.                 "'9'.
        perform bdc_field       using 'COHEADER-BLTXT'
                                 itab-doctext.
                                      p_doctxt.
        perform bdc_field       using 'RK23F-KSTAR'
                                      itab2-costele.
        WRITE itab2-amount TO l_amt.
    l_amt = itab-amount.
        condense l_amt no-gaps.
        perform bdc_field       using 'RK23F-WTGBTR'
                                       l_amt.
                                 itab-amount.
        perform bdc_field       using 'RK23F-WAERS'
                                      'USD'.
    *perform bdc_field       using 'RK23F-SGTXT'
                                 itab-doctext.
        perform bdc_field       using 'RK23F-SKOSTL'
                                      itab2-scostctr.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RK23F-EAUFNR'.
        perform bdc_field       using 'RK23F-EKOSTL'
                                      itab2-rcostctr.
        perform bdc_field       using 'RK23F-EAUFNR'
                                      itab2-rintorder.
        perform bdc_dynpro      using 'SAPLK23F1' '1200'.
        perform bdc_field       using 'BDC_OKCODE'
                                      '=POST'.
        perform bdc_field       using 'COHEADER-SEND_REC_REL'
                                      '10SAP'.
        perform bdc_field       using 'RK23F-STATUS'
                                      'S'.
        perform bdc_field       using 'COHEADER-BLDAT'
                                 itab-docdate.
                                      l_ddate.
        perform bdc_field       using 'COHEADER-BUDAT'
                                  itab-postdate.
                                      l_pdate.
        perform bdc_field       using 'COHEADER-PERIO'
                                 '9'.
                                        l_monat.
        perform bdc_field       using 'COHEADER-BLTXT'
                                  itab-doctext.
                                      p_doctxt.
        perform bdc_field       using 'BDC_CURSOR'
                                      'RK23F-KSTAR'.
        perform bdc_field       using 'RK23F-WAERS'
                                      'USD'.
        CALL TRANSACTION 'KB15N' USING BDCDATA MODE DIS_MODE MESSAGES INTO MESSTAB.
        If sy-subrc = 0.
          s_rec = s_rec + 1.
        ELSE.
          u_rec = u_rec + 1.
          move ITAB2-NUM to messtab1-msgv1.
          concatenate itab2-costele ' | ' itab2-scostctr  ' | '  itab2-rcostctr ' | ' itab2-rintorder  into  messtab1-msgv2.
          condense messtab1-msgv2.
          condense messtab1-msgv1.
          append messtab1.
        endif.
        clear:itab2.
      endloop.
    ENDFORM.                    " Process_Data
          BDC_DYNPRO                                                     *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  = PROGRAM.
      BDCDATA-DYNPRO   = DYNPRO.
      BDCDATA-DYNBEGIN = 'X'.
      APPEND BDCDATA.
    ENDFORM.                    "BDC_DYNPRO
           BDC_FIELD                                                     *
    FORM BDC_FIELD USING FNAM FVAL.
      IF FVAL <> ''. "NODATA.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
      ENDIF.
    ENDFORM.                    "BDC_FIELD
    *&      Form  display_data
          text
    -->  p1        text
    <--  p2        text
    FORM display_data .
      skip 2.
      write:/15 text-002.
      skip 2.
      write:/8 text-003.
      SKIP.
      write:/12 text-008,
             25 P_DOCDAT.
      SKIP.
      write:/12 text-009,
             25 P_POSTDA.
      SKIP.
      write:/12 text-012,
              25 P_DOCTXT.
      SKIP.
      write:/12 text-004,
             25 p_file.
      skip 2.
      write:/8 text-005,
            60 t_lin.
      skip.
      write:/8 text-006,
            60 s_rec.
      skip.
      write:/8 text-007,
            60 u_rec.
      skip.
      write:/10 'row no',
             20 'Information'.
      skip.
      loop at messtab1.
        write:/10 messtab1-msgv1,
               20 messtab1-msgv2.
        clear:messtab1.
      endloop.
    ENDFORM.                    " display_data
    *&      Form  validate_data
          text
    -->  p1        text
    <--  p2        text
    FORM validate_data .
      data: l_tabix1 type sy-tabix.
    data: l_tabix2 type sy-tabix.
      if not itab[] is initial.
        select kostl from CSKS into table it_csks.
        if sy-subrc eq 0.
          sort it_csks by kostl.
        endif.
        select kstar from CSKA into table it_cska.
        if sy-subrc eq 0.
          sort it_cska by kstar.
        endif.
        loop at itab.
          l_tabix1 = sy-tabix.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = itab-scostctr
    IMPORTING
       OUTPUT        = itab-scostctr .
          read table it_csks into wa_csks with key kostl = itab-scostctr.
          if sy-subrc ne 0.
            u_rec = u_rec + 1.
           L_TABIX2 = l_tabix1 + 1.
           move l_tabix2 to messtab1-msgv1.
            move l_tabix1 to messtab1-msgv1.
            move itab-rintorder to messtab1-msgv2.
            concatenate itab-costele  ' | ' itab-scostctr  ' | '  itab-rcostctr  ' | ' itab-rintorder  into  messtab1-msgv2.
            condense messtab1-msgv2.
            condense messtab1-msgv1.
            append messtab1.
            clear:wa_csks.
           CLEAR:L_TABIX2.
            continue.
          endif.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = itab-rcostctr
    IMPORTING
       OUTPUT        = itab-rcostctr .
          read table it_csks into wa_csks with key kostl = itab-rcostctr.
          if sy-subrc ne 0.
            u_rec = u_rec + 1.
           L_TABIX2 = l_tabix1 + 1.
           move l_tabix2 to messtab1-msgv1.
            move l_tabix1 to messtab1-msgv1.
              concatenate itab-costele ' | ' itab-scostctr  ' | '  itab-rcostctr ' | ' itab-rintorder  into  messtab1-msgv2.
            condense messtab1-msgv2.
            condense messtab1-msgv1.
            append messtab1.
            clear:wa_csks.
           CLEAR:L_TABIX2.
            continue.
          endif.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
      EXPORTING
        INPUT         = itab-costele
    IMPORTING
       OUTPUT        = itab-costele .
          read table it_cska into wa_cska with key kstar = itab-costele.
          if sy-subrc ne 0.
            u_rec = u_rec + 1.
           L_TABIX2 = l_tabix1 + 1.
           move l_tabix2 to messtab1-msgv1.
            move l_tabix1 to messtab1-msgv1.
            concatenate itab-costele ' | ' itab-scostctr  ' | '  itab-rcostctr ' | ' itab-rintorder  into  messtab1-msgv2.
            condense messtab1-msgv2.
            condense messtab1-msgv1.
            append messtab1.
            clear:wa_csks.
           CLEAR:L_TABIX2.
            continue.
          endif.
    move-corresponding itab to itab2.
    MOVE l_tabix1  TO ITAB2-NUM.
    append itab2.
    clear: itab2.
          clear:itab.
        endloop.
      else.
        message 'No records in File'  type 'S'.
      endif.
    ENDFORM.                    " validate_data

  • How to catch error records while inserting

    hi all,
    i am trying to insert some records in my function where i need to catch the records that are not inserted due to some data incosistencies. i am using a cursor that has the data. can you please let me how can i accomplish this .below is the part of code which does this but it is not working.
    open c_upd;
    fetch c_upd bulk collect into tbl_rftm_pid_details_upd;
    close c_upd;
    if tbl_rftm_pid_details_upd.count > 0 then
    BEGIN
    FORALL i IN 1.. tbl_rftm_pid_details_upd.COUNT SAVE EXCEPTIONS
         insert into rftm_pid_details
    (pid,project_description ,start_date ,end_date ,cust_name ,end_cust_name ,processing_status,
    pid_status ,effective_date,offshore_onsite ,unit ,sub_unit ,pm_id, pm_name,product ,
    project_location ,rm_id ,rm_name ,pid_release_date ,project_type ,project_type_desc ,
    pid_class_desc ,pa_number ,parent_pid ,ideal_ref_no_zv ,ideal_ref_no_lv ,opp_id ,opp_status ,
    bid_margin ,bpw_version ,bid_vsoe ,est_backlog ,div ,grp ,order_number ,project_exec_type ,
    sow_ol_number ,cd_number ,billable_psd ,non_billable_psd ,total_psd ,ltd_billable_psd ,
    ltd_non_billable_psd ,npr_psd ,cash_cntry ,version_number ,system_date )
    values
    (tbl_rftm_pid_details_upd(i).pid,tbl_rftm_pid_details_upd(i).project_description ,tbl_rftm_pid_details_upd(i).start_date ,tbl_rftm_pid_details_upd(i).end_date ,tbl_rftm_pid_details_upd(i).cust_name ,tbl_rftm_pid_details_upd(i).end_cust_name ,tbl_rftm_pid_details_upd(i).processing_status,
    tbl_rftm_pid_details_upd(i).pid_status ,tbl_rftm_pid_details_upd(i).effective_date,tbl_rftm_pid_details_upd(i).offshore_onsite ,tbl_rftm_pid_details_upd(i).unit ,tbl_rftm_pid_details_upd(i).sub_unit ,tbl_rftm_pid_details_upd(i).pm_id, tbl_rftm_pid_details_upd(i).pm_name,tbl_rftm_pid_details_upd(i).product ,
    tbl_rftm_pid_details_upd(i).project_location ,tbl_rftm_pid_details_upd(i).rm_id ,tbl_rftm_pid_details_upd(i).rm_name ,tbl_rftm_pid_details_upd(i).pid_release_date ,tbl_rftm_pid_details_upd(i).project_type ,tbl_rftm_pid_details_upd(i).project_type_desc ,
    tbl_rftm_pid_details_upd(i).pid_class_desc ,tbl_rftm_pid_details_upd(i).pa_number ,tbl_rftm_pid_details_upd(i).parent_pid ,tbl_rftm_pid_details_upd(i).ideal_ref_no_zv ,tbl_rftm_pid_details_upd(i).ideal_ref_no_lv ,tbl_rftm_pid_details_upd(i).opp_id ,tbl_rftm_pid_details_upd(i).opp_status ,
    tbl_rftm_pid_details_upd(i).bid_margin ,tbl_rftm_pid_details_upd(i).bpw_version ,tbl_rftm_pid_details_upd(i).bid_vsoe ,tbl_rftm_pid_details_upd(i).est_backlog ,tbl_rftm_pid_details_upd(i).div ,tbl_rftm_pid_details_upd(i).grp ,tbl_rftm_pid_details_upd(i).order_number ,tbl_rftm_pid_details_upd(i).project_exec_type ,
    tbl_rftm_pid_details_upd(i).sow_ol_number ,tbl_rftm_pid_details_upd(i).cd_number ,tbl_rftm_pid_details_upd(i).billable_psd ,tbl_rftm_pid_details_upd(i).non_billable_psd ,tbl_rftm_pid_details_upd(i).total_psd ,tbl_rftm_pid_details_upd(i).ltd_billable_psd ,
    tbl_rftm_pid_details_upd(i).ltd_non_billable_psd ,tbl_rftm_pid_details_upd(i).npr_psd ,tbl_rftm_pid_details_upd(i).cash_cntry ,tbl_rftm_pid_details_upd(i).version_number ,tbl_rftm_pid_details_upd(i).system_date);     
    EXCEPTION
    WHEN ex_dml_errors THEN     
    l_exceptions := SQL%BULK_EXCEPTIONS.COUNT;
    FOR i in 1.. l_exceptions LOOP
    l_index := SQL%BULK_EXCEPTIONS(i).error_index;
    l_err_code := SQL%BULK_EXCEPTIONS(i).error_code;
    INSERT INTO rftm_pid_details_exception
         (pid,err_code)
    VALUES
         (tbl_rftm_pid_details_upd(l_index).pid,
         l_err_code);
    END LOOP;
    END;     
    END IF;

    how can i use this DBMS_ERRLOG.CREATE_ERROR_LOG in my function?
    i tried doing this, before the insert command.
    DBMS_ERRLOG.CREATE_ERROR_LOG('rftm_pid_details');
    BEGIN
         FORALL i IN 1.. tbl_rftm_pid_details_upd.COUNT
    INSERT INTO rftm_pid_details
    (pid,project_description ,start_date ,end_date ,cust_name ,end_cust_name ,processing_status,
    pid_status ,effective_date,offshore_onsite ,unit ,sub_unit ,pm_id, pm_name,product ,
    project_location ,rm_id ,rm_name ,pid_release_date ,project_type ,project_type_desc ,
    pid_class_desc ,pa_number ,parent_pid ,ideal_ref_no_zv ,ideal_ref_no_lv ,opp_id ,opp_status ,
    bid_margin ,bpw_version ,bid_vsoe ,est_backlog ,div ,grp ,order_number ,project_exec_type ,
    sow_ol_number ,cd_number ,billable_psd ,non_billable_psd ,total_psd ,ltd_billable_psd ,
    ltd_non_billable_psd ,npr_psd ,cash_cntry ,version_number ,system_date )
    VALUES
    (tbl_rftm_pid_details_upd(i).pid,tbl_rftm_pid_details_upd(i).project_description ,tbl_rftm_pid_details_upd(i).start_date ,
    tbl_rftm_pid_details_upd(i).end_date ,tbl_rftm_pid_details_upd(i).cust_name ,tbl_rftm_pid_details_upd(i).end_cust_name ,
    tbl_rftm_pid_details_upd(i).processing_status,tbl_rftm_pid_details_upd(i).pid_status ,tbl_rftm_pid_details_upd(i).effective_date,
    tbl_rftm_pid_details_upd(i).offshore_onsite ,tbl_rftm_pid_details_upd(i).unit ,tbl_rftm_pid_details_upd(i).sub_unit ,
    tbl_rftm_pid_details_upd(i).pm_id, tbl_rftm_pid_details_upd(i).pm_name,tbl_rftm_pid_details_upd(i).product ,
    tbl_rftm_pid_details_upd(i).project_location ,tbl_rftm_pid_details_upd(i).rm_id ,tbl_rftm_pid_details_upd(i).rm_name ,
    tbl_rftm_pid_details_upd(i).pid_release_date ,tbl_rftm_pid_details_upd(i).project_type ,tbl_rftm_pid_details_upd(i).project_type_desc ,
    tbl_rftm_pid_details_upd(i).pid_class_desc ,tbl_rftm_pid_details_upd(i).pa_number ,tbl_rftm_pid_details_upd(i).parent_pid ,
    tbl_rftm_pid_details_upd(i).ideal_ref_no_zv ,tbl_rftm_pid_details_upd(i).ideal_ref_no_lv ,tbl_rftm_pid_details_upd(i).opp_id ,
    tbl_rftm_pid_details_upd(i).opp_status ,tbl_rftm_pid_details_upd(i).bid_margin ,tbl_rftm_pid_details_upd(i).bpw_version ,
    tbl_rftm_pid_details_upd(i).bid_vsoe ,to_number(tbl_rftm_pid_details_upd(i).est_backlog) ,tbl_rftm_pid_details_upd(i).div ,
    tbl_rftm_pid_details_upd(i).grp ,tbl_rftm_pid_details_upd(i).order_number ,tbl_rftm_pid_details_upd(i).project_exec_type ,
    tbl_rftm_pid_details_upd(i).sow_ol_number ,tbl_rftm_pid_details_upd(i).cd_number ,tbl_rftm_pid_details_upd(i).billable_psd ,
    tbl_rftm_pid_details_upd(i).non_billable_psd ,tbl_rftm_pid_details_upd(i).total_psd ,tbl_rftm_pid_details_upd(i).ltd_billable_psd ,
    tbl_rftm_pid_details_upd(i).ltd_non_billable_psd ,tbl_rftm_pid_details_upd(i).npr_psd ,tbl_rftm_pid_details_upd(i).cash_cntry ,
    tbl_rftm_pid_details_upd(i).version_number ,sysdate)
    LOG ERRORS
    REJECT LIMIT UNLIMITED;
    when i try compiling the function, it is giving an error table not exists for 'rftm_pid_details'.

  • Garbage values getting inserted using Database Adapter

    Hi,
    I am facing a particular problem for an interface in the prod env. The problem is like this...
    The interface pulls record set from database and some records in the set is in "French". But in the output variable of the invoke activity , the payload shows some junk values for those values (e.g Name) in French.
    If anybody has ever encountered such problem, please let me know the solution.
    Waiting for a reply asap...
    Thanks a lot
    P.S

    HI
    Please provide me below details.
    1) had u found junk characters in log file or destination application?
    2) Is integration is between Two database applications? if yes, please check whether NLS_LANG parameters are set properly for the language.
    3) As this was found in production,I guess this issue was not encoutntered while testing.So,please compare the settings/setup done in testing instance and Production instance.
    4) if still cannot fix,please update this thread with type of integration (DB to DB or Db to File or any otheer) and adapter properties.
    Thanks

  • To avoid duplicates while inserting using MERGE command

    I have a merge query as below
    merge into ord_act A
    using (select col1,col2... from table,table2,table3 where condition1 and condition2 ...) S on (conditions..)
    WHEN NOT MATCHED THEN
    INSERT (A.col1,A.col2,..A.coln) values(S.col1,S.col2,..s.coln) WHEN MATCHED THEN UPDATE
    SET A.EVT_STAT_CD = S.v_evt_stat_cd,
    A.NAME = S.v_name,
    A.SUBTYPE_CD = S.v_subtype_cd
    commit;
    I don't want duplicates to be inserted into the ord_act table if the condition is not matched ? Please could you suggest on this
    thanks

    Then you should change USING clause query to produce distinct rows.
    SY.

  • Recording to VCR using Digital Adapter

    I've been kicking around getting the digital adapter instead of the STB for 2 of our TVs (they're in an office and guest room).  I understand we wouldn't have the interactive guide, PPV, etc.
    BUT- what I don't know is can you schedule the VCR to record with the digital adapter without first changing the channel on the digital adapter?
    For instance, can I schedule the VCR to record channel 15 at 8pm and channel 72 at 10pm without user-intervention between the 2 recordings?  How does the digital adapter get it's channel changed first to 15 and then later to 72?
    Thanks.
    Solved!
    Go to Solution.

    The short answer is no...
    The digital adaptor, if you dont get too technical, is still just another cable box.  IT decodes and then sends the signal to the VCR so as far as the VCR is concerned it cannot tell the difference between the STB and Digital adaptor. So you have to set your VCR to record channel 3 and then set the adaptor to the channel you want recorded.
    Now I'm sure there is a way if your bound and determined by getting things like IR blasters and remote channel changers and whatnot but your looking at more equipment and probably getting further into it than it would be worth.

  • How to handle the failed records from the table when using DB Adapter

    Hi,
    I am reading some records from table using DB Adapter inside my synchronous BPEL process. Say like reading 100 records from table in between after successful reading of 90 records an error occured in 91st record due some various reasons(like DB down, Connection interrupted etc.). Then how to handle this situation, whether i have to read all the records from the begining and is there any option to continue from where it stopped reading.
    Can please anybody help me out in the regard?
    Thanks in advance
    Regards,
    Aejaz

    we had the same requirement some time ago and had two option:
    1. ask the R/3 development team add a deletion indicator in the table (and thus not actually deleting the record). this deletion indicator could then be used like for any other standard datasource
    this option was however refused, due to huge data volume after a while
    2. at the end of the load we copied the ZTABLE1 to ZTABLE2. then in the begin of the load (day after) we compare the data of table1 to table2. entries available in table2 but not in table1 are deleted, and we put a 'D'. in deletion indicator; as we only keep the deleted entries for one day, the volume of the new table is acceptable.
    M.

  • How to use loop to commit each 1M records?

    oracle 9i
    40M records need to be insert the table. Need to commit each 1M. But I don't want to loop each record and commit. I like to select 1M records and commit. Then select another 1M, then commit; How to do it? use savepoint?
    Appreciate any ideas.
    Thanks
    S.

    You can achieve that using anonymous block using a for loop and couter but it not a good idea to commit after 1 million or 100k as you will be putting more overhead on your system and performance will be down.
    Regards

  • How to Set corrid using JMS adapter in ESB while inserting the data in JMS

    Hello all,
    Can any one help me in setting the corrid using JMS adapter in ESB.
    I haven't been able to find any clues.
    We can do this in BPEL but my adapter is in ESB and i have no idea how this can be done in ESB.
    Your help is highly appreciated.
    Thanks,
    Saurav
    Edited by: sauravsingla on Oct 7, 2009 10:46 AM

    hi
    you could do this from and xsl transformatuion by use of the .. function
    see :
    http://biemond.blogspot.com/2008/02/esb-adapter-failover.html
    http://kr.forums.oracle.com/forums/thread.jspa?threadID=658502 (comment of AmitSoaDev, he sets correlationid too)
    hope this helps, gl

  • How can we avoid duplication of records in database while inserting records

    Hi,
    In my scenerio,while inserting the same records through idoc duplication of records is happening in database.How can i avoid this.

    Divya,
    First its a wrong data, because you cannot have the same data for any condition. Probably its a data problem. Please check with the datbase team and ask them why is it so? They should handle on their end.
    Anyways if the above dont work and if you ahve duplicate records then probably you need to come up with a query using select distinct. If this doesnot work then if the duplicates comes into mapping, you might selecting some fields which are common. So you can use a splitbyvalue(on value change) for those records, so even if there are three records it takes only one record. If you have 4 or 5 common values then you can concat them and then use the splitbyvalue change.
    Else an adapter module should help you out in sender comm. channel after picking the records.
    For an idea can you rajs response in this thread:
    Duplicate records
    Regards,
    ---Satish

Maybe you are looking for