<?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: How to do Loop on table? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840515#M665222</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rayden, Check the code given below......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab like table of Ztable with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ztable into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;write:/ ITAB.&lt;/P&gt;&lt;P&gt;if itab-id is initial.&lt;/P&gt;&lt;P&gt;write: 'ID is INITIAL'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if itab-name is initial.&lt;/P&gt;&lt;P&gt;write: 'Name is INITIAL'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if itab-contact is initial.&lt;/P&gt;&lt;P&gt;write: 'Contact is INITIAL'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful, get back in case of query...&lt;/P&gt;&lt;P&gt;Cheers!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Sep 2007 06:41:55 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-28T06:41:55Z</dc:date>
    <item>
      <title>How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840503#M665210</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 a database Table that have 3 column : ID, Name, Contact No. with a total of 50 record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem 1: Loop through all data in each column.&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;I need to do a loop on all data in ID column to check for null value. After ID column, will move to check Name column's data and lastly Contact No column' s data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem 2: Loop through all data in only particular column.&lt;/P&gt;&lt;P&gt;Eg. Only want to check for ID column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to get the column name and do the loop on that particular column?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rayden&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:12:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840503#M665210</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840504#M665211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Move the database table entries to an internal table with the columns that you want and make the search..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:15:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840504#M665211</guid>
      <dc:creator>abdulazeez12</dc:creator>
      <dc:date>2007-09-28T06:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840505#M665212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Rayden,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you want to achieve by these looping?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:15:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840505#M665212</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2007-09-28T06:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840506#M665213</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 write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at  itab into wa where ID &amp;lt;&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;in this loop it will check for ID field only.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:18:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840506#M665213</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840507#M665214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shakir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do i move the column that is needed to itab?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rayden&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:18:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840507#M665214</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840508#M665215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to do a simple validation on the table, by using ABAP code. Eg. To validate mandatory for certain column or all column. Any idea how to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rayden&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:20:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840508#M665215</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840509#M665216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rayden-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare an internal table with the field of your database table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data: begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;         ID type Database tabel-ID,&lt;/P&gt;&lt;P&gt;         end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select ID  from DBtable into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then do the processing..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab where ID = &amp;lt;condition&amp;gt;.&lt;/P&gt;&lt;P&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;Hope this will help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:21:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840509#M665216</guid>
      <dc:creator>abdulazeez12</dc:creator>
      <dc:date>2007-09-28T06:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840510#M665217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rayden,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its very simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get the records those you want into an internal table using &amp;lt;b&amp;gt;SELECT&amp;lt;/b&amp;gt; statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now your internal table is having 3 fields with ID, Name and Contact.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to find only records in which ID is null... U can use loop as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab where ID is initial.


endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And one more thing is you can't loop through at only one field. If you are looping means entaire record will be processed... Ofcourse there are some cases with Control break statements like... AT NEW, AT END OF, etc,.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward If Helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Sasidhar Reddy Matli.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:21:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840510#M665217</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840511#M665218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sonali,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if i have 3 column to loop i have to code 3 loop statement? How to do it in a more dynamic way. Eg. User select Name. The Loop statement will able to loop the Name column, or ID for ID column. By using 1 loop statement. How to achieve that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rayden&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:23:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840511#M665218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840512#M665219</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;decalre a internal table of type ur database table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and write a select query like what ever fileds you want from that data base , if you want all then select * &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and store that values in that internal table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and loop at that internal table into workarea of that table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;ex&amp;lt;/b&amp;gt; LOOP AT IT_SOBID INTO WA_SOBID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then it will capture total line values &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ID name AND etc..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you cn chek that very esyly &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;reward if usefull&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:24:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840512#M665219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840513#M665220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Naresh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If i were to do a loop on all data for 3 column. Let say there is certains field is blank. So i want to get the row number and column name for the error field how to do that? Any code sample for reference?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rayden&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:28:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840513#M665220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840514#M665221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try like this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first write &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:  begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;          id type ..........&lt;/P&gt;&lt;P&gt;          name type ..............&lt;/P&gt;&lt;P&gt;          contact number ...........&lt;/P&gt;&lt;P&gt;         end of itab.&lt;/P&gt;&lt;P&gt;select-options: s_id  ........................&lt;/P&gt;&lt;P&gt;select id&lt;/P&gt;&lt;P&gt;         name&lt;/P&gt;&lt;P&gt;         contact  from [u r ztable]&lt;/P&gt;&lt;P&gt; in to table itab&lt;/P&gt;&lt;P&gt;where id = s_id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do the sorting criteria ............&lt;/P&gt;&lt;P&gt;sort itab by id.&lt;/P&gt;&lt;P&gt;delete adjacent duplicate records..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then write &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if itab[] is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then write loop........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab..&lt;/P&gt;&lt;P&gt;if itab-id = ' '  and name = ' ' and contact = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do processing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u want to check the id name contact indvidually&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write if id = ' '&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move it into work area&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if name = ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i hope this would be helpful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward points if helpful...............&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:37:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840514#M665221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to do Loop on table?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840515#M665222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rayden, Check the code given below......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab like table of Ztable with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from ztable into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;write:/ ITAB.&lt;/P&gt;&lt;P&gt;if itab-id is initial.&lt;/P&gt;&lt;P&gt;write: 'ID is INITIAL'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if itab-name is initial.&lt;/P&gt;&lt;P&gt;write: 'Name is INITIAL'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if itab-contact is initial.&lt;/P&gt;&lt;P&gt;write: 'Contact is INITIAL'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful, get back in case of query...&lt;/P&gt;&lt;P&gt;Cheers!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 06:41:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-do-loop-on-table/m-p/2840515#M665222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T06:41:55Z</dc:date>
    </item>
  </channel>
</rss>

