<?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 can delete Internal table column if its Initial. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441697#M826546</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a work area (WA) similar to the itab then read one row from itab into WA and check individual components of the wa if it is INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now you can filterout field1 ,field2,field3,field4 as NON INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use RTTC of RTTI functionality for creaztion of the eork area WA-2 for the above four fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and from WA-2 you can create an itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not tested this before posting. Hope its helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Mar 2008 09:08:10 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-14T09:08:10Z</dc:date>
    <item>
      <title>How can delete Internal table column if its Initial.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441690#M826539</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;How can delete Internal table column if its Initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;eg:I have one internal table its has 5. field1 ,field2,field3,field4 have values but field field5 have no value,that col is empty,&lt;/P&gt;&lt;P&gt;I want delete clo5( field5 ) from Internal table,Pls help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Jay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 12:47:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441690#M826539</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T12:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can delete Internal table column if its Initial.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441691#M826540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it is not fully clear for me, but if you want to modify the definition of the internal table (i.e. the internal table would have only 4 coloumns), that is not possible during runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;ec&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 12:49:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441691#M826540</guid>
      <dc:creator>JozsefSzikszai</dc:creator>
      <dc:date>2008-02-20T12:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can delete Internal table column if its Initial.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441692#M826541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You actually cannot "delete" an internal table column, rather you delete the internal table row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To delete an internal table column, would mean removing the column from the internal table declaration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you mean deleting the internal table row if one of the columns viz. field5 is blank, then code the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DELETE itab WHERE field5 IS INITIAL.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will delete all records from internal table itab where the field5 (column) values are initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Aditya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 12:50:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441692#M826541</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T12:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can delete Internal table column if its Initial.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441693#M826542</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;what u do is first declare a new structure with the fileds (4) u want and then write like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at itab_old.

   itab_new-f1 = itab_old-f1.
itab_new-f2 = itab_old-f2.
itab_new-f3 = itab_old-f3.
itab_new-f4 = itab_old-f4.

append itab_new.

endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Feb 26, 2008 12:30 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 12:51:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441693#M826542</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T12:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can delete Internal table column if its Initial.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441694#M826543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using the static method CL_ALV_TABLE_CREATE=&amp;gt;CREATE_DYNAMIC_TABLE to create a dynamic table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL METHOD CL_ALV_TABLE_CREATE=&amp;gt;CREATE_DYNAMIC_TABLE
EXPORTING
IT_FIELDCATALOG = it_fieldcat
IMPORTING
EP_TABLE = dy_tbl.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;REMOVED BY MODERATOR&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Alvaro Tejada Galindo on Feb 26, 2008 12:31 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Feb 2008 12:59:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441694#M826543</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-02-20T12:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: How can delete Internal table column if its Initial.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441695#M826544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,can u answer my question tht how to delete column from ALV.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 05:49:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441695#M826544</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T05:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can delete Internal table column if its Initial.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441696#M826545</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;If you mean removing the column from ALV display, change the field catalog that is &lt;/P&gt;&lt;P&gt;being passed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pass NO_OUT = 'X'. By doing this, it will be available for selection in the "Change Layout", but will not be displayed initially.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Balaji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 05:53:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441696#M826545</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T05:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: How can delete Internal table column if its Initial.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441697#M826546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a work area (WA) similar to the itab then read one row from itab into WA and check individual components of the wa if it is INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now you can filterout field1 ,field2,field3,field4 as NON INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use RTTC of RTTI functionality for creaztion of the eork area WA-2 for the above four fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and from WA-2 you can create an itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not tested this before posting. Hope its helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gaurav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 09:08:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441697#M826546</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T09:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: How can delete Internal table column if its Initial.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441698#M826547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I HAVE WRITTEN CODE FOR YOU...IT IS VERY INTERESTING...RUN AND SEE...YOU CAN DEBUG IT AND TEST FOR DIFFERENT SCENARIOS ALSO...&lt;/P&gt;&lt;P&gt;COPY PASTE AND RUN...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Report  ZSS_TEST_TP                                                 *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;*&amp;amp;                                                                     *&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zss_test_tp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPE-POOLS: slis.                                        " For ALV List&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF ty_bkpf,&lt;/P&gt;&lt;P&gt;        bukrs TYPE bkpf-bukrs,&lt;/P&gt;&lt;P&gt;        belnr TYPE bkpf-belnr,&lt;/P&gt;&lt;P&gt;        gjahr TYPE bkpf-gjahr,&lt;/P&gt;&lt;P&gt;        bvorg TYPE bkpf-bvorg.&lt;/P&gt;&lt;P&gt;TYPES : END OF ty_bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : it_bkpf TYPE TABLE OF ty_bkpf,&lt;/P&gt;&lt;P&gt;       wa_bkpf TYPE ty_bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF ty_field,&lt;/P&gt;&lt;P&gt;           column TYPE char50,&lt;/P&gt;&lt;P&gt;           desc(50) TYPE c,&lt;/P&gt;&lt;P&gt;        END OF ty_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : it_field TYPE TABLE OF ty_field,&lt;/P&gt;&lt;P&gt;       wa_field TYPE ty_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : it_field1 TYPE TABLE OF ty_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : w_ne TYPE c,&lt;/P&gt;&lt;P&gt;       w_tabix TYPE sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ls_fieldcat TYPE slis_fieldcat_alv,&lt;/P&gt;&lt;P&gt;      gf_pos TYPE i,&lt;/P&gt;&lt;P&gt;      gt_fieldcat TYPE slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;      g_repid LIKE sy-repid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ls_event TYPE slis_alv_event,&lt;/P&gt;&lt;P&gt;      lt_events TYPE slis_t_event,&lt;/P&gt;&lt;P&gt;      gt_events           TYPE slis_t_event,&lt;/P&gt;&lt;P&gt;        g_variant LIKE disvariant,&lt;/P&gt;&lt;P&gt;        g_user_command      TYPE slis_formname VALUE 'USER_COMMAND'.&lt;/P&gt;&lt;P&gt;CONSTANTS:&lt;/P&gt;&lt;P&gt;       gc_formname_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;               FIELD-SYMBOLS                                             *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs_table&amp;gt; TYPE table,&lt;/P&gt;&lt;P&gt;               &amp;lt;fs_any&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;               &amp;lt;fs_wa&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PERFORM collect_columns.&lt;/P&gt;&lt;P&gt;PERFORM get_data.&lt;/P&gt;&lt;P&gt;PERFORM check_empty_columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF it_field IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;  PERFORM fill_fieldcat.&lt;/P&gt;&lt;P&gt;  PERFORM  eventtab_build.&lt;/P&gt;&lt;P&gt;  PERFORM call_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;  MESSAGE s000(zenil_sd) DISPLAY LIKE 'E' WITH 'NO ENTRIES FOUND'.&lt;/P&gt;&lt;P&gt;  LEAVE LIST-PROCESSING.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      Top Of Page&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM top_of_page.&lt;/P&gt;&lt;P&gt;  WRITE : 'SACHIN PROGRAM'.&lt;/P&gt;&lt;P&gt;ENDFORM.                    "top_of_page&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  COLLECT_COLUMNS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM collect_columns .&lt;/P&gt;&lt;P&gt;  wa_field-column = 'BUKRS'.&lt;/P&gt;&lt;P&gt;  wa_field-desc = 'COMPANY CODE'.&lt;/P&gt;&lt;P&gt;  APPEND  wa_field TO  it_field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_field-column = 'BELNR'.&lt;/P&gt;&lt;P&gt;  wa_field-desc = 'DOCUMENT NO'.&lt;/P&gt;&lt;P&gt;  APPEND  wa_field TO  it_field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_field-column = 'GJAHR'.&lt;/P&gt;&lt;P&gt;  wa_field-desc = 'FISCAL YEAR'.&lt;/P&gt;&lt;P&gt;  APPEND  wa_field TO  it_field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  wa_field-column = 'BVORG'.&lt;/P&gt;&lt;P&gt;  wa_field-desc = 'BVORG'.&lt;/P&gt;&lt;P&gt;  APPEND  wa_field TO  it_field .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " COLLECT_COLUMNS&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  get_data&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_data .&lt;/P&gt;&lt;P&gt;  SELECT * FROM bkpf&lt;/P&gt;&lt;P&gt;  INTO CORRESPONDING FIELDS OF TABLE it_bkpf&lt;/P&gt;&lt;P&gt;  WHERE bukrs = '2000'&lt;/P&gt;&lt;P&gt;    AND belnr = '1120000001'&lt;/P&gt;&lt;P&gt;    AND gjahr = '2007'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " get_data&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  check_empty_columns&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM check_empty_columns .&lt;/P&gt;&lt;P&gt;  LOOP AT it_field INTO wa_field.&lt;/P&gt;&lt;P&gt;    ASSIGN wa_field-column TO &amp;lt;fs_any&amp;gt;.&lt;/P&gt;&lt;P&gt;    w_tabix = w_tabix + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT it_bkpf INTO wa_bkpf. "WHERE &amp;lt;fs_any&amp;gt; IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT w_tabix OF STRUCTURE wa_bkpf TO &amp;lt;fs_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;      IF &amp;lt;fs_wa&amp;gt; IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;        w_ne = 'X'.&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;    IF w_ne &amp;lt;&amp;gt; 'X'.&lt;/P&gt;&lt;P&gt;      DELETE it_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      CLEAR w_ne.&lt;/P&gt;&lt;P&gt;      APPEND wa_field TO it_field1.&lt;/P&gt;&lt;P&gt;      CONTINUE.&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;ENDFORM.                    " check_empty_columns&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  fill_fieldcat&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM fill_fieldcat .&lt;/P&gt;&lt;P&gt;  LOOP AT it_field1 INTO wa_field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR ls_fieldcat.&lt;/P&gt;&lt;P&gt;    gf_pos = gf_pos + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ls_fieldcat-col_pos       = gf_pos.&lt;/P&gt;&lt;P&gt;    ls_fieldcat-fieldname     = wa_field-column.&lt;/P&gt;&lt;P&gt;    ls_fieldcat-ref_fieldname = wa_field-column.&lt;/P&gt;&lt;P&gt;    ls_fieldcat-ref_tabname   = 'IT_BKPF'.&lt;/P&gt;&lt;P&gt;    ls_fieldcat-seltext_s     = wa_field-desc.&lt;/P&gt;&lt;P&gt;    ls_fieldcat-seltext_m     = wa_field-desc.&lt;/P&gt;&lt;P&gt;    ls_fieldcat-seltext_l     = wa_field-desc.&lt;/P&gt;&lt;P&gt;    ls_fieldcat-reptext_ddic  = wa_field-desc.&lt;/P&gt;&lt;P&gt;    APPEND ls_fieldcat TO  gt_fieldcat.&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;ENDFORM.                    " fill_fieldcat&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  eventtab_build&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM eventtab_build .&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_list_type = 0&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      et_events   = lt_events.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  READ TABLE lt_events WITH KEY name =  slis_ev_top_of_page&lt;/P&gt;&lt;P&gt;                       INTO ls_event.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    MOVE gc_formname_top_of_page TO ls_event-form.&lt;/P&gt;&lt;P&gt;    APPEND ls_event TO lt_events.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " eventtab_build&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  call_alv&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM call_alv .&lt;/P&gt;&lt;P&gt;  g_repid = sy-cprog.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      i_callback_program      = g_repid&lt;/P&gt;&lt;P&gt;      it_fieldcat             = gt_fieldcat[]&lt;/P&gt;&lt;P&gt;      it_events               = gt_events[]&lt;/P&gt;&lt;P&gt;      i_callback_user_command = g_user_command&lt;/P&gt;&lt;P&gt;      i_save                  = 'A'&lt;/P&gt;&lt;P&gt;      is_variant              = g_variant&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      t_outtab                = it_bkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " call_alv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sachin Sawant on Mar 14, 2008 11:56 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Mar 2008 10:53:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-can-delete-internal-table-column-if-its-initial/m-p/3441698#M826547</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-14T10:53:44Z</dc:date>
    </item>
  </channel>
</rss>

