<?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: Field Count in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699768#M625171</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is a crude requirement. you have to follow this path:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: loc_count1 type p, loc_count2 type p, loc_count3  type p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at int_data.&lt;/P&gt;&lt;P&gt;if field1 ne space.&lt;/P&gt;&lt;P&gt;loc_count1 =  loc_count1 + 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if field2 ne space.&lt;/P&gt;&lt;P&gt;loc_count2 =  loc_count2 + 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if field3 ne space.&lt;/P&gt;&lt;P&gt;loc_count3 =  loc_count3 + 1.&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;Hope this will solve ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Krish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2007 11:34:19 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-16T11:34:19Z</dc:date>
    <item>
      <title>Field Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699766#M625169</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 want to know the fields that are filled in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For exanple I have an internal table which contains 10 fields with field name FIELD1,FIELD2,...ETC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose there are 100 records in the table.Now I want to know how many records have field1 value.Same for other records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;SP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:30:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699766#M625169</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: Field Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699767#M625170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
data lv_count     type i value 0.

loop at itab into wa.
  if not wa-field1 is initial.
    lv_count = lv_count + 1.
  endif.
endloop.

write: 'Number of records with a value in Field1: ', lv_count.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:34:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699767#M625170</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Field Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699768#M625171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this is a crude requirement. you have to follow this path:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: loc_count1 type p, loc_count2 type p, loc_count3  type p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at int_data.&lt;/P&gt;&lt;P&gt;if field1 ne space.&lt;/P&gt;&lt;P&gt;loc_count1 =  loc_count1 + 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if field2 ne space.&lt;/P&gt;&lt;P&gt;loc_count2 =  loc_count2 + 1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;if field3 ne space.&lt;/P&gt;&lt;P&gt;loc_count3 =  loc_count3 + 1.&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;Hope this will solve ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Krish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:34:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699768#M625171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Field Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699769#M625172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT itab-field IS INITIAL.&lt;/P&gt;&lt;P&gt;v_counter = v_counter + 1.&lt;/P&gt;&lt;P&gt;ENDIF.&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;You need one counter for any field you want to check.&lt;/P&gt;&lt;P&gt;I think there is not any sentence in SAP for do it authomatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:36:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699769#M625172</guid>
      <dc:creator>former_member582701</dc:creator>
      <dc:date>2007-08-16T11:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Field Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699770#M625173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;data: lv_count type i value 0.

loop at itab where field1 &amp;lt;&amp;gt; ''.
 lv_count = lv_count + 1.
endloop.

write:/ lv_count , 'non blank values'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:36:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699770#M625173</guid>
      <dc:creator>former_member189059</dc:creator>
      <dc:date>2007-08-16T11:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Field Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699771#M625174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sandeep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can loop at the itab with condtion where field1 &amp;lt;&amp;gt; '  '.&lt;/P&gt;&lt;P&gt;Create a counter initialized with value 0, and within the loop incrase the count value by 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so therefore for every hit, it will increase the count value by 1..atlast u ll have the no.of records which have the value for field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code follows,&lt;/P&gt;&lt;P&gt;data: count type i value 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab where field1 &amp;lt;&amp;gt; ' '.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count = count + 1.&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;Write:  Count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:37:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699771#M625174</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Field Count</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699772#M625175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hin sandeep, seeing some of the other solution i´d still advice you to check against initial state and not against space or ' ', since e.G. the initial value of a type p field is 0,00, which again is not equal to space, but still it´s not a filled value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 11:41:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/field-count/m-p/2699772#M625175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T11:41:36Z</dc:date>
    </item>
  </channel>
</rss>

