<?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: problem in deleting additional line items in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133941#M112479</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;apply the reverse scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.see the process is as u said sometimes even though the items in ITEM level are deleted which are shown in EKPO table with deletion field indicator as LOEKZ but the header table EKKO may not have the indicator on . this may be due to Functional setting.&lt;/P&gt;&lt;P&gt;2.In ur problem proceed like first use select on EKPO table and include fields POSNR , LOEKZ in one internal table say IT_TAB1.&lt;/P&gt;&lt;P&gt;this gives u the list of all po's with deletion field indicator vs PO numbers at item level.&lt;/P&gt;&lt;P&gt;3.For all entries in IT_TAB1 select the relavent PO'numbers from EKKO table which only gives u the PO numbers for the entries in EKPO table .&lt;/P&gt;&lt;P&gt;means to say that&lt;/P&gt;&lt;P&gt;Now u r left with only those entries on which no item is deleted okay so ur query is resolved here.&lt;/P&gt;&lt;P&gt;4. DIscard PO numbers from ur final internal table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Feb 2006 06:27:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-02-20T06:27:37Z</dc:date>
    <item>
      <title>problem in deleting additional line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133937#M112475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am currently modifying a report where in I must delete all P.O's that has one or all of their materials  deleted. So when I run my report it only deletes the PO's that have their first line items deleted but it doesnt delete/detect the PO's that have multiple line items/materials in them. For example, my report displays PO number 4550000034 and then I check it in t-code ME23 and it's first material/line is not deleted but additional materials/line items has been deleted(symbolized by a trash can) so it is displayed in my report. What I want to do is to check each and every material in a particular PO and if one of them  is deleted I must disregard that certain PO and not include it in my report. the field wherein the deleted indicator is ekpo-loekz/t_ekpo2-loekz. I have pasted below my code. Thanks guys and take care!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT it_hdr.&lt;/P&gt;&lt;P&gt;   AT NEW refbn.&lt;/P&gt;&lt;P&gt;     read table t_ekpo2 with key ebeln = it_hdr-refbn.&lt;/P&gt;&lt;P&gt;      if not t_ekpo2-loekz is initial.&lt;/P&gt;&lt;P&gt;        delete it_hdr where refbn = t_ekpo2-ebeln.&lt;/P&gt;&lt;P&gt;        continue.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      REFRESH: account, history.&lt;/P&gt;&lt;P&gt;      CLEAR:   account, history.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'BAPI_PO_GETDETAIL'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;                purchaseorder              = it_hdr-refbn&lt;/P&gt;&lt;P&gt;                account_assignment         = 'X'&lt;/P&gt;&lt;P&gt;                history                    = 'X'&lt;/P&gt;&lt;P&gt;           TABLES&lt;/P&gt;&lt;P&gt;                po_item_account_assignment = account&lt;/P&gt;&lt;P&gt;                po_item_history            = pohistory&lt;/P&gt;&lt;P&gt;                po_item_history_totals     = history.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT account.&lt;/P&gt;&lt;P&gt;        t_account       = account.&lt;/P&gt;&lt;P&gt;        t_account-ebeln = it_hdr-refbn.&lt;/P&gt;&lt;P&gt;        APPEND t_account. CLEAR t_account.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT pohistory.&lt;/P&gt;&lt;P&gt;        t_pohistory       = pohistory.&lt;/P&gt;&lt;P&gt;        t_pohistory-ebeln = it_hdr-refbn.&lt;/P&gt;&lt;P&gt;        APPEND t_pohistory. CLEAR t_pohistory.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LOOP AT history.&lt;/P&gt;&lt;P&gt;        t_history = history.&lt;/P&gt;&lt;P&gt;        t_history-ebeln = it_hdr-refbn.&lt;/P&gt;&lt;P&gt;        APPEND t_history. CLEAR t_history.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    it_dtl-psphi = it_hdr-psphi.&lt;/P&gt;&lt;P&gt;    it_dtl-name1 = it_hdr-name1.&lt;/P&gt;&lt;P&gt;    it_dtl-ebeln = it_hdr-refbn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    SELECT SINGLE waers FROM ekko INTO it_dtl-waers&lt;/P&gt;&lt;P&gt;          WHERE ebeln = it_hdr-refbn.&lt;/P&gt;&lt;P&gt;    APPEND it_dtl. CLEAR it_dtl.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2006 05:46:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133937#M112475</guid>
      <dc:creator>aris_hidalgo</dc:creator>
      <dc:date>2006-02-20T05:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: problem in deleting additional line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133938#M112476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do  this  add field ststus like ekpo-elikz into  internal table and delete it....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of int_tab occurs 0.   &lt;/P&gt;&lt;P&gt; STATUS    LIKE EKPO-ELIKZ,  &lt;/P&gt;&lt;P&gt;end of int_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE INT_TAB WHERE STATUS = 'X'&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2006 05:50:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133938#M112476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-20T05:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: problem in deleting additional line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133939#M112477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this...&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT t_ekpo2 BY ebeln loekz.
LOOP AT it_hdr.
*ON CHANGE OF refbn.
READ TABLE t_ekpo2 WITH KEY ebeln = it_hdr-refbn AND loekz is initial BINARY SEARCH.
delete it_hdr where refbn = t_ekpo2-ebeln.
*ENDON.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2006 05:53:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133939#M112477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-20T05:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: problem in deleting additional line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133940#M112478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi viraylab!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is refbn is your first field in the internla table. If not then try using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON CHANGE Of refbn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;becoz the At New will trigger whenever there is a change in the previous fields also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;kishore&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2006 05:56:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133940#M112478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-20T05:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: problem in deleting additional line items</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133941#M112479</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;apply the reverse scenario.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.see the process is as u said sometimes even though the items in ITEM level are deleted which are shown in EKPO table with deletion field indicator as LOEKZ but the header table EKKO may not have the indicator on . this may be due to Functional setting.&lt;/P&gt;&lt;P&gt;2.In ur problem proceed like first use select on EKPO table and include fields POSNR , LOEKZ in one internal table say IT_TAB1.&lt;/P&gt;&lt;P&gt;this gives u the list of all po's with deletion field indicator vs PO numbers at item level.&lt;/P&gt;&lt;P&gt;3.For all entries in IT_TAB1 select the relavent PO'numbers from EKKO table which only gives u the PO numbers for the entries in EKPO table .&lt;/P&gt;&lt;P&gt;means to say that&lt;/P&gt;&lt;P&gt;Now u r left with only those entries on which no item is deleted okay so ur query is resolved here.&lt;/P&gt;&lt;P&gt;4. DIscard PO numbers from ur final internal table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Feb 2006 06:27:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-deleting-additional-line-items/m-p/1133941#M112479</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-02-20T06:27:37Z</dc:date>
    </item>
  </channel>
</rss>

