Update records in table control BDC

I am using BDC on table control in which I have to scroll the table. The table shows 4 rows by default. I want to enter values for the 1st and 6th row. I use =p+ OK code to scroll.
When enter value for 6th row the value in the first row vanishes.
Please suggest

I have to perform f_bdc_dynpro for screen 'MP901200' '2000' repeatedly for scrolling
perform f_bdc_dynpro      using 'MP901200' '2000'.
perform f_bdc_field       using 'BDC_CURSOR'
                              'PT9012-SALARYSCHED'.
perform f_bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform f_bdc_field       using 'P9012-BEGDA'
                              '19.01.2009'.
perform f_bdc_field       using 'P9012-ENDDA'
                              '31.12.9999'.
perform f_bdc_field       using 'PT9012-PLANN'
                              '1143'.
perform f_bdc_field       using 'PT9012-SALARYSCHED'
                              '01'.
perform f_bdc_field       using 'PPHDX-ENTRY_IDX'
                              '1'.
Here I enter value for individual fields other than the table control.
perform f_bdc_dynpro      using 'MP901200' '2000'.
perform f_bdc_field       using 'BDC_OKCODE'
                              '=ENTR'.
perform f_bdc_field       using 'P9012-BEGDA'
                              '19.01.2009'.
perform f_bdc_field       using 'P9012-ENDDA'
                              '31.12.9999'.
perform f_bdc_field       using 'PT9012-PLANN'
                              '1143'.
perform f_bdc_field       using 'PT9012-SALARYSCHED'
                              '01'.
perform f_bdc_field       using 'PPHDX-ENTRY_IDX'
                              '1'.
perform f_bdc_field       using 'PT9012-DEGREE(01)'
                              '03'.
Here I enter value in the first row of table control.
perform f_bdc_dynpro      using 'MP901200' '2000'.
perform f_bdc_field       using 'BDC_OKCODE'
                              '=p+'.
perform f_bdc_field       using 'P9012-BEGDA'
                              '19.01.2009'.
perform f_bdc_field       using 'P9012-ENDDA'
                              '31.12.9999'.
perform f_bdc_field       using 'PT9012-PLANN'
                              '1143'.
perform f_bdc_field       using 'PT9012-SALARYSCHED'
                              '01'.
perform f_bdc_field       using 'PPHDX-ENTRY_IDX'
                              '1'.
here i scroll down to come to the sixth row.
perform f_bdc_field       using 'BDC_OKCODE'
                              '=/00'.
perform f_bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform f_bdc_field       using 'P9012-BEGDA'
                              '19.01.2009'.
perform f_bdc_field       using 'P9012-ENDDA'
                              '31.12.9999'.
perform f_bdc_field       using 'PT9012-PLANN'
                              '1143'.
perform f_bdc_field       using 'PT9012-SALARYSCHED'
                              '01'.
perform f_bdc_field       using 'PPHDX-ENTRY_IDX'
                              '6'.
perform f_bdc_field       using 'PT9012-DEGREE(02)'
                              '01'.
Here I enter the value at second row as the 6th row is now the 2nd row after scrolling.
but due to this the value in the first row vanishes.

