<?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: Insert into z custom table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987380#M1341836</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;Take a look at the following code. it will insert the record and display the error message for duplicate records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_err_flag TYPE c,&lt;/P&gt;&lt;P&gt;        lv_recnum(10) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT gi_itab INTO wa_itab.&lt;/P&gt;&lt;P&gt;    INSERT into ztab values wa_itab.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      READ TABLE gi_itab INTO wa_itab INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;      lv_recnum = sy-tabix.&lt;/P&gt;&lt;P&gt;      WRITE: /'Record# '(001) NO-GAP, lv_recnum NO-GAP, 'was not created- '(002), wa_itab.&lt;/P&gt;&lt;P&gt;      lv_err_flag = 'X'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  ULINE.&lt;/P&gt;&lt;P&gt;  IF lv_err_flag = 'X'.&lt;/P&gt;&lt;P&gt;    WRITE /'Process completed with some error records.'(003).&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    WRITE /'Process completed successfully.'(004).&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh Kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rajesh Kumar on Jul 31, 2009 5:41 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2009 03:13:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-31T03:13:51Z</dc:date>
    <item>
      <title>Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987377#M1341833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I want to insert records into a custom DB table that has already having values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  It is like, if the table has 100 records, the insert/modify statement should insert the records from 101 onwards without eliminating the previous records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Micheal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 19:17:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987377#M1341833</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-30T19:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987378#M1341834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As long as you know there won't be any key violations on this table, you could do it as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
INSERT
  ztable
FROM
  wa_workarea.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 19:29:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987378#M1341834</guid>
      <dc:creator>dennis_scoville4</dc:creator>
      <dc:date>2009-07-30T19:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987379#M1341835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi micheal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;before inserting in to table ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ztable.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;sy-tabix will contains the number of records..&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next increment the record..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or check the&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select max(record) from ztable.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert the new record with number record = record + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2009 19:31:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987379#M1341835</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-30T19:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987380#M1341836</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;Take a look at the following code. it will insert the record and display the error message for duplicate records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: lv_err_flag TYPE c,&lt;/P&gt;&lt;P&gt;        lv_recnum(10) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT gi_itab INTO wa_itab.&lt;/P&gt;&lt;P&gt;    INSERT into ztab values wa_itab.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;      READ TABLE gi_itab INTO wa_itab INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;      lv_recnum = sy-tabix.&lt;/P&gt;&lt;P&gt;      WRITE: /'Record# '(001) NO-GAP, lv_recnum NO-GAP, 'was not created- '(002), wa_itab.&lt;/P&gt;&lt;P&gt;      lv_err_flag = 'X'.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;  ULINE.&lt;/P&gt;&lt;P&gt;  IF lv_err_flag = 'X'.&lt;/P&gt;&lt;P&gt;    WRITE /'Process completed with some error records.'(003).&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    WRITE /'Process completed successfully.'(004).&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rajesh Kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rajesh Kumar on Jul 31, 2009 5:41 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 03:13:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987380#M1341836</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T03:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987381#M1341837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi michal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to the Data base concepts duplicate records wond be inserted into the data base table. but ensure that all the values in the record should be differnt then only the record will be inserted. otherwise it wont be inserted into data base table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eventhough when your inserting the values inserted record will be sorted and placed based onthe order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 05:49:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987381#M1341837</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T05:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987382#M1341838</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;What are all the records you have to inset into the customized table is updated into an internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use this statement to update this internal table values into customized table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT &amp;lt;Z table name&amp;gt; FROM TABLE &amp;lt;internal table name&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before use this query you have to check the primary key fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;John Victor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 06:44:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987382#M1341838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-31T06:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987383#M1341839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fill your record in a work area(WA) and then use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert into Ztable values WA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thats it.&lt;/P&gt;&lt;P&gt;let me know if you have any doubt&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Manu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2009 09:39:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987383#M1341839</guid>
      <dc:creator>manubhutani</dc:creator>
      <dc:date>2009-07-31T09:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987384#M1341840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could you please let me know whether we need to check the duplicate entries for primary key fields.&lt;/P&gt;&lt;P&gt;Since when I am trying to insert a new record with same entries, I am getting an error. Its working fine.&lt;/P&gt;&lt;P&gt;But when I try to insert a new record with same primary key(onle plant is the key in my table, so i cant change the value everytime when I insert records), its not getting inserted into the table using INSERT dbtab from wa.&lt;/P&gt;&lt;P&gt;Please help me out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 05:34:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987384#M1341840</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-03T05:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987385#M1341841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If u want to insert more rows with the same plant then u must have more than one fields as the key for ur table. The plant can have the same value then but the combination of plant plus other field must be unique.&lt;/P&gt;&lt;P&gt;Hope this clarifies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 05:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987385#M1341841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-04T05:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Insert into z custom table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987386#M1341842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have declarew primary key in you table then dublictarrecord can not br inserted at any cost becose the functionality &lt;/P&gt;&lt;P&gt;of primary key is removing dublicacy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2011 08:12:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/insert-into-z-custom-table/m-p/5987386#M1341842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-04-11T08:12:39Z</dc:date>
    </item>
  </channel>
</rss>

