<?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: table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324500#M510717</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi buddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Just check the sy-datar value, which will set if there is any change in the screen field. In your code check sy-datar is initial display the values pulled from database table(which indeed will have the latest data) if sy-datar is set, first update your database table with the values in your screen, then pull the values from database table. Which is going to give the updated data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using some variables for changing the text in your PAI logic. Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jul 2007 23:09:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-06T23:09:51Z</dc:date>
    <item>
      <title>table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324498#M510715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could anyone plz help in the following problem.there is a table control on which  i have fields like  serial no and version no. Corresponding to one pack_id, there are many serial no. and coresponding to one serial no there are many versions. my problem is to ensure:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no second version no is generated  for a serial no when add button is pressed until previuos one has been saved. in Ztable.(note: serial nos are generated on clicking ADD button and when we select a particular row , version nos are generated.default version no is 1 )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on pressing a history button in change and create mode, only serial no with latest version number should appear in table control. and text of history button should change to 'Recorded Data'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;could anyone help me in this regard.. &lt;/P&gt;&lt;P&gt;							thanks &amp;amp;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Jun 2007 12:55:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324498#M510715</guid>
      <dc:creator>SandySingh</dc:creator>
      <dc:date>2007-06-06T12:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324499#M510716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI sandeep,&lt;/P&gt;&lt;P&gt;need some more clarifications from your side.&lt;/P&gt;&lt;P&gt;1.How you are generating the serial number and version number .&lt;/P&gt;&lt;P&gt;through number range (snro) or + 1 to number of records&lt;/P&gt;&lt;P&gt;2.In display mode do you want to display all packid sno and all versions corresponds to dat?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i can give u one solution with the idea i got from ur post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.You can generate the next serial number or version number  after checking the ztable .&lt;/P&gt;&lt;P&gt;2.select max(sno) into wrk_sno where productid = '123'.&lt;/P&gt;&lt;P&gt;3.when you are pressing add button increment this wrk_sno.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i can give you proper solution if the specification is proper.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points if the above solution is helpful to you.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2007 12:42:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324499#M510716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-06T12:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324500#M510717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi buddy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Just check the sy-datar value, which will set if there is any change in the screen field. In your code check sy-datar is initial display the values pulled from database table(which indeed will have the latest data) if sy-datar is set, first update your database table with the values in your screen, then pull the values from database table. Which is going to give the updated data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using some variables for changing the text in your PAI logic. Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2007 23:09:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324500#M510717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-06T23:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324501#M510718</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;&amp;lt;b&amp;gt;ADD : &amp;lt;/b&amp;gt;Before generating a new version, select a row from the table ZTABLE with the current key combination(serial no &amp;amp; version no). If sy-subrc = 0, it means that the current version has been saved to the table ZTABLE, so you can generate a new version but if sy-subrc &amp;lt;&amp;gt; 0, it means that the current version has not been saved to ZTABLE, hence dont generate a new version. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;HISTORY :&amp;lt;/b&amp;gt; Select data from table ZTABLE into an internal table (it_itab). Then, sort the internal table as SORT it_itab serial_no ASCENDING version_no DESCENDING. Then use DELETE ADJACENT DUPLICATES FROM it_itab COMPARING serial_no. Now, your internal table (it_itab) will have serial nos with only current data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;OR&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;HISTORY :&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Use following code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT serial_no version_no
  FROM ztable
  INTO TABLE it_itab
  ORDER BY serial_no ASCENDING
           versio_no DESCENDING.

IF SY-SUBRC = 0.
  DELETE ADJACENT DUPLICATES FROM it_itab COMPARING vbeln.
ELSE.
  REFRESH it_itab.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will give you serial_no with their latest version nos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dont hard code the text of the History button. Assign a variable to it. So, by changing the value of the variable, the text can be changed from 'HISTORY'  to 'RECORDED DATA'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if the answer is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mukul&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Mukul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2007 23:33:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324501#M510718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-06T23:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324502#M510719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot for your suggestions. its very help ful...thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2007 04:07:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control/m-p/2324502#M510719</guid>
      <dc:creator>SandySingh</dc:creator>
      <dc:date>2007-07-13T04:07:53Z</dc:date>
    </item>
  </channel>
</rss>

