Problem in modifying the existing record in table control

Hi Experts,
I have one table control.I have entered one record and save it.When I am modifying the same record a duplicate record is created.I need if I modify the same record that record should only modify.How to delete the duplicate record.

Hi,
In Flow logic.
LOOP .                        
  MODULE tbc_modify ON CHAIN-REQUEST.
  MODULE tbc_mark.     
ENDLOOP.    
In module.
MODULE tbc_modify INPUT.
  MODIFY t_data
    FROM fs_data
   INDEX tbc-current_line.
  IF sy-subrc NE 0.
    APPEND fs_data TO t_data.
  ENDIF.                              
ENDMODULE.                            
MODULE tbc_mark INPUT.
  DATA: tbc_wa2 LIKE LINE OF t_data.
  IF tbc-line_sel_mode = 1
  AND fs_data-mark = 'X'.
    LOOP AT t_data  INTO tbc_wa2
     WHERE mark = 'X'.
      tbc_wa2-mark = ''.
      MODIFY t_data
        FROM tbc_wa2
        TRANSPORTING mark.
    ENDLOOP.                          .
  ENDIF.                             
  MODIFY t_data  FROM fs_data
    INDEX tbc-current_line
    TRANSPORTING mark.      
ENDMODULE.
Edited by: sapabap403 on Aug 31, 2011 9:29 AM

