<?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: Logic on date in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-on-date/m-p/741715#M35436</link>
    <description>&lt;P&gt;lv_podate much be between zfrom_date and zto_date but your sql conditions is not correct. and why you have to concatenate the date, just lets it asis.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; SELECT SINGLE zmargin
 FROM zsa_po_margin
 INTO @DATA(lv_po_margin)
 WHERE zfrom_date &amp;lt;= @i_ekko-aedat AND
         zto_date &amp;gt;= @i_ekko-aedat .&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 20 Nov 2018 08:51:49 GMT</pubDate>
    <dc:creator>DoanManhQuynh</dc:creator>
    <dc:date>2018-11-20T08:51:49Z</dc:date>
    <item>
      <title>Logic on date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-on-date/m-p/741713#M35434</link>
      <description>&lt;P&gt;I have my internal table structure as below - &lt;/P&gt;
  &lt;P&gt;From Date | To Date | Margin&lt;/P&gt;
  &lt;P&gt;________________________&lt;/P&gt;
  &lt;P&gt;20180725 |20181116 | 2.50&lt;/P&gt;
  &lt;P&gt;20181117 |99991231 | 3.00&lt;/P&gt;
  &lt;P&gt;Based on PO creation date it should pick the margin value. &lt;/P&gt;
  &lt;P&gt;For example my PO creation date is 20180726. It should pick 2.50 as margin.&lt;/P&gt;
  &lt;P&gt;I have the code as below. But its picking 3.00 as margin. Please help.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt; DATA(zyear)  = i_ekko-aedat+0(4).
 DATA(zmonth) = i_ekko-aedat+4(2).
 DATA(zdate)  = i_ekko-aedat+6(2).
 CONCATENATE zyear zmonth zdate INTO lv_podate.
 SELECT SINGLE zmargin
       FROM zsa_po_margin
       INTO @DATA(lv_po_margin)
       WHERE  zfrom_date &amp;gt;= @lv_podate AND
              zto_date   &amp;lt;= @lv_podate .
&amp;lt;br&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Nov 2018 05:16:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-on-date/m-p/741713#M35434</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-11-20T05:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Logic on date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-on-date/m-p/741714#M35435</link>
      <description>&lt;P&gt;Your code look for a record where from date is greater than a date and to date lower, some kind of reversed logic or a typo? &lt;/P&gt;</description>
      <pubDate>Tue, 20 Nov 2018 07:24:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-on-date/m-p/741714#M35435</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2018-11-20T07:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Logic on date</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/logic-on-date/m-p/741715#M35436</link>
      <description>&lt;P&gt;lv_podate much be between zfrom_date and zto_date but your sql conditions is not correct. and why you have to concatenate the date, just lets it asis.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; SELECT SINGLE zmargin
 FROM zsa_po_margin
 INTO @DATA(lv_po_margin)
 WHERE zfrom_date &amp;lt;= @i_ekko-aedat AND
         zto_date &amp;gt;= @i_ekko-aedat .&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Nov 2018 08:51:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/logic-on-date/m-p/741715#M35436</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-11-20T08:51:49Z</dc:date>
    </item>
  </channel>
</rss>

