<?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: Internal table value comparison in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070683#M1178058</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not working.  &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know some other way &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically   VBELN  PRODH  TOTAL LINES      are important  for total lines calculation&lt;/P&gt;&lt;P&gt;                 a            30             2&lt;/P&gt;&lt;P&gt;                 a            90             1&lt;/P&gt;&lt;P&gt;                 a            30              2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I compare the next row to the previous row in the internal table . Need some logic for that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Jan 2009 09:02:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-29T09:02:20Z</dc:date>
    <item>
      <title>Internal table value comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070681#M1178056</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 have selected values from  LIKPand LIPS by inner join and prepared one internal table ( which is suppose to be display in output also).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table output comes as below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VBELN&lt;/STRONG&gt;	POS   LFART  VKORG   WADAT_IST   WADAT  MATNR     VTWEG  &lt;STRONG&gt;PRODH&lt;/STRONG&gt;  Total Line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;80000093   10      ZLF       2000       0                  20080609  GO1525         10         30  &lt;/P&gt;&lt;P&gt;80000093   20      ZLF       2000       0                  20080609  GO1525CTA   10         30    &lt;/P&gt;&lt;P&gt;80000093   20      ZLF       2000       0                  20080609  GO1525          10         90&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now we need to calculate  Total line   that a delivery which has similar product( prodh) it needs to add it &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like in this case the output should be &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;VBELN&lt;/STRONG&gt;	POS   LFART  VKORG   WADAT_IST   WADAT  MATNR     VTWEG  &lt;STRONG&gt;PRODH&lt;/STRONG&gt;  Total Line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;80000093   10      ZLF       2000       0                  20080609  GO1525         10         30           2&lt;/P&gt;&lt;P&gt;80000093   20      ZLF       2000       0                  20080609  GO1525CTA   10         30           2&lt;/P&gt;&lt;P&gt;80000093   20      ZLF       2000       0                  20080609  GO1525          10         90          1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you suggest how to calcuate the  Total line value , how to do the comparison .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2009 07:41:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070681#M1178056</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-29T07:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table value comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070682#M1178057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Anindita,&lt;/P&gt;&lt;P&gt;Instead of using append use collect statement while loding output table.&lt;/P&gt;&lt;P&gt;hope it help you.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;LOkesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2009 07:51:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070682#M1178057</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-29T07:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table value comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070683#M1178058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not working.  &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know some other way &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically   VBELN  PRODH  TOTAL LINES      are important  for total lines calculation&lt;/P&gt;&lt;P&gt;                 a            30             2&lt;/P&gt;&lt;P&gt;                 a            90             1&lt;/P&gt;&lt;P&gt;                 a            30              2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I compare the next row to the previous row in the internal table . Need some logic for that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2009 09:02:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070683#M1178058</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-29T09:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table value comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070684#M1178059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anindita,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz change the structure of your internal table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VBELN PRODH POS LFART VKORG WADAT_IST WADAT MATNR VTWEG Total Line&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;80000093 30 10 ZLF 2000 0 20080609 GO1525 10  &lt;/P&gt;&lt;P&gt;80000093 30 20 ZLF 2000 0 20080609 GO1525CTA 10  &lt;/P&gt;&lt;P&gt;80000093 90 20 ZLF 2000 0 20080609 GO1525 10 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is possible then try the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT ITAB INTO WA.

V_CNT = V_CNT + 1.

AT END OF PRODH.
WA-TOTAL = V_CNT.
MODIFY ITAB FROM WA TRANSPORTING TOTAL 
WHERE VBELN  = WA-VBELN
AND       PRODH = WA-PRODH.
CLEAR V_CNT.
ENDAT.

ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2009 09:15:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070684#M1178059</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-01-29T09:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table value comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070685#M1178060</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;Sort the table by product.&lt;/P&gt;&lt;P&gt;Now rows having same product no will be adjacent to each other.&lt;/P&gt;&lt;P&gt;Now use AT...ENDAT stmt and SUM. Store these values .&lt;/P&gt;&lt;P&gt;Now you can use these values n update that many rows with that val.&lt;/P&gt;&lt;P&gt;For eg:&lt;/P&gt;&lt;P&gt;after sorting your data &lt;/P&gt;&lt;P&gt;prod&lt;/P&gt;&lt;P&gt;30&lt;/P&gt;&lt;P&gt;30&lt;/P&gt;&lt;P&gt;90&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum[] = 2 1.&lt;/P&gt;&lt;P&gt;so for first two rows set total line as 2. Do this using a temp var n decrementing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jayanthi.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2009 09:26:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070685#M1178060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-29T09:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table value comparison</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070686#M1178061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Jan 2009 10:14:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-value-comparison/m-p/5070686#M1178061</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-29T10:14:28Z</dc:date>
    </item>
  </channel>
</rss>

