<?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: ITAB Delete Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090016#M100409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank All my problem is solved. Your points awarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Dec 2005 03:55:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-27T03:55:46Z</dc:date>
    <item>
      <title>ITAB Delete Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090009#M100402</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 created the following ITAB;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data itab_sales_orders Like BAPIORDERS OCCURS 0 WITH HEADER LINE and this table has 1 record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a Loop I delete a record that means it does not contain any records;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab_sales_orders.&lt;/P&gt;&lt;P&gt;  DELETE itab_sales_orders INDEX sy-tabix.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in a SQL query I use itab_sales_orders;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BSTDK&lt;/P&gt;&lt;P&gt;   INTO VBKD-BSTDK&lt;/P&gt;&lt;P&gt;  FROM VBKD&lt;/P&gt;&lt;P&gt; FOR ALL ENTRIES IN itab_sales_orders&lt;/P&gt;&lt;P&gt;WHERE BSTKD = v_pono and&lt;/P&gt;&lt;P&gt;      VBELN = itab_sales_orders-SD_DOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBKD-BSTDK gets a value because the itab still contains a record. Idealy VBKD-BSTDK should be blank and no record should exist in itab. Why this happen?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kishan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2005 03:40:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090009#M100402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-27T03:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: ITAB Delete Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090010#M100403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt; You already deleted all records in itab.How you will get record for SQL query. first fill some data relevent to query  inside itab and execute query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Nandha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2005 03:44:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090010#M100403</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-27T03:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: ITAB Delete Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090011#M100404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Kishan,&lt;/P&gt;&lt;P&gt;    Using FOR ALL ENTRIES has a caution. If there is no record in the ITAB then in where clause it will be treated as '*'. Hence in the case of empty itab, your query can be re-written as:-&lt;/P&gt;&lt;P&gt;   SELECT BSTDK&lt;/P&gt;&lt;P&gt;   INTO VBKD-BSTDK&lt;/P&gt;&lt;P&gt;   FROM VBKD&lt;/P&gt;&lt;P&gt;   WHERE BSTKD = v_pono AND&lt;/P&gt;&lt;P&gt;         VBELN = '*'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deva.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2005 03:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090011#M100404</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-27T03:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: ITAB Delete Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090012#M100405</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;I think the value in the header line is not deleted, so you are getting this result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using free or clear and try.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2005 03:48:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090012#M100405</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-27T03:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: ITAB Delete Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090013#M100406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kishan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your problem is not with having some records in the itab, it is actually not having any records in the itab before you use it in the SELECT statement with the option FOR ALL ENTRIES. If there are no entries in your itab, then FOR ALL ENTRIES will select all records. Just before your SELECT statement, add this statement as follows.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF NOT itab_sales_orders[] IS INITIAL.
  SELECT BSTDK
    INTO VBKD-BSTDK
    FROM VBKD
    FOR ALL ENTRIES IN itab_sales_orders
  WHERE BSTKD = v_pono and
         VBELN = itab_sales_orders-SD_DOC.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2005 03:49:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090013#M100406</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-27T03:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: ITAB Delete Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090014#M100407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Check the initial condition before selecting.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if not itab_sales_orders[] is initial.
SELECT BSTDK
INTO VBKD-BSTDK
FROM VBKD
FOR ALL ENTRIES IN itab_sales_orders
WHERE BSTKD = v_pono and
VBELN = itab_sales_orders-SD_DOC.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Try this..&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2005 03:51:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090014#M100407</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-27T03:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: ITAB Delete Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090015#M100408</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;Before using FOR ALL ENTRIES, always check whether the table mentioned in FOR ALL ENTRIES is blank or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not itab_sales_orders[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT BSTDK&lt;/P&gt;&lt;P&gt;INTO VBKD-BSTDK&lt;/P&gt;&lt;P&gt;FROM VBKD&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN itab_sales_orders&lt;/P&gt;&lt;P&gt;WHERE BSTKD = v_pono and&lt;/P&gt;&lt;P&gt;VBELN = itab_sales_orders-SD_DOC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the more appropriate way while using FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here, the error is of header line data being not cleared.&lt;/P&gt;&lt;P&gt;Clear the header line &amp;amp; do check the internal table is blank or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2005 03:51:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090015#M100408</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-27T03:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: ITAB Delete Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090016#M100409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank All my problem is solved. Your points awarded.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2005 03:55:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-delete-problem/m-p/1090016#M100409</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-27T03:55:46Z</dc:date>
    </item>
  </channel>
</rss>

