<?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: Delete zero data material in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798526#M342987</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt; Do you have multiple entreis for the same material in the table  IT_HEADER  ,e.g for the material 1567 , do you have more than one record&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Dec 2006 10:38:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-18T10:38:34Z</dc:date>
    <item>
      <title>Delete zero data material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798525#M342986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;i need material have all zero's like this it as deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matrial No 1567&lt;/P&gt;&lt;P&gt;open Balance 0.00&lt;/P&gt;&lt;P&gt;Mat Doc    Mat Dat  Mvt    Doc No     Recipts    issues      balance&lt;/P&gt;&lt;P&gt;0.00           0.00                 0.00        0.00         0.00         0.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i am using below logic it had deleted the below material also,&lt;/P&gt;&lt;P&gt;below material, opening balance have some value,&lt;/P&gt;&lt;P&gt;But in this logic both were deleted &lt;/P&gt;&lt;P&gt;if below once like ( Mat doc ) all are zeros having opening balance also deleted,&lt;/P&gt;&lt;P&gt;i need  material having all zeros one deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matrial No 1567&lt;/P&gt;&lt;P&gt;open Balance   550.00&lt;/P&gt;&lt;P&gt;Mat Doc    Mat Dat  Mvt    Doc No     Recipts    issues      balance&lt;/P&gt;&lt;P&gt;0.00           0.00                 0.00        0.00         0.00         0.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;logic is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; LOOP AT INT_DATA WHERE  MENGE_O = 0 AND MENGE_RT = 0 AND&lt;/P&gt;&lt;P&gt;                       MENGE_CL = 0 AND MENGE_AD = 0 AND&lt;/P&gt;&lt;P&gt;                       MENGE_S = 0 AND MENGE_TO = 0 AND&lt;/P&gt;&lt;P&gt;                       MENGE_CR = 0 AND MENGE_R = 0 AND MENGE_BAL = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DELETE IT_HEADER WHERE MATNR = INT_DATA-MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;opening bal logic is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM GET_OPENING_STOCK.&lt;/P&gt;&lt;P&gt;  SELECT SUM( MZUBB ) SUM( MAGBB )  INTO (V_STOCK, V_STOCK1)&lt;/P&gt;&lt;P&gt;                FROM S031 WHERE MATNR = IT_HEADER-MATNR AND&lt;/P&gt;&lt;P&gt;                                WERKS = ITAB-WERKS AND&lt;/P&gt;&lt;P&gt;                                SPMON LT V_MONTH1 AND LGORT = ITAB-LGORT.&lt;/P&gt;&lt;P&gt;  OSTOCK = V_STOCK1 - V_STOCK.&lt;/P&gt;&lt;P&gt;  IF OSTOCK &amp;lt; 0.&lt;/P&gt;&lt;P&gt;    OSTOCK = OSTOCK * -1.&lt;/P&gt;&lt;P&gt;    MENGE_RE = OSTOCK.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDFORM.                               " GET_OPENING_STOCK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Sreedhar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 10:31:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798525#M342986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T10:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Delete zero data material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798526#M342987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , &lt;/P&gt;&lt;P&gt; Do you have multiple entreis for the same material in the table  IT_HEADER  ,e.g for the material 1567 , do you have more than one record&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 10:38:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798526#M342987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T10:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Delete zero data material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798527#M342988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;if it_header-matnr is not initial.&amp;lt;/b&amp;gt;  " this will pick only for a material having a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SUM( MZUBB ) SUM( MAGBB ) INTO (V_STOCK, V_STOCK1)
FROM S031 WHERE MATNR = IT_HEADER-MATNR AND
WERKS = ITAB-WERKS AND
SPMON LT V_MONTH1 AND LGORT = ITAB-LGORT.
OSTOCK = V_STOCK1 - V_STOCK.
IF OSTOCK &amp;lt; 0.
OSTOCK = OSTOCK * -1.
MENGE_RE = OSTOCK.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;endif.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT INT_DATA WHERE MENGE_O = 0 AND MENGE_RT = 0 AND&lt;/P&gt;&lt;P&gt;MENGE_CL = 0 AND MENGE_AD = 0 AND&lt;/P&gt;&lt;P&gt;MENGE_S = 0 AND MENGE_TO = 0 AND&lt;/P&gt;&lt;P&gt;MENGE_CR = 0 AND MENGE_R = 0 AND MENGE_BAL = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;here sy-subrc is so it_header is deleted .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;lt;b&amp;gt;in order to retain this &lt;/P&gt;&lt;P&gt;if open_stock/open balance eq 0. "bring in this logic so that *it_hheader is retained as it has some value&lt;/P&gt;&lt;P&gt;DELETE IT_HEADER WHERE MATNR = INT_DATA-MATNR.&lt;/P&gt;&lt;P&gt;endif.&amp;lt;/b&amp;gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check if this works,&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;regards,&lt;/P&gt;&lt;P&gt;vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vijay&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Vijay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 10:38:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798527#M342988</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T10:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Delete zero data material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798528#M342989</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;LOOP AT INT_DATA .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if  ((((((INT_DATA -MENGE_O is initial) AND (INT_DATA-MENGE_RT is initial)  AND&lt;/P&gt;&lt;P&gt;(INT_DATA-MENGE_CL is initial)  AND ( INT_DATA-MENGE_AD is initial) AND&lt;/P&gt;&lt;P&gt;( INT_DATA-MENGE_S is initial) AND ( INT_DATA-MENGE_TO is initial) AND&lt;/P&gt;&lt;P&gt;( INT_DATA-MENGE_CR is initial) AND ( INT_DATA-MENGE_R is initial)  AND ( INT_DATA-MENGE_BAL is initial ))))))).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE IT_HEADER WHERE MATNR = INT_DATA-MATNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Adjust the brackets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs&lt;/P&gt;&lt;P&gt;Manas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 10:40:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798528#M342989</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T10:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: Delete zero data material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798529#M342990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;delete from internal table where open balance = 0.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will delete only those records wherein open balance is 0.00&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 10:41:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798529#M342990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T10:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: Delete zero data material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798530#M342991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I dont think there is anything wrong with the code please check if you have more than one record for the particular material in IT_HEADER. I feel that is the case and hence the record is getting deleted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anurag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 10:45:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798530#M342991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T10:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Delete zero data material</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798531#M342992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or else try with this statement ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT INT_DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If INT_DATA-MENGE_O is initial AND &lt;/P&gt;&lt;P&gt;  INT_DATA-MENGE_RT is initial AND&lt;/P&gt;&lt;P&gt;  INT_DATA-MENGE_CL is initial and &lt;/P&gt;&lt;P&gt;  INT_DATA-MENGE_AD is initial AND&lt;/P&gt;&lt;P&gt;  INT_DATA-MENGE_S is initial AND &lt;/P&gt;&lt;P&gt;  INT_DATA-MENGE_TO is intial AND&lt;/P&gt;&lt;P&gt;  INT_DATA-MENGE_CR is initial AND&lt;/P&gt;&lt;P&gt;  INT_DATA-MENGE_R is initial AND &lt;/P&gt;&lt;P&gt;  INT_DATA-MENGE_BAL is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DELETE IT_HEADER.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Dec 2006 10:45:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-zero-data-material/m-p/1798531#M342992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-18T10:45:42Z</dc:date>
    </item>
  </channel>
</rss>

