<?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: move-corresponding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469449#M220806</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at student.&lt;/P&gt;&lt;P&gt;move-corresponding student to student_details.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;append student_details.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;clear student.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you already populated STUDENT_DETAILS before the above LOOP and again in this LOOP AT STUDENT, you are adding all the records of STUDENT TO STUDENT_DETAILS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thats why 2+ 2 records are appearing for STUDENT_DETAILS .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;sriaknth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Aug 2006 09:16:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-08-30T09:16:58Z</dc:date>
    <item>
      <title>move-corresponding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469447#M220804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have a small pgm where there are two int tables. i give some data in first int tab and some other fields in the other tab. the field 'name' is same in both the itabs. so i am using the 'move-corresponding' option. but in the o/p, total records are shown as four whereas actually there should be only two. pls check and advise.&lt;/P&gt;&lt;P&gt;i give the pgm here:&lt;/P&gt;&lt;P&gt;REPORT  ZDEMO3                                  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of student occurs 0,&lt;/P&gt;&lt;P&gt;      name(20)  type c,&lt;/P&gt;&lt;P&gt;      rollno type i,&lt;/P&gt;&lt;P&gt;      percentage type p decimals 2,&lt;/P&gt;&lt;P&gt;    end of student.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of student_details occurs 0,&lt;/P&gt;&lt;P&gt;       name(20) type c,&lt;/P&gt;&lt;P&gt;       fathers_name(20) type c,&lt;/P&gt;&lt;P&gt;       address(45) type c,&lt;/P&gt;&lt;P&gt;       Phone_no type i,&lt;/P&gt;&lt;P&gt;       end of student_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;student-name = 'Bhargav.M.D.'.&lt;/P&gt;&lt;P&gt;student-rollno = 10076036.&lt;/P&gt;&lt;P&gt;student-percentage = 80.&lt;/P&gt;&lt;P&gt;append student.&lt;/P&gt;&lt;P&gt;clear student.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;student-name = 'Nishchal.T.K'.&lt;/P&gt;&lt;P&gt;student-rollno = 45782169.&lt;/P&gt;&lt;P&gt;student-percentage = 60.&lt;/P&gt;&lt;P&gt;append student.&lt;/P&gt;&lt;P&gt;clear student.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;student_details-fathers_name = 'S/O Dayanda.M.D'.&lt;/P&gt;&lt;P&gt;student_details-address = 'Behind Mallige Thota, Magadi Road,Bangalore'.&lt;/P&gt;&lt;P&gt;student_details-phone_no = 23105901.&lt;/P&gt;&lt;P&gt;append student_details.&lt;/P&gt;&lt;P&gt;clear student_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;student_details-fathers_name = 'S/O Kirsna Murty.T.K'.&lt;/P&gt;&lt;P&gt;student_details-address = 'K.R.Extension, Tiptur'.&lt;/P&gt;&lt;P&gt;student_details-phone_no = 252865.&lt;/P&gt;&lt;P&gt;append student_details.&lt;/P&gt;&lt;P&gt;clear student_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at student.&lt;/P&gt;&lt;P&gt;  move-corresponding student to student_details.&lt;/P&gt;&lt;P&gt;  append student_details.&lt;/P&gt;&lt;P&gt;  clear student.&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;loop at student.&lt;/P&gt;&lt;P&gt;write: / student-name, student-rollno, student-percentage.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;skip 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at student_details.&lt;/P&gt;&lt;P&gt;write : / student_details-name,   student_details-fathers_name,&lt;/P&gt;&lt;P&gt;         student_details-address, student_details-phone_no.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:11:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469447#M220804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: move-corresponding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469448#M220805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;lt;b&amp;gt;sort student.&lt;/P&gt;&lt;P&gt;loop at student_details.&lt;/P&gt;&lt;P&gt;read table student with key name = student-name&lt;/P&gt;&lt;P&gt; binary search.&lt;/P&gt;&lt;P&gt; student_details-name = student-name.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;modify&amp;lt;/b&amp;gt; student_details.&lt;/P&gt;&lt;P&gt;endloop.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:14:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469448#M220805</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: move-corresponding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469449#M220806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at student.&lt;/P&gt;&lt;P&gt;move-corresponding student to student_details.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;append student_details.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;clear student.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as you already populated STUDENT_DETAILS before the above LOOP and again in this LOOP AT STUDENT, you are adding all the records of STUDENT TO STUDENT_DETAILS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thats why 2+ 2 records are appearing for STUDENT_DETAILS .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;sriaknth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:16:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469449#M220806</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: move-corresponding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469450#M220807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem in the code is that you are appending the data into student_details rather than modifying it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at student.&lt;/P&gt;&lt;P&gt;read table student_details with key name = student-name.&lt;/P&gt;&lt;P&gt;ltabix = sy-tabix.&lt;/P&gt;&lt;P&gt;move-corresponding student to student_details.&lt;/P&gt;&lt;P&gt;*append student_details.&lt;/P&gt;&lt;P&gt;MODIFY student_details index ltabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear student.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:17:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469450#M220807</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:17:39Z</dc:date>
    </item>
    <item>
      <title>Re: move-corresponding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469451#M220808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;replace APPEND with MODIFY in your second loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:18:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469451#M220808</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-08-30T09:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: move-corresponding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469452#M220809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is the modified code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ZDEMO3 .

