<?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: SQL query and Delete the data based on condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-and-delete-the-data-based-on-condition/m-p/7482864#M1556470</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;When dates are in different formats you have to always convert them into one common format and then do the checks. Its better to convert the date in the variable into timestamp(using CONVERT DATE statement-look for abapdocu for its usage) and then compare it with the date on database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: gv_var1  TYPE timestamp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;convert date sy-datum into time stamp gv_var1.&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from DD03l&lt;/P&gt;&lt;P&gt;into itab&lt;/P&gt;&lt;P&gt;where XXXX like gv_var1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should work now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shwetha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Nov 2010 14:41:30 GMT</pubDate>
    <dc:creator>shwetha_hs</dc:creator>
    <dc:date>2010-11-19T14:41:30Z</dc:date>
    <item>
      <title>SQL query and Delete the data based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-and-delete-the-data-based-on-condition/m-p/7482863#M1556469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have one requirement like I need to fetch the data from the table, In that table one filed (XXXXX) domain type is STAMP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete the data if the sy-datum ( length &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; is greater than field XXXXX  which has length 14.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest me how to delete or fetch the data with the same length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used below code..but did not work..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Concatenate sy-datum '%'  into gv_var1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;   from DD03l&lt;/P&gt;&lt;P&gt;   into itab&lt;/P&gt;&lt;P&gt; where XXXX like gv_var1."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and tried this one as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. DELETE itab WHERE XXXXX GT sy-datum.&lt;/P&gt;&lt;P&gt;2. DELETE itab WHERE XXXXX GT gv_var1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 14:23:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-and-delete-the-data-based-on-condition/m-p/7482863#M1556469</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-19T14:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query and Delete the data based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-and-delete-the-data-based-on-condition/m-p/7482864#M1556470</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;When dates are in different formats you have to always convert them into one common format and then do the checks. Its better to convert the date in the variable into timestamp(using CONVERT DATE statement-look for abapdocu for its usage) and then compare it with the date on database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: gv_var1  TYPE timestamp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;convert date sy-datum into time stamp gv_var1.&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from DD03l&lt;/P&gt;&lt;P&gt;into itab&lt;/P&gt;&lt;P&gt;where XXXX like gv_var1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should work now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shwetha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 14:41:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-and-delete-the-data-based-on-condition/m-p/7482864#M1556470</guid>
      <dc:creator>shwetha_hs</dc:creator>
      <dc:date>2010-11-19T14:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: SQL query and Delete the data based on condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-and-delete-the-data-based-on-condition/m-p/7482865#M1556471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Shwetha for your reply..Whatever you have given that did not work for me..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However I got the solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 16:34:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sql-query-and-delete-the-data-based-on-condition/m-p/7482865#M1556471</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-19T16:34:46Z</dc:date>
    </item>
  </channel>
</rss>

