<?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 Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem/m-p/2850914#M668046</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you seem to be asking a lot of fundamental questions. Perhaps you should start reading the documentation and having a go? Maybe even buy a book or two?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, here is a quick code sample. I have used the sample table SFLIGHT for this and am comparing the field CONNID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA a TYPE TABLE OF sflight.
DATA b TYPE TABLE OF sflight.
DATA c TYPE TABLE OF sflight.
DATA d TYPE REF TO sflight.
DATA e TYPE REF TO sflight.
DATA cnt TYPE i.

SELECT * FROM sflight INTO TABLE a.
SELECT * FROM sflight INTO TABLE b.

* 1.I have to copy the contents of A and B into C.
INSERT lines of a INTO TABLE c.
INSERT lines of b INTO TABLE c.

*2.I have to output the numbers which occur repeatedly in C and also I have to output that how many times each number is being repeated.
SORT c BY connid.
LOOP AT c REFERENCE INTO d.
  IF e IS NOT BOUND. e = d. ENDIF.
  IF d-&amp;gt;connid = e-&amp;gt;connid.
    ADD 1 TO cnt.
  ELSE.
    IF cnt &amp;gt; 1.
      WRITE: /, e-&amp;gt;connid, cnt.
    ENDIF.
    e = d.
    cnt = 1.
  ENDIF.
ENDLOOP.

*3.After obtaining the solution for second requirement I have to delete the numbers in Internal table C which are repeatedly occured.
DELETE ADJACENT DUPLICATES FROM c COMPARING connid.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Graham Robbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Oct 2007 01:08:15 GMT</pubDate>
    <dc:creator>GrahamRobbo</dc:creator>
    <dc:date>2007-10-08T01:08:15Z</dc:date>
    <item>
      <title>PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem/m-p/2850913#M668045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anybody solve the problem given below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 Internal tables A,B,C by name.Internal tables A and B contain some numbers all in a field.Among them C has no data in it.Here I have 3 requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.I have  to copy  the contents of A and B into C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.I have to output the numbers which occur repeatedly in C and also I have to output that how many times each number is being repeated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3.After obtaining the solution for second requirement I have to delete the numbers in Internal table C which are repeatedly occured.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will award max points to those who have solved it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Oct 2007 16:30:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem/m-p/2850913#M668045</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-07T16:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROBLEM</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem/m-p/2850914#M668046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you seem to be asking a lot of fundamental questions. Perhaps you should start reading the documentation and having a go? Maybe even buy a book or two?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, here is a quick code sample. I have used the sample table SFLIGHT for this and am comparing the field CONNID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA a TYPE TABLE OF sflight.
DATA b TYPE TABLE OF sflight.
DATA c TYPE TABLE OF sflight.
DATA d TYPE REF TO sflight.
DATA e TYPE REF TO sflight.
DATA cnt TYPE i.

SELECT * FROM sflight INTO TABLE a.
SELECT * FROM sflight INTO TABLE b.

* 1.I have to copy the contents of A and B into C.
INSERT lines of a INTO TABLE c.
INSERT lines of b INTO TABLE c.

*2.I have to output the numbers which occur repeatedly in C and also I have to output that how many times each number is being repeated.
SORT c BY connid.
LOOP AT c REFERENCE INTO d.
  IF e IS NOT BOUND. e = d. ENDIF.
  IF d-&amp;gt;connid = e-&amp;gt;connid.
    ADD 1 TO cnt.
  ELSE.
    IF cnt &amp;gt; 1.
      WRITE: /, e-&amp;gt;connid, cnt.
    ENDIF.
    e = d.
    cnt = 1.
  ENDIF.
ENDLOOP.

*3.After obtaining the solution for second requirement I have to delete the numbers in Internal table C which are repeatedly occured.
DELETE ADJACENT DUPLICATES FROM c COMPARING connid.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Graham Robbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2007 01:08:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem/m-p/2850914#M668046</guid>
      <dc:creator>GrahamRobbo</dc:creator>
      <dc:date>2007-10-08T01:08:15Z</dc:date>
    </item>
  </channel>
</rss>

