<?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 GET_MAX_INDEX( ) in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-max-index/m-p/2929511#M690279</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;Now Im studying ABAP Objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know that the use of command , &amp;lt;b&amp;gt;GET_MAX_INDEX( )&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I want to what are the commands are there like this GET_MAX_INDEX( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Points assured.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Oct 2007 12:28:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-18T12:28:42Z</dc:date>
    <item>
      <title>GET_MAX_INDEX( )</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-max-index/m-p/2929511#M690279</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;Now Im studying ABAP Objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to know that the use of command , &amp;lt;b&amp;gt;GET_MAX_INDEX( )&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and I want to what are the commands are there like this GET_MAX_INDEX( ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Points assured.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 12:28:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-max-index/m-p/2929511#M690279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T12:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: GET_MAX_INDEX( )</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-max-index/m-p/2929512#M690280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This Method is used to get the Max. index number.&lt;/P&gt;&lt;P&gt;Generally we need to develop class with some tale functionalities like SAVE_NAME,WRITE_NAMES,CLEAR_TABLE,GET_MAX_INDEX etc.&lt;/P&gt;&lt;P&gt;In that methods we need to develop code.&lt;/P&gt;&lt;P&gt;In case of GET_MAX_INDEX()&lt;/P&gt;&lt;P&gt;METHOD get_max_index.&lt;/P&gt;&lt;P&gt;DATA id TYPE i.&lt;/P&gt;&lt;P&gt;SELECT MAX( id ) FROM mytable INTO id.&lt;/P&gt;&lt;P&gt;maximal = id.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&lt;/P&gt;&lt;P&gt;return parameter MAXIMAL of type i.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ashok.N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 13:18:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-max-index/m-p/2929512#M690280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T13:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: GET_MAX_INDEX( )</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-max-index/m-p/2929513#M690281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;GET_MAX_INDEX( ) supplies you with the highest index value of the database table. This ensure that the new entry gets a unique index value.In the two next lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Means  when  you want to insert an Data entry  in the  Database table    through   SAVE...then   in the Method  SAVE_NAME  see the  GET_MAX_INDEX( ) .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

METHOD save_name.
DATA struc_my_table TYPE mytable.
struc_my_table-id = get_max_index( ) + 1.
struc_my_table-firstname = p_name-firstname.
struc_my_table-secondname = p_name-secondname.
INSERT INTO mytable VALUES struc_my_table.
ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the second line, you can see perfectly how easy it is to get a work area in an ABAP program for the work with a database table Assign to a data field the type of the database table as data type. You get a structure wit the line type of the database table.In the next line, the function GET_MAX_INDEX( ) supplies you with the highest index value of the database table. This ensure that the new entry gets a unique index value.In the two next lines, you fill in the respective components of the work area structurewith the appropriate components of the input parameter, and then you enter the line into the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The method GET_MAX_INDEX with the return parameter MAXIMAL of type i:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
METHOD get_max_index.
DATA id TYPE i.
SELECT MAX( id ) FROM mytable INTO id.
maximal = id.
ENDMETHOD.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward  points if it is usefull ...&lt;/P&gt;&lt;P&gt;Girish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Oct 2007 14:04:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-max-index/m-p/2929513#M690281</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-18T14:04:06Z</dc:date>
    </item>
  </channel>
</rss>

