<?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: replace duplicate values with ZERO in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944312#M1153116</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out my solution here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6685891"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Dec 2008 06:24:18 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-12-19T06:24:18Z</dc:date>
    <item>
      <title>replace duplicate values with ZERO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944311#M1153115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my Purchase Register i have the following output coming:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*mat type	plant	po no		po date		vend code	vendor				mat descr	mat qty	inv no		inv value*
NLAG		JW01	4800002660	14.07.2008	400904		PROMISE STATIONERY STORES	BALL PEN BLACK	50	6080701038	1071
NLAG		JW01	4800002660	14.07.2008	400904		PROMISE STATIONERY STORES	BALL PEN BLACK	3	6080701038	1071
NLAG		JW01	4800002660	14.07.2008	400904		PROMISE STATIONERY STORES	BALL PEN BLACK	1	6080701038	1071
NLAG		JW01	4800002660	14.07.2008	400904		PROMISE STATIONERY STORES	BALL PEN BLACK	20	6080701038	1071
NLAG		JW01	4800002660	14.07.2008	400904		PROMISE STATIONERY STORES	BALL PEN BLACK	1	6080701038	1071
NLAG		JW01	4800002660	14.07.2008	400904		PROMISE STATIONERY STORES	BALL PEN BLACK	6	6080701038	1071
NLAG		JW01	4800002660	14.07.2008	400904		PROMISE STATIONERY STORES	BALL PEN BLACK	6	6080701038	1071
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can see the invoice value is repeating. i want to update the value Zero for every repeated value for that invoice no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know how to achieve the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 06:21:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944311#M1153115</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T06:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: replace duplicate values with ZERO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944312#M1153116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check out my solution here:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="6685891"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 06:24:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944312#M1153116</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T06:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: replace duplicate values with ZERO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944313#M1153117</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;YOu can use control-break commands for that&lt;/P&gt;&lt;P&gt;eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at &amp;lt;internal_tab&amp;gt;&lt;/P&gt;&lt;P&gt;   at new &amp;lt;invoice&amp;gt;&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;   endat.&lt;/P&gt;&lt;P&gt;   &amp;lt;internal_tab&amp;gt;-value = 0&lt;/P&gt;&lt;P&gt;   modify &amp;lt;internal_tab&amp;gt;.&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;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Rajat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 06:24:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944313#M1153117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T06:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: replace duplicate values with ZERO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944314#M1153118</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;Try like this:&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF LINE,&lt;/P&gt;&lt;P&gt;mattype(7) TYPE C,&lt;/P&gt;&lt;P&gt;PLANT(5) TYPE C,&lt;/P&gt;&lt;P&gt;PONO(10) TYPE C,&lt;/P&gt;&lt;P&gt;VENDCODE(6) TYPE N,&lt;/P&gt;&lt;P&gt;VENDOR(25) TYPE C,&lt;/P&gt;&lt;P&gt;MAT_DESC(14) TYPE C,&lt;/P&gt;&lt;P&gt;QTY(3) TYPE N,&lt;/P&gt;&lt;P&gt;INVOICENO(10) TYPE N,&lt;/P&gt;&lt;P&gt;INVVALUE(4) TYPE N,&lt;/P&gt;&lt;P&gt;END OF LINE.&lt;/P&gt;&lt;P&gt;DATA ITAB LIKE STANDARD TABLE OF LINE.&lt;/P&gt;&lt;P&gt;*WITH NON-UNIQUE KEY COL2.&lt;/P&gt;&lt;P&gt;LINE-mattype = 'NLAG'. LINE-PLANT = 'JW01'. LINE-PONO = '4800002660'. LINE-VENDCODE = 400904. LINE-VENDOR = 'PROMISE STATIONERY STORES'. LINE-MAT_DESC = 'BALL PEN BLACK'. line-QTY = 50. LINE-INVOICENO = 6080701038. LINE-INVVALUE = 1071&lt;/P&gt;&lt;P&gt;. APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-mattype = 'NLAG'. LINE-PLANT = 'JW01'. LINE-PONO = '4800002660'. LINE-VENDCODE = 400904. LINE-VENDOR = 'PROMISE STATIONERY STORES'. LINE-MAT_DESC = 'BALL PEN BLACK'. line-QTY = 3. LINE-INVOICENO = 6080701038. LINE-INVVALUE = 1071&lt;/P&gt;&lt;P&gt;. APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-mattype = 'NLAG'. LINE-PLANT = 'JW01'. LINE-PONO = '4800002660'. LINE-VENDCODE = 400904. LINE-VENDOR = 'PROMISE STATIONERY STORES'. LINE-MAT_DESC = 'BALL PEN BLACK'. line-QTY = 1. LINE-INVOICENO = 6080701038. LINE-INVVALUE = 1071&lt;/P&gt;&lt;P&gt;. APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-mattype = 'NLAG'. LINE-PLANT = 'JW01'. LINE-PONO = '4800002660'. LINE-VENDCODE = 400904. LINE-VENDOR = 'PROMISE STATIONERY STORES'. LINE-MAT_DESC = 'BALL PEN BLACK'. line-QTY = 20. LINE-INVOICENO = 6080701038. LINE-INVVALUE = 1071&lt;/P&gt;&lt;P&gt;. APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-mattype = 'NLAG'. LINE-PLANT = 'JW01'. LINE-PONO = '4800002660'. LINE-VENDCODE = 400904. LINE-VENDOR = 'PROMISE STATIONERY STORES'. LINE-MAT_DESC = 'BALL PEN BLACK'. line-QTY = 1. LINE-INVOICENO = 6080701038. LINE-INVVALUE = 1071&lt;/P&gt;&lt;P&gt;. APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-mattype = 'NLAG'. LINE-PLANT = 'JW01'. LINE-PONO = '4800002660'. LINE-VENDCODE = 400904. LINE-VENDOR = 'PROMISE STATIONERY STORES'. LINE-MAT_DESC = 'BALL PEN BLACK'. line-QTY = 6. LINE-INVOICENO = 6080701038. LINE-INVVALUE = 1071&lt;/P&gt;&lt;P&gt;. APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;LINE-mattype = 'NLAG'. LINE-PLANT = 'JW01'. LINE-PONO = '4800002660'. LINE-VENDCODE = 400904. LINE-VENDOR = 'PROMISE STATIONERY STORES'. LINE-MAT_DESC = 'BALL PEN BLACK'. line-QTY = 6. LINE-INVOICENO = 6080701038. LINE-INVVALUE = 1071&lt;/P&gt;&lt;P&gt;. APPEND LINE TO ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM LIST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM LIST.&lt;/P&gt;&lt;P&gt;data: cl like line-invoiceno.&lt;/P&gt;&lt;P&gt;write : / 'mattype', 9 'plant', 15 'po no', 26 'vendco', 33 'vendor', 59 'mat desc', 74 'qty', 78 'invoiceno', 89 'value'.&lt;/P&gt;&lt;P&gt;uline at /1(95).&lt;/P&gt;&lt;P&gt;sort itab by MATTYPE INVOICENO.&lt;/P&gt;&lt;P&gt;LOOP AT ITAB INTO LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if  cl &amp;lt;&amp;gt; LINE-INVOICENO.&lt;/P&gt;&lt;P&gt;    write : / line-MATTYPE, line-PLANT, line-PONO, line-VENDCODE, line-VENDOR, line-mat_desc, line-qty, line-INVOICENO, LINE-INVVALUE.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;    line-invvalue = 0.&lt;/P&gt;&lt;P&gt;    write : / line-MATTYPE, line-PLANT, line-PONO, line-VENDCODE, line-VENDOR, line-mat_desc, line-qty, line-INVOICENO, LINE-INVVALUE.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;cl = line-INVOICENO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhaskar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 07:51:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944314#M1153118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T07:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: replace duplicate values with ZERO</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944315#M1153119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For your requirement you can try the following logic.&lt;/P&gt;&lt;P&gt;Here the  tables it_tab,it_tab1 have similar structure with two fields namely f1,f2 where f2 is similar to invoice in your table which has duplicate entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT it_tab INTO wa_tab.
  w_hold = wa_tab-f2. "Copy to another variable
  wa_tab-f2 = 0. "Make the field zero
  AT NEW f2.
    wa_tab-f2 = w_hold. "For first entry re assign the value
  ENDAT.
  APPEND wa_tab TO it_tab1. "Append the row to another target table
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;f1             f2
1.111       1.234
1.111       1.234
1.111       1.234
2.222       4.567
2.222       4.567&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Target table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;f1             f2
1.111       1.234
1.111           0
1.111           0
2.222       4.567
2.222           0&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Manoj Kumar P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Dec 2008 08:09:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replace-duplicate-values-with-zero/m-p/4944315#M1153119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-19T08:09:42Z</dc:date>
    </item>
  </channel>
</rss>

