<?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: Database Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367375#M808078</link>
    <description>&lt;P&gt;SY-DBCNT is used to get the number of records in the table. Sort the table descending order and on that read the table index 1, then you can retrieve the last records in the table.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Feb 2022 08:51:47 GMT</pubDate>
    <dc:creator>shivani08</dc:creator>
    <dc:date>2022-02-21T08:51:47Z</dc:date>
    <item>
      <title>Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367367#M808070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How to find the total number of records in a database table? and how to fetch the last record?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kalaivani P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 08:11:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367367#M808070</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-25T08:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367368#M808071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;To find out total number of records in a database table use Function module..TABLECOUNT&lt;/P&gt;&lt;P&gt;and in this one Pass Table name and client number as input&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 08:13:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367368#M808071</guid>
      <dc:creator>former_member188829</dc:creator>
      <dc:date>2008-01-25T08:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367369#M808072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use &lt;STRONG&gt;SY-DBCNT&lt;/STRONG&gt; system varaible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sy-dbcnt -Nunber of records in database table&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the last record use &lt;STRONG&gt;describe statment&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: lv_line type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Describe table itab lines lv_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab into wa_itab index lv_line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards if useful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 08:16:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367369#M808072</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-25T08:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367370#M808073</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data : l_count(10).&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select count(*) from ( table ) into l_count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_count will be the last record number&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But reading the last record from the database table you need to get those in one internal table and later&lt;/P&gt;&lt;P&gt;read table itab with index l_count.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 08:27:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367370#M808073</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-25T08:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367371#M808074</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use system field &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sy-dbcnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u can use the last value of the system field to get the value of the last record in the dtabase table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rewrd if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 08:27:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367371#M808074</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-25T08:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367372#M808075</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;U can get the totl number of records by this syntax..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT COUNT(*) FROM ztable INTO variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nagaraj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 08:28:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367372#M808075</guid>
      <dc:creator>former_member404244</dc:creator>
      <dc:date>2008-01-25T08:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367373#M808076</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to fetch the last record from the database table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 09:25:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367373#M808076</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-25T09:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367374#M808077</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;To get the last record from the table use SY_DBCNT&lt;/P&gt;&lt;P&gt;This will give the database count ( number of records in the table ).&lt;/P&gt;&lt;P&gt; Read the last record with the index as SY-DBCNT values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from table into itab.&lt;/P&gt;&lt;P&gt;lv_lines = sy-dbcnt.&lt;/P&gt;&lt;P&gt;read table itab into wa index lv_lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this code the wa contains the last record of the table.&lt;/P&gt;&lt;P&gt;Hope this clarifies you&lt;/P&gt;&lt;P&gt;Reward points if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2008 10:43:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367374#M808077</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-25T10:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367375#M808078</link>
      <description>&lt;P&gt;SY-DBCNT is used to get the number of records in the table. Sort the table descending order and on that read the table index 1, then you can retrieve the last records in the table.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 08:51:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/3367375#M808078</guid>
      <dc:creator>shivani08</dc:creator>
      <dc:date>2022-02-21T08:51:47Z</dc:date>
    </item>
  </channel>
</rss>