Similar Messages

  • 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.

  • 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.

  • 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

  • Modify the standard records in database table

    hi folks,
    could u say me , how to modify the standard records(values) in database table.
    For example in VBAP is one field like ZWERT(target value) , I wnat to modify the values of this field .
    THANKS
    KUMAR

    Hi,
    It's not advisable to modify the standard tables through program. If you want you can do using MODIFY.
    MODIFY database_table FROM TABLE itab.
    Thanks,
    Sri.

  • 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

  • JDBC Scenario: Delete all the existing records and Insert

    Dear All,
    Scenario: IDoc to JDBC
    PI need to delete all the existing records in the SQL table then need to insert the records.I have created a two statements in the target structure.
    Statement1
       -> TableName
           -> action : DELETE
           -> Table : TableName
    Statement2
       -> TableName
           -> action : INSERT
           -> Table : TableName
           ->Access
               -> Elements
    I am getting below error while try to delete the records in the table.
    JDBC message processing failed; reason Error processing request in sax parser: Error when executing statement for  table/stored proc. 'Tablename' (structure 'Statement1'): java.sql.SQLException: FATAL ERROR document format: structure 'Statement1', no key element found
    Note: we use above structure in the another interface without specifying any Key for Delete operation(Server is same but different database for this two interface) and it works fine. Although the Primary keys has been set in the SQL table i am getting the above error.
    let me know what are the setting need to make in PI and SQL DB to achieve this.
    Regards,
    Manikandan Shanmugam
    Edited by: Manikandan Shanmugam on Nov 8, 2011 6:19 AM

    The straucture what you have deined for Delete is not correct, you should have key field in statement structure then only you can perform Delete operation.
    refer below link
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b6e85fde93673e10000000a114a6b/content.htm
    Regards,
    Raj

  • How to get the list of database Views modifying the DB tools list tables.vi

    Hi,
    I have a problem, I just started using LabVIEW and in particular the LabVIEW connectivity toolkit and I am lookig fgor suggestion regarding how to get the list of database Views modifying the DB tools list tables.vi...
    Thanks in advance,
    Michela

    Hi Michela,
    since the VI you want to modify is part of a Toolkit, I suggest you to copy the whole block diagram in a new VI and then save it in a new location.
    Place the DB List Tables.vi on a block diagram, double click on it and go to the tab "Window -> Show Block Diagram "
    Select "Edit -> Select All" to select the whole block diagram and select "Edit -> Copy"
    Open a new VI and select "Edit -> Paste"
    Save the new VI
    In this way you can modify everything you want without overwriting the Toolkits VIs.
    Hope this can help.
    Regards, 
    Andrea N.
    Systems Engineer ATE & RF - Mediterranean Region
    National Instruments Italy

  • Want to Dsiable the Existing Records

    hi All,
    i am Using Database 9i and Oracle Forms 6i
    i have a tabular bock of 10 records to Display and it has 4 four Records in the table
    i want to do is when i fetch my Records , the Existing Records(4 Records) will Disable and the Record where my Cursor is (5th Record) will Enable , if 1 Column of the Existing Records will Disable it will be Enough for me
    plzz can any tell me how can i Do this !!
    thnks

    hello,
    this is a commoon request please try to search the forum.

  • Dev-client not letting change the existing record in PA30

    Hello Experts!!
           I don’t know I have to ask this question here . I have created ALE link between our DEV system and QA system for our dry run .Two days before Basis team copy the data from PRD to Dev and also in Qa6 to make them in sink. When user is changing data in DEv6. They are getting an error message ,the is maintained in Dev_100. its not changing the existing record .Can some body explain me what’s happening here .
    Cheers
    Usman

    Hi Usman .
              you’ll say " here he comes again " . Any way you need to run <u><b>tr.BDLS</b></u> , It basically change the system name in SCC4 and also update the tables which kept the system name and after that you’ll be able to change the existing record in the system .
             hope this’ll give you the solution .Don’t forget to award points
    Thanks
    Saquib khan

  • Have field map to existing record in table by secondary key

    Let's say I have a person table and a code table.
    person.datastoreId
    person.name
    person.foreignKeyToCodeValue
    code.datastoreId
    code.codeValue
    code is a static lookup table. I want to persist a new Person object:
    personObject.name = whatever
    personObject.code = something
    Obviously, person.code is mapped in the mapping XML to the code.codeValue
    table.
    If I call makePersistent(personObject) it will create a new record in the
    code table, right? if codeValue had a unique constraint on it, is there a
    way, so that it would automatically associate that person.codeValue with
    the existing record instead of creating a new one?
    I know I could do a query to get the codeValue object first and assign
    personObject.code to that, but I'm wondering if there is a way to avoid
    that.
    Thanks!
    Joel Shellman

    Joel-
    You will need to implement this sort of singleton pattern yourself.
    The most common way would be to do something like:
    public class Person
    private Code code;
    public void setCodeValue (String value)
    try
    code = (Code)JDOHelper.getPersistenceManager (this).
    getObjectById (new CodeValue.ID (value), false);
    catch (ObjectNotFoundException none)
    // none exists; make a new one with the specified key
    code = new Code ();
    code.setPrimaryKeyField (value);
    In article <bvtod5$nkp$[email protected]>, Joel Shellman wrote:
    Let's say I have a person table and a code table.
    person.datastoreId
    person.name
    person.foreignKeyToCodeValue
    code.datastoreId
    code.codeValue
    code is a static lookup table. I want to persist a new Person object:
    personObject.name = whatever
    personObject.code = something
    Obviously, person.code is mapped in the mapping XML to the code.codeValue
    table.
    If I call makePersistent(personObject) it will create a new record in the
    code table, right? if codeValue had a unique constraint on it, is there a
    way, so that it would automatically associate that person.codeValue with
    the existing record instead of creating a new one?
    I know I could do a query to get the codeValue object first and assign
    personObject.code to that, but I'm wondering if there is a way to avoid
    that.
    Thanks!
    Joel Shellman--
    Marc Prud'hommeaux [email protected]
    SolarMetric Inc. http://www.solarmetric.com

  • Only query on existing form without any changes on the existing records?

    Dear all,
    I am working a brand new form. The form is able to query all the records from the table. However, when I leave the form, it will ask me "Do you want to save the changes you have made?" everytime. I didn't make any changes on the existing records.
    My form only has 2 fields (one with LOV and one without).
    Does anyone know what went wrong?
    Thanks.

    How do you populate your datablock? Do you query one of your values in a Post-Query trigger?
    However you are populating your datablock, Forms is detecting that the status of the Form, Block or Record is changing.
    Also, please let us know your Forms version.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Captivate 8 Tin Can - problem communicating with the learning record store

    When publishing a course to Tin Can format, what should I enter in the 'Identifier' field?
    If I publish with the default 'Course_ID1' text, I get an error when launching the course on our LMS. Errors says "There was a problem communicating with the learning record store."

    Hello,
    Welcome to Adobe Forums.
    Please share your contact information via [email protected]
    Thanks,
    Vikram Gaur
    Adobe Support

  • How  to  copy  the  table1selected  records into table 2 in webdynpro java.

    Hi 
           how  to  copy  the  table1selected  records into table 2 in webdynpro java.
    venkat
    Edited by: venkatpvr on Sep 23, 2011 11:53 AM

    Hi Venkat,
    You have 2 Value Nodes one for Table1 and second for Table2.
    Table1 node having one more Value Attribute i.e check Box data type is Boolean. Now you are requirement are select records from Table1 Node and click on One Method that records will moves to Second Table2 Node.
    Create One Method for getting the Records from 1-Table to 2-Table
    CopytoTable2 ()
    In this method you have to write code like this
    If (wdContext.nodeTable1.Checkbox(true))
    If(1. Check the Table1 Value Node Size()>0)
    Get the Table1 records and set to table2 Value node.
    Else
    Please select check box// Error message
    Hope this helps!!
    Regards
    Vijay K

  • Problem to modify the field "location" in an AP on WCS

    Hello everybody,
    I have a problem to modify the field "location" in an access point on WCS.
    In fact, when i try to modify this field and then apply the modification, i have this error message :
    "Error(s): You must correct the following error(s) before proceeding:
    Error:Global Username and Password are not configured on the associated controller.  Please configure username and password on the associated controller before disabling 'Override Global Username Password'."
    I made the modification on Chrome and Firefox but I always have the error message.
    Nevertheless, i don't have this error message with other access points and other access points are configured without the option "Override Global Username Password".
    I'm obliged to make the modification directly in the controller and not in WCS.
    The problem is that i want to make the modification directly in WCS.
    Could you help me please ?
    Thank you in advance.

    When i make the modification directly in WCS, i have no problem, it syncs good.
    The version of WCS is 7.0.230.0.
    The version of the controller is 7.0.240.0 and the field recovery image version is 7.0.112.21.
    Version
    7.0.230.0
    Version
    7.0.230.0
    Version
    7.0.230.0

Maybe you are looking for

  • IPod Touch not recognized by mac computer

    I have just upgraded my os to Leopard and now when I plug in my iPod touch, iTunes does not open, and when I open it, it does not show my iPod. Can someone tell me how to get my computer to see my ipod.

  • HP Mini 110-3104sa Replacement Keyboard

    Hi The keyboard on my HP Mini 110-3104sa is not working and I'm trying to find the part number to order a replacement. Any help will be greatly appreciated. Thanks

  • Pdf forms (emails) not working after update

    I recently have discovered that muse is not sending email pdf forms from the website. Is this a bug? I could not get it to work from preview or browser. I even uploaded a test and sure enough it doesn't send the form. The form sends fine from acrobat

  • Thoughts on ZFS-FUSE stability?

    I'm considering putting ZFS on my home file server for the data drives, and setting it up for mirrored RAID. I was wondering if anyone had any experiences with it as far as stability and data loss, good or bad. Performance isn't a HUGE concern, since

  • Desktop folder not updating

    This is very odd. Most files that get saved onto my Desktop folder by applications simply doesn't appear there - not on the desktop, not in the desktop folder in the finder, nowhere. But the file's there, 'cos in the terminal 'ls' can see it fine. So