Similar Messages

  • How to update record in Table control

    Dear Friends,
      I have table control that has space for 10 records but i need to update 15 record from the flat file which is getting into the table how can i do this.
    Regards,
    MAHENDRA.

    Hi,
    you record for an item and then click on page down and save it.use the loop on this bdc to populate the the bdc table no need to do manually.
    LOOP AT  l_i_dettab_item INTO l_wa_dettab_item..
          l_cursor = l_cursor + 1.
          IF l_cursor GT 1.
            PERFORM bdc_field       USING 'BDC_OKCODE'
                                   '=P+'.
          ENDIF.
          PERFORM cursor_pos_notation    USING 'V_EAN_DET001- GTIN_VARIANT_TYP'
                                                  l_cursor
                                        CHANGING  l_cursor_notation.
          PERFORM cursor_pos_notation    USING 'V_EAN_DET001-VTWEG'
                                                  l_cursor
                                        CHANGING  l_cursor_notation.
          PERFORM bdc_field       USING l_cursor_notation
                                        l_wa_dettab_item-vtweg.
          PERFORM cursor_pos_notation    USING 'V_EAN_DET001-DATEFROM'
                                                  l_cursor
                                        CHANGING  l_cursor_notation.
             PERFORM bdc_field       USING l_cursor_notation
                                        l_v_date.
          PERFORM bdc_field       USING 'BDC_CURSOR'
                                        l_cursor_notation.
          PERFORM bdc_field       USING 'BDC_OKCODE'
                                        '=SAVE'.
        ENDLOOP.
    Here my ok code for page down is =P+  so i am looping on the table control data and then populating the bdc table after this i will populate the remaing info required for the call transaction and refresh bdcdata.
    thats it no need to do recording 1000 times.
    now if u do like this it doesn't depend on the number of records on table control.
    it will take all the records.
    Reward if useful.
    Regards,
    sasi
    Regards,
    sasi

  • BDC for existing record in table control

    Hi,
    I have a requirement to change existing records in table control through BDC. Is there any way I can choose the respective record from Table Control through BDC dynamically.
    Regards
    Akash

    /J4I/015PER, this transaction is used for adding permits to Operation in WEC. It has list of operations in Table Control. Permit can be added for choosing the operation from table control.
    Our custom program is designed to add permits for the operation. So if I have to use the above transaction for adding permits, then first I have to choose the correct operation from the table control and then add permit.

  • BDC Recording for Table Control

    dears,
    I am using BDC for posting payments by TCode FP05.
    after processing two payment items i am getting the following error.
    "Runtime error SAPSQL_ARRAY_INSERT_DUPREC has occurred"
    but when i repeat the same recording in foreground it processes the payment sucessfully.
    wht could be wrong with the recording?
    how to record for table control?
    Bye

    Hi Syed,
    I could find few notes for the array insert duplicate runtime error.
    136433
    191544
    You can find may in OSS.
    Cheers
    Vinod

  • Duplicate records in TABLE CONTROL

    Hi folks,
    i am doing a module pool where my internal table (itab) data is comming to table ontrol(ctrl).then i need to select one record in table control & then i press REFRESH push button.
    after putting the refresh button, some new records are comming to that same internal table.then i need to display the modified internal table (some new records are added) data in the table control.
    The modified internal table data is comming to the table control but to the last of table control, some records are repeating.
    before comming to table control, i checked the modified itab. it contains correct data.i.e it contains 15 records.(previously i have 5 records.after REFRESH button 10 more records are added.). but when this table is comming to table control, it contains some 100 record.i should get only 15 record.
    why these records r repeting. how to delete the duplicate records from table control?
    plz suggest me where i am doing mistake.
    correct answer will be rewarded
    Thanks & Regards

    Hi ,
    Thanks for ur help. but i should not refresh the internal table  as some records r already present.after putting the REFRESH button, some new records r appending to this existing table.then i am going to display the previous records & the new records as well.
    i checked the internal table after modification.it contains actual number of records. but after comming to table control , more records r comming.
    is this the problem with scrolling or waht?
    plz suggest where i am doing mistake.i am giving my coding below.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0200.
    module tc_shelf_change_tc_attr.
    loop at object_tab1
           with control tablctrl
           cursor tablctrl-current_line.
        module tc_shelf_get_lines.
      endloop.
    PROCESS AFTER INPUT.
    module set_exit AT EXIT-COMMAND.
       loop at object_tab1.
             chain.
              field: object_tab1-prueflos,
                     object_tab1-matnr.
               module shelf_modify on chain-request.
             endchain.
            field object_tab1-idx
             module shelf_mark on request.
                   endloop.
    module shelf_user_command.
    module user_command_0200.
    ***INCLUDE Y_RQEEAL10_STATUS_0200O01 .
    *&      Module  STATUS_0200  OUTPUT
          text
    MODULE STATUS_0200 OUTPUT.
      SET PF-STATUS 'MAIN'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  tc_shelf_change_tc_attr  OUTPUT
          text
    MODULE tc_shelf_change_tc_attr OUTPUT.
    delete adjacent duplicates from object_tab1 comparing prueflos matnr.
    describe table object_tab1 lines tablctrl-lines.
    ENDMODULE.                 " tc_shelf_change_tc_attr  OUTPUT
    *&      Module  tc_shelf_get_lines  OUTPUT
          text
    MODULE tc_shelf_get_lines OUTPUT.
    data:  g_tc_shelf_lines  like sy-loopc.
    if tablctrl-current_line > tablctrl-lines.
    stop.
    endif.
    g_tc_tablctrl_lines = sy-loopc.
    *refresh control tablctrl from screen 0200.
    ENDMODULE.                 " tc_shelf_get_lines  OUTPUT
    ***INCLUDE Y_RQEEAL10_SHELF_MODIFYI01 .
    *&      Module  shelf_modify  INPUT
          text
    MODULE shelf_modify INPUT.
    modify object_tab1
        index tablctrl-current_line.
    ENDMODULE.                 " shelf_modify  INPUT
    *&      Module  set_exit  INPUT
          text
    module set_exit INPUT.
    leave program.
    endmodule.                 " set_exit  INPUT
    *&      Module  shelf_mark  INPUT
          text
    MODULE shelf_mark INPUT.
    data: g_shelf_wa2 like line of object_tab1.
      if tablctrl-line_sel_mode = 1
      and object_tab1-idx = 'X'.
        loop at object_tab1 into g_shelf_wa2
          where idx = 'X'.
          g_shelf_wa2-idx = ''.
          modify object_tab1
            from g_shelf_wa2
            transporting idx.
        endloop.
      endif.
      modify object_tab1
        index tablctrl-current_line
        transporting idx plnty plnnr plnal.
    ENDMODULE.                 " shelf_mark  INPUT
    *&      Module  shelf_user_command  INPUT
          text
    MODULE shelf_user_command INPUT.
    ok_code = sy-ucomm.
      perform user_ok_tc using    'TABLCTRL'
                                  'OBJECT_TAB1'
                         changing ok_code.
      sy-ucomm = ok_code.
    ENDMODULE.                 " shelf_user_command  INPUT
    *&      Module  user_command_0100  INPUT
          text
    MODULE user_command_0200 INPUT.
    data:v_line(3).
    case OK_CODE.
    when 'LAST'.
    read table object_tab1 with key idx = 'X'.
    if sy-subrc = 0.
    select * from qals
                          where enstehdat <= object_tab1-enstehdat
                          and   plnty ne space
                          and   plnnr ne space
                          and   plnal ne space.
    if sy-dbcnt > 0.
    if qals-enstehdat = object_tab1-enstehdat.
       check qals-entstezeit < object_tab1-entstezeit.
       move-corresponding qals to object_tab2.
       append object_tab2.
       else.
       move-corresponding qals to object_tab2.
       append object_tab2.
       endif.
         endif.
            endselect.
       sort object_tab2 by enstehdat entstezeit descending.
    loop at object_tab2 to 25.
      if not object_tab2-prueflos is initial.
    append object_tab2 to object_tab1.
      endif.
      clear object_tab2.
    endloop.
      endif.
    when 'SAVE'.
    loop at object_tab1 where idx = 'X'.
      if ( not object_tab1-plnty is initial and
                    not object_tab1-plnnr is initial and
                               not object_tab1-plnal is initial ).
       select single * from qals into corresponding fields of wa_qals
       where prueflos = object_tab1-prueflos.
          if sy-subrc = 0.
           wa_qals-plnty = object_tab1-plnty.
           wa_qals-plnnr = object_tab1-plnnr.
           wa_qals-plnal = object_tab1-plnal.
    update qals from wa_qals.
      if sy-subrc <> 0.
    Message E001 with 'plan is not assigned to lot in sap(updation)'.
    else.
    v_line = tablctrl-current_line - ( tablctrl-current_line - 1 ).
    delete object_tab1.
    endif.
       endif.
          endif.
               endloop.
    when 'BACK'.
    leave program.
    when 'NEXT'.
    call screen 300.
    ENDCASE.
    ***INCLUDE Y_RQEEAL10_USER_OK_TCF01 .
    *&      Form  user_ok_tc
          text
         -->P_0078   text
         -->P_0079   text
         <--P_OK_CODE  text
    form user_ok_tc  using    p_tc_name type dynfnam
                              p_table_name
                     changing p_ok_code like sy-ucomm.
       data: l_ok              type sy-ucomm,
             l_offset          type i.
       search p_ok_code for p_tc_name.
       if sy-subrc <> 0.
         exit.
       endif.
       l_offset = strlen( p_tc_name ) + 1.
       l_ok = p_ok_code+l_offset.
       case l_ok.
         when 'P--' or                     "top of list
              'P-'  or                     "previous page
              'P+'  or                     "next page
              'P++'.                       "bottom of list
           perform compute_scrolling_in_tc using p_tc_name
                                                 l_ok.
           clear p_ok_code.
       endcase.
    endform.                    " user_ok_tc
    *&      Form  compute_scrolling_in_tc
          text
         -->P_P_TC_NAME  text
         -->P_L_OK  text
    form compute_scrolling_in_tc using    p_tc_name
                                           p_ok_code.
       data l_tc_new_top_line     type i.
       data l_tc_name             like feld-name.
       data l_tc_lines_name       like feld-name.
       data l_tc_field_name       like feld-name.
       field-symbols <tc>         type cxtab_control.
       field-symbols <lines>      type i.
       assign (p_tc_name) to <tc>.
       concatenate 'G_' p_tc_name '_LINES' into l_tc_lines_name.
       assign (l_tc_lines_name) to <lines>.
       if <tc>-lines = 0.
         l_tc_new_top_line = 1.
       else.
         call function 'SCROLLING_IN_TABLE'
           exporting
             entry_act      = <tc>-top_line
             entry_from     = 1
             entry_to       = <tc>-lines
             last_page_full = 'X'
             loops          = <lines>
             ok_code        = p_ok_code
             overlapping    = 'X'
           importing
             entry_new      = l_tc_new_top_line
           exceptions
             others         = 0.
       endif.
       get cursor field l_tc_field_name
                  area  l_tc_name.
       if syst-subrc = 0.
         if l_tc_name = p_tc_name.
           set cursor field l_tc_field_name line 1.
         endif.
       endif.
       <tc>-top_line = l_tc_new_top_line.
    endform.                              " COMPUTE_SCROLLING_IN_TC
    Thanks

  • Table control bdc for mb1a

    Hi All,
    Can anyone tell me is table control BDC possible for MB1A tcode
    Thanks in advance.

    well there may be 2 cases,
    1. if ur batch manahement is active and the batch is determined internally,in that case it is not possible.
    2.However if ur batch management is not active,then a bdc can be written.
    But i would suggest u use an LSMW and record using the BAPI method,SAP provides good standard BAPI's.

  • Add a new record to table control

    Dear all,
    How to add a new  blank record to a table control?
    Following code is not working for adding  a new blank record to a table control
    MODULE USER_COMMAND_0100 INPUT.
        SAVE_OK = OK_CODE.
        CLEAR OK_CODE.
        CASE SAVE_OK.
          WHEN 'EXIT'.
            LEAVE PROGRAM.
          WHEN 'APND'.             " A button "Add" to add a new record to table control
            REFRESH IT_KNA1.
            CLEAR IT_KNA1.
            APPEND IT_KNA1.
        ENDCASE.
    ENDMODULE.        
    Thanks you

    Hope you have done all table control specific coding
    refer this example program
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm

  • Insert,  Delete and Update options in Table control

    Experts,
    I have writen code for Insert,  Delete and Update options in Table control. They are not working properly...
    can any one send the code for the above please...
    Thanks in advance..

    Hi,
    Following steps will help you.
    1.TOP-INCLUDE
    DATA: ITAB1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: ITAB2 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: WA LIKE KNA1.
    DATA: ANT TYPE I,CUR TYPE I.
    DATA: OK_CODE TYPE SY-UCOMM.
    CONTROLS: TABCTRL TYPE TABLEVIEW USING SCREEN 100.
    IN FLOWLOGIC
    PROCESS BEFORE OUTPUT.
    LOOP AT ITAB1 CURSOR CUR WITH CONTROL TABCTRL.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CLEAR_DATA.
    LOOP AT ITAB1.
    MODULE MOVE_DATA.
    ENDLOOP.
    ADD “OK_CODE” IN ELEMENT LIST. CLICK ON LAYOUT AND  ADD TABLE CONTROL(name it as TABCTRL) AND PUSHBUTTONS AS FOLLOWS.
    SELECT THE FIELDS FROM PROGRAM. SAVE CHECK AND ACTIVATE.
    CLICK ON FLOWLOGIC EDITOR FROM APPLICATION TOOL BAR.
    DOUBLE CLICK ON MODULE “CLEAR_DATA”.
    write the in this module as below.
    CLEAR ITAB2. REFRESH ITAB2.
    DOUBLE CLICK ON MODULE “MOVE_DATA”.
    write the code in this module as below.
    APPEND ITAB1 TO ITAB2.
    ACTIVATE PAI AND WRITE THE CODE AS BELOW.
    CASE OK_CODE.
    WHEN 'FETCH'.
    SELECT * FROM KNA1 INTO TABLE ITAB1 UP TO 20 ROWS.
    TABCTRL-LINES = SY-DBCNT.
    WHEN 'ADD'.
    GET CURSOR LINE CNT.
    CNT = TABCTRL-TOP_LINE + CNT - 1.
    CLEAR WA.
    INSERT WA INTO ITAB1 INDEX CNT.
    WHEN 'MODIFY'.
    GET CURSOR LINE CNT.
    READ TABLE ITAB2 INDEX CNT.
    LOOP AT ITAB2.
    MODIFY KNA1 FROM ITAB2.
    ENDLOOP.
    SELECT * FROM KNA1 INTO TABLE ITAB1.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    SAVE,CHECK AND ACTIVATE ALL.
    CREATE TCODE AND EXECUTE.
    contact if u hv any issues regarding this code.
    reward points,if it is useful.
    Thanks,
    Chandu.

  • How can we do the validation for non visible records in table control.

    Hi Experts,
      I have a table control which displays list of material details. I have a button to upload the material details from excel file to table control directly. I have to validate all the customers which are exist in the table. But my item (Material) table control displays only 5 rows i.e only 5 entries are visible in module pool screen. The validation is done for 5 records only in PAI event, but i need to do validation for rest of the records too (Which are not visible on items table), if validation fails then needs to display error message.
      How can we do the validation for non visible records in table control.
    Regards,
    Bujji

    Hi,
    try validating material before displaying it in table control...'
    Rgds/Abhhi

  • How to save the selected records from Table control in dialog programming

    Hiiiiiiii Every1
    Actually the problem is like this:-
    I have to select some records from table control and then want to save the selected records in DB table.
    Example
    I have some rows having inforamtion bout employees...
    Now what i want is that when i click on 'SAVE' button then these selected rows should be moved into DB table.
    Sachin Dhingra

    see below example, I have added INSERT option after DELETE option.
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA cols LIKE LINE OF flights-cols.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
    TABLES demo_conn.
    SELECT * FROM spfli INTO TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
            ENDIF.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
            ENDLOOP.
          ENDIF.
        WHEN 'INSERT'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              itab1 = itab.
              modify itab1.
            ENDLOOP.
          ENDIF.
          if not itab1 is initial.
            INSERT dbtab FROM TABLE itab1.
          endif.
      ENDCASE.
    ENDMODULE.

  • How to delete record from table control in BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    Hi,
    While doing recording check for Filter button available for the table control, if it available then do the recording for the same.
    Once it is done while passing the data from internal table put the value into Filter field.
    Hope it resolves your issue.
    Thanks & Regards.
    Nagaraj Kalbavi

  • How to delete record from table control using BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    One option is to identify the table and find out the location as the number of row which should be deleted from the table and then in the bdc program instead of postioning the cursor on the row 1(using the statement perform bdc_cursor ....(01)), replace the 01 with the row number.
    Second option is that if a filter control is available for the table control, then filter the data each and every time with the material number to be deleted and then delete the first row.
    Regards
    Farzan

  • Regd updation of one record in table control

    hai all
    i have a table control with 100 fields with 200
    records in the table control.
    i want to change one particular record in the 17th
    field.
    how to update that record,,please ,
    awaiting replies

    Please check the code.
    PROCESS BEFORE OUTPUT.
    MODULE status_9010.
    LOOP WITH CONTROL tab_control.
    MODULE move_data_to_table.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP WITH CONTROL tab_control.
    MODULE move_data_from_table.
    ENDLOOP.
    *& Module move_data_to_table OUTPUT
    This is to move the data from the internal table to the table control
    MODULE move_data_to_table OUTPUT.
    This is to move the data from the internal table to the table control
    zmpets_mode-modecode,zmpets_range-rangeid,zmpets_servfacto-factor are column name if *table control
    READ TABLE int_factor INDEX tab_control-current_line.
    IF sy-subrc = 0.
    zmpets_mode-modecode = int_factor-modecode.
    zmpets_range-rangeid = int_factor-rangeid.
    zmpets_servfacto-factor = int_factor-factor.
    ENDIF.
    ENDMODULE. " move_data_to_table OUTPUT
    *& Module move_data_from_table INPUT
    Date is moved from the table control to the Internal Table
    MODULE move_data_from_table INPUT.
    To move the data from the table control to internal table 'INT_FACTOR.
    int_factor-modecode = zmpets_mode-modecode.
    int_factor-rangeid = zmpets_range-rangeid.
    int_factor-factor = zmpets_servfacto-factor.
    MODIFY int_factor INDEX tab_control-current_line.
    IF sy-subrc NE 0.
    APPEND int_factor.
    CLEAR int_factor.
    ENDIF.
    ENDIF.
    ENDMODULE. " move_data_from_table INPUT
    Regards

  • Screen Resolution in table control bdc

    Hi ,
    Im working on bdc table control using call transaction method for vk11 and mek1.While uploading data for vk11 for the first time it is taking all the records of the input file and if i do the same for the second time by changing the amount value it is taking only 24 records .(i.e if the input file contains only 24 records it wil update else if it has 25 records or more it not updating even single record and it is showing error " No batch input data for screen sapmv13A ..)...this issue is with the production server......................whereas in development and quality servers there is no problem....................
    what migh be the problem and how to solve it?
    can anyone plz help me on this

    if its a problem in screen resolution then while recording through SHDB mark the check box default size
    or
    to make the bdc execute in standard screen size check the code below
    data x_ctuparams type ctu_params.
    x_ctuparams-defsize = 'X'. " This would freeze the resolution in any system
    x_ctuparams-dismode = 'N'.
    x_ctuparams-updmode = 'S'.
    call transaction <TCODE> using it_bdcdata options from x_ctuparams.
    So whatever is the screen size of the users front-end, the BDC will execute in standard screen size

  • Table control--BDC

    Hi Group,
    When I am writting BDC for transaction in which table control occurs in the second screen,it is perfectly running when I am testing with the two records in the table control,when I increases the records (200) I am getting the error that <b>Screen is too large for Internal batch Input.</b>
    Here I am attaching the part of code.
      MOVE 1 TO IDX.
      LOOP AT IT_DATATAB INTO WA_DATATAB.
        CONCATENATE 'FKKCMP_DIA-CHCKN(' IDX ')'
                                     INTO FNAM.
        perform bdc_field     using FNAM
                                    wa_datatab-col5.
        CONCATENATE 'FKKCMP_DIA-GPART(' IDX ')'
                                     INTO FNAM.
        perform bdc_field       using fnam
                                    wa_datatab-col1.
        CONCATENATE 'FKKCMP_DIA-VKONT(' IDX ')'
                                    INTO FNAM.
        perform bdc_field   using fnam
                                  wa_datatab-col2 .
        CONCATENATE 'FKKCMP_DIA-AUDAT(' IDX ')'
                                    INTO FNAM.
        perform bdc_field   using fnam
                                wa_datatab-col3 .
        v_betrw = wa_datatab-col4.
        CONCATENATE 'FKKCMP_DIA-BETRW(' IDX ')'
                                    INTO FNAM.
        write v_betrw to fval.
        perform bdc_field       using  fnam
                                   fval.
        IDX = IDX + 1.
      ENDLOOP.
    Please suggest

    <b>A table control can contain many records, but the no of records you see on the screen is limited. In this case, the table control can hold only 16 records at a time and then we need to enter the page down and fill in more records.</b>
    here is the sample code.
    *--For each record in table IT_ICE_CONFM
        loop at it_ice_confm.
    *--Get the correct line item from calling system.
    *      it_ice_confm-ebelp = it_ice_confm-ebelp / '00010'.
    *-- Check for Purchasing document validity
          read table lt_ekko with key ebeln = it_ice_confm-ebeln
                                      binary search.
          if sy-subrc <> 0.
             "error
          endif.
    *-- Check for Purchasing document item validity
          read table lt_ekpo with key ebeln = it_ice_confm-ebeln
                                      ebelp = it_ice_confm-ebelp
                                      binary search.
          if sy-subrc <> 0.
           "error
          endif.
    *--Clear local variables.
          clear : lv_tabix,
                  lv_lfdat.
          lv_tabix = sy-tabix.
          lv_count1 = lv_count1 + 1.
    *     For every new Purchase Order, populate first screen
          at new ebeln.
            read table it_ice_confm index lv_tabix.
            perform screen_insert tables it_bdc
                                  using  'SAPMM06E' '0105' 'X'.
            perform field_insert: tables it_bdc
                                  using  'BDC_OKCODE'  '/00',
                                  tables it_bdc
                                  using  'RM06E-BSTNR' it_ice_confm-ebeln.
          endat.
    *     For every new Purchase Order line item, populate next screen
          at new ebelp.
            read table it_ice_confm index lv_tabix.
    * if no Confirmation control key exist and no Goods receipt indicator
    * occurs for the line item, set the Confirmation control key as 0001
            if lt_ekpo-bstae = ' '.
              if lt_ekpo-wepos = ' '.
                perform screen_insert tables it_bdc
                                 using  'SAPMM06E' '0120' 'X'.
                perform field_insert: tables it_bdc
                                 using  'RM06E-EBELP' it_ice_confm-ebelp,
                                 tables it_bdc
                                 using  'BDC_OKCODE' '/00'.
                perform screen_insert tables it_bdc
                                  using  'SAPMM06E' '0120' 'X'.
                perform field_insert: tables it_bdc
                                  using  'RM06E-TCSELFLAG(01)' 'X',
                                  tables it_bdc
                                  using  'BDC_OKCODE' '=DETA'.
                perform screen_insert tables it_bdc
                                 using  'SAPMM06E' '0111' 'X'.
               perform field_insert: tables it_bdc
                                    using  'EKPO-BSTAE' '0001',
                                    tables it_bdc
                                    using  'BDC_OKCODE' '=BACK'.
              else.
    * if no Confirmation control key exist and and if Goods receipt
    * indicator occurs for this line item, mark PO and line item as error
                concatenate 'Item no '                 it_ice_confm-ebelp
                            ' of Purchasing document ' it_ice_confm-ebeln
                            ' is invalid'
                           into return-message.
                move: 'E'                            to return-type,
                      'ZI'                           to return-id,
                      '999'                          to return-number.
                append return.
                clear return.
                continue.
              endif.
            else.
            endif.
              perform screen_insert tables it_bdc
                                    using  'SAPMM06E' '0120' 'X'.
              perform field_insert: tables it_bdc
                                    using  'RM06E-EBELP' it_ice_confm-ebelp,
                                    tables it_bdc
                                    using  'BDC_OKCODE' '/00'.
              perform screen_insert tables it_bdc
                                    using  'SAPMM06E' '0120' 'X'.
              perform field_insert: tables it_bdc
                                    using  'RM06E-TCSELFLAG(01)' 'X',
                                    tables it_bdc
                                    using  'BDC_OKCODE' '=BSTA'.
              clear lv_tab_line.
              perform select_line using it_ice_confm-ebeln
                                        it_ice_confm-ebelp
                               changing lv_tab_line.
              if not lv_tab_line is initial.
    *--Position table control row for the first time
                lv_count2 = '01'.
                perform screen_insert  tables it_bdc
                                       using 'SAPLEINB' '0200' 'X'.
                perform field_insert   tables it_bdc
                                       using  'BDC_OKCODE' '=UMOD'.
                perform screen_insert  tables it_bdc
                                       using 'SAPLEINB' '0100' 'X'.
                perform field_insert   tables it_bdc
                                       using  'BDC_OKCODE' '=NP'.
                perform screen_insert  tables it_bdc
                                       using 'SAPLEINB' '0100' 'X'.
                perform field_insert   tables it_bdc
                                       using  'BDC_OKCODE' '=UMOD'.
              endif.
              perform screen_insert  tables it_bdc
                                     using 'SAPLEINB' '0200' 'X'.
            endat.
            lv_count2 = lv_count2 + 1.
    *     Handle page down
    *-- if confirmations already exist.
            if not lv_tab_line is initial.
    *-- Check if it is 16th record, to position next record on page down
    *   table control has 16 rows when default screen size,
    *      mode and update are set
              if lv_count1 = 16.
                clear: lv_count1,
                       lv_count2.
    *-- On page down, the next record comes to 2nd row
                lv_count2 = '02'.
                perform field_insert tables it_bdc
                                     using  'BDC_OKCODE' '=UMOD'.
                perform screen_insert  tables it_bdc
                               using 'SAPLEINB' '0100' 'X'.
                perform field_insert   tables it_bdc
                                       using  'BDC_OKCODE' '=NP'.
                perform screen_insert  tables it_bdc
                                       using 'SAPLEINB' '0100' 'X'.
                perform field_insert   tables it_bdc
                                       using  'BDC_OKCODE' '=UMOD'.
                perform screen_insert  tables it_bdc
                               using 'SAPLEINB' '0200' 'X'.
              endif.
            else.
    *-- if confirmations does not exist, then check if it is 17th record.
    *   to position next record on page down
              if lv_count1 = 17.
                clear: lv_count1,
                       lv_count2.
                lv_count2 = '02'.
                perform field_insert tables it_bdc
                                     using  'BDC_OKCODE' '=UMOD'.
                perform screen_insert  tables it_bdc
                               using 'SAPLEINB' '0100' 'X'.
                perform field_insert   tables it_bdc
                                       using  'BDC_OKCODE' '=NP'.
                perform screen_insert  tables it_bdc
                               using 'SAPLEINB' '0100' 'X'.
                perform field_insert   tables it_bdc
                                       using  'BDC_OKCODE' '=UMOD'.
                perform screen_insert  tables it_bdc
                               using 'SAPLEINB' '0200' 'X'.
    *-- Initialize the table line to 1.
                lv_tab_line = 1.
              endif.
            endif.
            concatenate 'EKES-EBTYP(' lv_count2 ')' into lv_field.
            perform field_insert tables it_bdc
                                 using  lv_field 'Z1'.
            if not it_ice_confm-eindt is initial.
              clear: lv_field,
                     lv_date.
              concatenate 'RM06E-EEIND(' lv_count2 ')' into lv_field.
              move it_ice_confm-eindt to lv_lfdat.
              write lv_lfdat to lv_date.
              perform field_insert tables it_bdc
                                   using  lv_field lv_date.
            endif.
            if not it_ice_confm-uzeit is initial.
              clear: lv_field,
                     lv_time.
              concatenate 'EKES-UZEIT(' lv_count2 ')' into lv_field.
              write it_ice_confm-uzeit to lv_time.
              perform field_insert tables it_bdc
                                   using  lv_field lv_time.
            endif.
            clear lv_field.
            concatenate 'EKES-XBLNR(' lv_count2 ')' into lv_field.
            perform field_insert tables it_bdc
                                 using  lv_field it_ice_confm-scacd.
            clear lv_field.
            concatenate 'EKES-MENGE(' lv_count2 ')' into lv_field.
            perform field_insert tables it_bdc
                                 using  lv_field it_ice_confm-quantity.
            at end of ebelp.
              clear: lv_tab_line,
                     lv_count1,
                     lv_count2.
              perform field_insert tables it_bdc
                                   using  'BDC_OKCODE' '=BACK'.
            endat.
            at end of ebeln.
              clear: lv_lines,
                     lv_msg.
              perform screen_insert  tables it_bdc
                             using 'SAPMM06E' '0120' 'X'.
              perform field_insert tables it_bdc
                             using 'BDC_OKCODE' '=BU'.
              call transaction  <b>tcode</b> using  it_bdc
                      options from x_ctu_params
                      messages into lt_message.
              clear w_success.
              if sy-subrc <> 0.
                w_success = 'N'.
              endif.
              refresh: it_bdc,
                        lt_message.
            endat.
          endloop.
    Regards,
    Richa

Maybe you are looking for