<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: to insert duplicate records into table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437254#M1053089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If a bespoke Z table then you can introduce extra "counter" or "duplicate" key field as you have seen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By default the value 0 would be given to existing entries when you modify the table structure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever you attempt to insert a duplicate you would get an error, you would then increment the counter by 1 and retry. Failing that if you expect many duplicate entries it is better to do a SELECT MAX ( counter ) using the remaining table key before attempting an insert and incrementing the result by 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've had to do this in the past. It is worth adding error handling for the event when your counter field hits the limit e.g. 99 for a 2 digit domain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Sep 2008 12:39:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-17T12:39:11Z</dc:date>
    <item>
      <title>to insert duplicate records into table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437249#M1053084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  i have a table in that i have to insert duplicate records i.e with same key field values i have to insert multiple records and i cannot change the present stucture of the table. how can i handle this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;pavan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 11:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437249#M1053084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T11:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: to insert duplicate records into table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437250#M1053085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please dont try things against RDBMS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 11:32:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437250#M1053085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T11:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: to insert duplicate records into table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437251#M1053086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i am not going to do anything that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i mean to say, is there any possibilty of adding new field to the table and using some counter value in program and can i add records. ( i cant change the existing key fields structure from my table ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 11:36:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437251#M1053086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T11:36:07Z</dc:date>
    </item>
    <item>
      <title>Re: to insert duplicate records into table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437252#M1053087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to insert duplicate entries you can do it by using the extension "ALLOW DUPLICATE ENTRIES" with the INSERT command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to identify the latest record after inserting the duplicate entries then you can check with the following possibility:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Insert 2 fields in the existing table structure: &lt;/P&gt;&lt;P&gt;1. Record Valid From&lt;/P&gt;&lt;P&gt;2. Record Valid To&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When ever you insert a record mark the Valid From as the current date and Valid to as 31.12.9999...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this when you want to insert a new record with same key fields....&lt;/P&gt;&lt;P&gt;for the first record change the Valid To date as current date&lt;/P&gt;&lt;P&gt;Insert new record with Valid from date = current date and Valid from date = 31.12.9999&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Before inserting new record:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Record No.          Key fields                    Valid From Date        Valid To Date         .....other fields&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1                   XXXXXXXXXXXXXXXXX             31.08.2008               31.12.9999          XXXXXXXXXXXXXXXXXXX&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;After Inserting new record&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1                   XXXXXXXXXXXXXXXXX             31.08.2008               17.09.2008         XXXXXXXXXXXXXXXXXXXX&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2                   XXXXXXXXXXXXXXXXX             17.09.2008               31.12.9999         XXXXXXXXXXXXXXXXXXXX&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kunjal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 11:47:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437252#M1053087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T11:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: to insert duplicate records into table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437253#M1053088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if we check VBEP  table ( schedule line table) there ETENR field is added as counter for the key fields. i want to implement some similar kind of logic in my program but i am unable to find how to do that. &lt;/P&gt;&lt;P&gt;can aneone provide me some idea??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.,&lt;/P&gt;&lt;P&gt;pavan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 12:26:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437253#M1053088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T12:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: to insert duplicate records into table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437254#M1053089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If a bespoke Z table then you can introduce extra "counter" or "duplicate" key field as you have seen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By default the value 0 would be given to existing entries when you modify the table structure. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whenever you attempt to insert a duplicate you would get an error, you would then increment the counter by 1 and retry. Failing that if you expect many duplicate entries it is better to do a SELECT MAX ( counter ) using the remaining table key before attempting an insert and incrementing the result by 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've had to do this in the past. It is worth adding error handling for the event when your counter field hits the limit e.g. 99 for a 2 digit domain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2008 12:39:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/to-insert-duplicate-records-into-table/m-p/4437254#M1053089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-17T12:39:11Z</dc:date>
    </item>
  </channel>
</rss>