data: begin of student occurs 0,
name(20) type c,
rollno type i,
percentage type p decimals 2,
end of student.

data : begin of student_details occurs 0,
name(20) type c,
fathers_name(20) type c,
address(45) type c,
Phone_no type i,
end of student_details.

student-name = 'Bhargav.M.D.'.
student-rollno = 10076036.
student-percentage = 80.
append student.
clear student.

student-name = 'Nishchal.T.K'.
student-rollno = 45782169.
student-percentage = 60.
append student.
clear student.

&amp;lt;b&amp;gt;*--these 2 below append STUDENT_DETAILS are not needed as we  are appending in the below LOOP at STUDENT.&amp;lt;/b&amp;gt;*student_details-fathers_name = 'S/O Dayanda.M.D'.
*student_details-address = 'Behind Mallige Thota, Magadi *Road,Bangalore'.
*student_details-phone_no = 23105901.
*append student_details.
*clear student_details.

*student_details-fathers_name = 'S/O Kirsna Murty.T.K'.
*student_details-address = 'K.R.Extension, Tiptur'.
*student_details-phone_no = 252865.
*append student_details.
*clear student_details.

&amp;lt;b&amp;gt;loop at student.
move-corresponding student to student_details.
  if sy-tabix = 1.
student_details-fathers_name = 'S/O Dayanda.M.D'.
student_details-address = 'Behind Mallige Thota, Magadi Road,Bangalore'.
student_details-phone_no = 23105901.
   elseif sy-tabix = 2.
student_details-fathers_name = 'S/O Kirsna Murty.T.K'.
student_details-address = 'K.R.Extension, Tiptur'.
student_details-phone_no = 252865.
  endif.
append student_details.
endloop.&amp;lt;/b&amp;gt;
loop at student.
write: / student-name, student-rollno, student-percentage.
endloop.

skip 2.

