<?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 counter logic in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/counter-logic/m-p/4445317#M1054365</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;in my selection screen i have billing doc no- vbeln.&lt;/P&gt;&lt;P&gt;in my ztable i have etimes a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i enter a bill doc no and press f8, my etimes feild in ztable sets to 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my requirement is if i enter a bill doc as 97600654 for first time, etimes is 1.&lt;/P&gt;&lt;P&gt;for second time if i enter that same bill doc i.e 97600654 , etimes should be 2 and if third then 3 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if a new doc is entered then etimes is again 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to code this..plz provide some code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Sep 2008 16:06:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-18T16:06:34Z</dc:date>
    <item>
      <title>counter logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counter-logic/m-p/4445317#M1054365</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;in my selection screen i have billing doc no- vbeln.&lt;/P&gt;&lt;P&gt;in my ztable i have etimes a field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when i enter a bill doc no and press f8, my etimes feild in ztable sets to 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my requirement is if i enter a bill doc as 97600654 for first time, etimes is 1.&lt;/P&gt;&lt;P&gt;for second time if i enter that same bill doc i.e 97600654 , etimes should be 2 and if third then 3 and so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if a new doc is entered then etimes is again 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to code this..plz provide some code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2008 16:06:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counter-logic/m-p/4445317#M1054365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-18T16:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: counter logic</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counter-logic/m-p/4445318#M1054366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If there is concorrency, you should consider on locking your ztable first. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, just do something similar to this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CLEAR w_etimes.
SELECT SINGLE etimes FROM ztable 
  INTO (w_etimes) 
 WHERE vbeln EQ p_vbeln.

IF sy-subrc EQ 0.
  ADD 1 TO w_etimes.
  UPDATE ztable 
     SET etimes = w_etimes
   WHERE vbeln EQ p_vbeln.
ELSE.
  wa-vbeln = p_vbeln.
  wa-etimes = 1.
  INSERT ztable FROM wa.  
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Valter Oliveira.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2008 16:12:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counter-logic/m-p/4445318#M1054366</guid>
      <dc:creator>valter_oliveira</dc:creator>
      <dc:date>2008-09-18T16:12:12Z</dc:date>
    </item>
  </channel>
</rss>

