<?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: Delete Empty ALV static fieldcatlog in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775395#M1463759</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;Read table itab with key field1 = space &lt;/P&gt;&lt;P&gt;                             transporting no fields.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;  fldcat-fieldname = 'FIELD1'&lt;/P&gt;&lt;P&gt;  append fldcat&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table itab with key field2 = space &lt;/P&gt;&lt;P&gt;                             transporting no fields.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;  fldcat-fieldname = 'FIELD2'&lt;/P&gt;&lt;P&gt;  append fldcat.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Apr 2010 08:29:21 GMT</pubDate>
    <dc:creator>former_member418469</dc:creator>
    <dc:date>2010-04-21T08:29:21Z</dc:date>
    <item>
      <title>Delete Empty ALV static fieldcatlog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775392#M1463756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;I am displaying data using Statis ALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my output, i have 20 columns in that i dont want to display empty field column (dont know which column comes empty for senerio).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the whole column is empty then i need to delete that column from fieldcatlog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please help me if any one faced the same issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;SK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 07:34:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775392#M1463756</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-21T07:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Empty ALV static fieldcatlog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775393#M1463757</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check the final internal table values before populating the Field catalog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the internal table column doesn't contain values then pass&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;wa_fieldcat-no_out = 'X'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinod&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Vinod Kumar on Apr 21, 2010 1:27 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 07:51:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775393#M1463757</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-21T07:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Empty ALV static fieldcatlog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775394#M1463758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Well there would be a logical approach to it :-&lt;/P&gt;&lt;P&gt;1. Do a read on your internal table checking one by one which field contains all empty values (or shud say no values).&lt;/P&gt;&lt;P&gt;EG:- Table1-f1,f2,f3,f4,f5. &lt;/P&gt;&lt;P&gt;Out of this in the 1st instance the fields F4 and F5 dont contain any values, u can arrive at this concl by doin the following.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
**- check the number of lines in internal table
DESCRIBE TABLE &amp;lt;table1&amp;gt; LINES &amp;lt;li_line&amp;gt;. 

** check field by field which field contains empty entries
READ TABLE &amp;lt;table1&amp;gt; INTO &amp;lt;wa_1&amp;gt; WITH KEY F1 = SPACE.
&amp;lt;li_index&amp;gt; = SY-INDEX. "-- sy-index will contain the total number of entries found with matching criteria"
IF &amp;lt;li_index&amp;gt; = &amp;lt;li_line&amp;gt; . " this clause is a check to see if all the lines for column F1 are empty
APPEND 'F1' TO &amp;lt;table_exclude&amp;gt;. 
ENDIF.

READ TABLE &amp;lt;table1&amp;gt; INTO &amp;lt;wa_1&amp;gt; WITH KEY F2 = SPACE.
&amp;lt;li_index&amp;gt; = SY-INDEX. "-- sy-index will contain the total number of entries found with matching criteria"
IF &amp;lt;li_index&amp;gt; = &amp;lt;li_line&amp;gt; . " this clause is a check to see if all the lines for column F1 are empty
APPEND 'F2' TO &amp;lt;table_exclude&amp;gt;. 
ENDIF.
................................. (do this for all the fields)
** at the end of checking all the fields and appending the correponding field-names in table &amp;lt;TABLE_EXCL&amp;gt;.
PERFORM BUILD_CATALOG USING : 'F1' 'FIELD1' '40' 'L',
                                                            'F2' 'FIELD2' '40' 'L',
                                                            'F3 'FIELD3' '40' 'L',
                                                            'F4' 'FIELD4' '40' 'L',
                                                            'F5' 'FIELD5' '40' 'L'.

FORM BUILD_CATALOG USING PC_FNAME PC_FDESC PC_FLEN PC_FTYPE.

READ TABLE &amp;lt;table_excl&amp;gt; INTO &amp;lt;wa_excl&amp;gt; WITH KEY FIELD = PC_FNAME.
IF SY-SUBRC &amp;lt;&amp;gt; 0.
APPEND FIELDCATALOG.
ENDIF.

ENDFORM.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this gives u an idea and helps..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-- Dedeepya C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 08:13:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775394#M1463758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-04-21T08:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Empty ALV static fieldcatlog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775395#M1463759</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;Read table itab with key field1 = space &lt;/P&gt;&lt;P&gt;                             transporting no fields.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;  fldcat-fieldname = 'FIELD1'&lt;/P&gt;&lt;P&gt;  append fldcat&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table itab with key field2 = space &lt;/P&gt;&lt;P&gt;                             transporting no fields.&lt;/P&gt;&lt;P&gt;if sy-subrc ne 0.&lt;/P&gt;&lt;P&gt;  fldcat-fieldname = 'FIELD2'&lt;/P&gt;&lt;P&gt;  append fldcat.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Apr 2010 08:29:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775395#M1463759</guid>
      <dc:creator>former_member418469</dc:creator>
      <dc:date>2010-04-21T08:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Empty ALV static fieldcatlog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775396#M1463760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 May 2010 10:56:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775396#M1463760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-13T10:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Delete Empty ALV static fieldcatlog</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775397#M1463761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Basha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how did you solve it. thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jul 2010 08:27:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-empty-alv-static-fieldcatlog/m-p/6775397#M1463761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-07-12T08:27:39Z</dc:date>
    </item>
  </channel>
</rss>