loop at student_details.
write : / student_details-name, student_details-fathers_name,
student_details-address, student_details-phone_no.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:20:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469452#M220809</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: move-corresponding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469453#M220810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ...U have to read the second internal table based on some key from first internal table and then use move-corresponding..currently ur appending 4 records..to understand clearly debug ur code..&lt;/P&gt;&lt;P&gt;Move-corresponding only moves the value to corresponding field of internal table it will consider new entry and append that many rows..so u have read or loop itab based on some condition..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:21:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469453#M220810</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: move-corresponding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469454#M220811</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;1. Already you have 2 records in each internal table Student and Student_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in table student have below 2 name records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. student-name = 'Bhargav.M.D.'.&lt;/P&gt;&lt;P&gt;2. student-name = 'Nishchal.T.K'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the student_details table have below 2 records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. student_details-fathers_name = 'S/O Dayanda.M.D'.&lt;/P&gt;&lt;P&gt;2. student_details-fathers_name = 'S/O Kirsna Murty.T.K'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Then after you append again 2 records into internal table student_details, becuase in the o/p it shows 4 records from internal table student_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now student_details having 4 records,Becuase you are appending the records from student table to student_detaisl table.(Append means add the records to internal table)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpfull.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Subbarao&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:25:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469454#M220811</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: move-corresponding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469455#M220812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Satish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, you have populated with another two records, and therefore you would have four records instead of two. However, I would suggest you to define a primary key in both internal tables (structure), please see below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of student occurs 0,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;id(3) type c,&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;name(20) type c,&lt;/P&gt;&lt;P&gt;rollno type i,&lt;/P&gt;&lt;P&gt;percentage type p decimals 2,&lt;/P&gt;&lt;P&gt;end of student.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data : begin of student_details occurs 0,&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;id(3) type c,&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;name(20) type c,&lt;/P&gt;&lt;P&gt;fathers_name(20) type c,&lt;/P&gt;&lt;P&gt;address(45) type c,&lt;/P&gt;&lt;P&gt;Phone_no type i,&lt;/P&gt;&lt;P&gt;end of student_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;student-id = '001'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;student-name = 'Bhargav.M.D.'.&lt;/P&gt;&lt;P&gt;student-rollno = 10076036.&lt;/P&gt;&lt;P&gt;student-percentage = 80.&lt;/P&gt;&lt;P&gt;append student.&lt;/P&gt;&lt;P&gt;clear student.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;student-id = '002'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;student-name = 'Nishchal.T.K'.&lt;/P&gt;&lt;P&gt;student-rollno = 45782169.&lt;/P&gt;&lt;P&gt;student-percentage = 60.&lt;/P&gt;&lt;P&gt;append student.&lt;/P&gt;&lt;P&gt;clear student.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;student_details-id = '001'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;student_details-fathers_name = 'S/O Dayanda.M.D'.&lt;/P&gt;&lt;P&gt;student_details-address = 'Behind Mallige Thota, Magadi Road,Bangalore'.&lt;/P&gt;&lt;P&gt;student_details-phone_no = 23105901.&lt;/P&gt;&lt;P&gt;append student_details.&lt;/P&gt;&lt;P&gt;clear student_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;student_details-id = '002'.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;student_details-fathers_name = 'S/O Kirsna Murty.T.K'.&lt;/P&gt;&lt;P&gt;student_details-address = 'K.R.Extension, Tiptur'.&lt;/P&gt;&lt;P&gt;student_details-phone_no = 252865.&lt;/P&gt;&lt;P&gt;append student_details.&lt;/P&gt;&lt;P&gt;clear student_details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;sort student by name.&lt;/P&gt;&lt;P&gt;loop at student_details.&lt;/P&gt;&lt;P&gt;read table student&lt;/P&gt;&lt;P&gt;            with key id = student_details-id&lt;/P&gt;&lt;P&gt;                 binary search.&lt;/P&gt;&lt;P&gt;move-corresponding student to student_details.&lt;/P&gt;&lt;P&gt;modify student_details index sy-tabix.&lt;/P&gt;&lt;P&gt;clear student.&lt;/P&gt;&lt;P&gt;endloop.&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 student.&lt;/P&gt;&lt;P&gt;write: / student-name, student-rollno, student-percentage.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;skip 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at student_details.&lt;/P&gt;&lt;P&gt;write : / student_details-name, student_details-fathers_name,&lt;/P&gt;&lt;P&gt;student_details-address, student_details-phone_no.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope the above helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Aug 2006 09:42:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/move-corresponding/m-p/1469455#M220812</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-08-30T09:42:51Z</dc:date>
    </item>
  </channel>
</rss>

