<?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: Deleting records from internal table using formatted timestamp in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668144#M29331</link>
    <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;vireshdshah&lt;/SPAN&gt; : if your source data have string type with it own format, you have to split the string to create date, and time (with type DATS and TIMS) then you convert to timestamp (type: TIMESTAMP) with statement CONVERT TIME STAMP. you may add extra timestamp field in your table to do it or you can loop through the table, assign to help variable and compare.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2018 23:56:44 GMT</pubDate>
    <dc:creator>DoanManhQuynh</dc:creator>
    <dc:date>2018-12-06T23:56:44Z</dc:date>
    <item>
      <title>Deleting records from internal table using formatted timestamp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668140#M29327</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;TYPES: BEGIN OF ty_tbl,

        v1 TYPE string,

       END OF ty_sum.



DATA: lt_tbl TYPE STANDARD TABLE OF ty_sum,

      ls_tbl TYPE ty_sum.


ls_sum-v1 = '09/10/2018 23.22.10.120'.

APPEND ls_sum to lt_sum.

ls_sum-v1 = '08/12/2015 03.22.10.120'.

APPEND ls_sum to lt_sum.


ls_sum-v1 = '09/10/2016 23.22.10.120'.

APPEND ls_sum to lt_sum.

ls_sum-v1 = '07/10/2017 23.22.10.120'.

APPEND ls_sum to lt_sum.



DELETE lt_sum WHERE v1 NOT BETWEEN '09/01/2018' AND '09/30/2018'.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Here, I want that internal table should have data that are specified in the date range and return just the counts.&lt;/P&gt;
  &lt;P&gt;But delete statement returns 2 records instead of 1, as it compares '09' and rest of the string is ignored.&lt;/P&gt;
  &lt;P&gt;Note: I have tried with both formatted date and timestamp. These timestamps are directly extracted and populated in the internal table in actual in STRING format.&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/249256-result.jpg" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 06:13:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668140#M29327</guid>
      <dc:creator>former_member548680</dc:creator>
      <dc:date>2018-12-06T06:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting records from internal table using formatted timestamp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668141#M29328</link>
      <description>&lt;P&gt;you comparing string so that is what you get, if you want to compare as a date or timestamp, your field v1 should have date or timestamp type. i dont know how did you populate data but i dont think timestamp will converted into string.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 06:27:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668141#M29328</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-12-06T06:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting records from internal table using formatted timestamp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668142#M29329</link>
      <description>&lt;P&gt;I think it would be best to pass the timestamp to a timestamp type field and do the delete operation. &lt;/P&gt;&lt;P&gt;internal table data is having both the date and time, so you have to use the below statement to get timestamp for date and time.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapconvert_date_time-stamp.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapconvert_date_time-stamp.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;dont forget to pass the same timestamp conversion date to the where condition in delete operation&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 06:29:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668142#M29329</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2018-12-06T06:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting records from internal table using formatted timestamp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668143#M29330</link>
      <description>&lt;P&gt;Agree. I am comparing the string basically not the timestamp, but is there an alternate way to this?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 09:04:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668143#M29330</guid>
      <dc:creator>former_member548680</dc:creator>
      <dc:date>2018-12-06T09:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting records from internal table using formatted timestamp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668144#M29331</link>
      <description>&lt;P&gt; &lt;SPAN class="mention-scrubbed"&gt;vireshdshah&lt;/SPAN&gt; : if your source data have string type with it own format, you have to split the string to create date, and time (with type DATS and TIMS) then you convert to timestamp (type: TIMESTAMP) with statement CONVERT TIME STAMP. you may add extra timestamp field in your table to do it or you can loop through the table, assign to help variable and compare.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 23:56:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668144#M29331</guid>
      <dc:creator>DoanManhQuynh</dc:creator>
      <dc:date>2018-12-06T23:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting records from internal table using formatted timestamp</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668145#M29332</link>
      <description>&lt;P&gt;Thank you all closing&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 06:33:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deleting-records-from-internal-table-using-formatted-timestamp/m-p/668145#M29332</guid>
      <dc:creator>former_member548680</dc:creator>
      <dc:date>2018-12-07T06:33:30Z</dc:date>
    </item>
  </channel>
</rss>

