<?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: Enable / Disable in Table Control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/enable-disable-in-table-control/m-p/7261153#M1528899</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have the table control defined in your program as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTROLS &amp;lt;ctrl&amp;gt; TYPE TABLEVIEW USING SCREEN &amp;lt;scr&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table has the structure of type CXTAB_CONTROL which has one field called column&lt;/P&gt;&lt;P&gt;which we can repfer as &amp;lt;ctrl&amp;gt;-cols and this cols has a structure CXTAB_COLUMN by varying&lt;/P&gt;&lt;P&gt;the attributes of this cols field you can disable the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write below code in your PBO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If flag = 'X' (condition on which you will be varying the table control o/P to show 1,2,3,5 column)

data wa_cols type cxtab_column.

LOOP AT &amp;lt;ctrl&amp;gt;-COLS INTO wa_cols.

 IF wa_cols-index = 6 or
    wa_cols-index = 7 or
    wa_cols-index = 8 or
    wa_cols-index = 9 or.    
    wa_cols-INVISIBLE= 'X'. 
    MODIFY &amp;lt;ctrl&amp;gt;--COLS FROM wa_cols INDEX SY-TABIX.
 ENDIF.
ENDLOOP.

else. (condition on which you will be varying the table control o/P to show 6,7,8,9 column)

in above code just replace 6,7,8,9 with 1,2,3,5

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pawan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Oct 2010 12:05:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-06T12:05:12Z</dc:date>
    <item>
      <title>Enable / Disable in Table Control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enable-disable-in-table-control/m-p/7261151#M1528897</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; &lt;/P&gt;&lt;P&gt;in the tab control that have 9 cols. and output willl come Dynamically . EX.. Output coming in Cols 1,2,3,5, so i want that &lt;/P&gt;&lt;P&gt;Cols will disable 6,7,8,9 . which have no output  so Please tell me.&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;&lt;/P&gt;&lt;P&gt;thank's&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 05:02:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enable-disable-in-table-control/m-p/7261151#M1528897</guid>
      <dc:creator>former_member347888</dc:creator>
      <dc:date>2010-10-06T05:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: Enable / Disable in Table Control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enable-disable-in-table-control/m-p/7261152#M1528898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt; U can do this but there is one problem , as u said u want to disable column based on the data in it right ?&lt;/P&gt;&lt;P&gt;In  tcontrol there  might be multiple records so if the first row in the tcontrol has no value in the col 6 and has value in the second row, then should the column be displayed  If yes then u have to check row by row and if all row in the col 6 is blank then only u have to disable the column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In PBO &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it.&lt;/P&gt;&lt;P&gt;    module screen_property.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the module write the code by &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;module  screen_property.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at screen.&lt;/P&gt;&lt;P&gt;  if it-col6 is initial.&lt;/P&gt;&lt;P&gt;screen-input = 1.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;modify screen&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end module&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is the make the field display mode , But if u want to make invisible the column the n u have to check first tat all rows are initial and then make invisible the column then use the structure CXTAB_COLUMN and make the column invisble&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhukar Shetty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Madhukar Shetty on Oct 6, 2010 7:14 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 05:13:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enable-disable-in-table-control/m-p/7261152#M1528898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T05:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Enable / Disable in Table Control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/enable-disable-in-table-control/m-p/7261153#M1528899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You will have the table control defined in your program as &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTROLS &amp;lt;ctrl&amp;gt; TYPE TABLEVIEW USING SCREEN &amp;lt;scr&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This table has the structure of type CXTAB_CONTROL which has one field called column&lt;/P&gt;&lt;P&gt;which we can repfer as &amp;lt;ctrl&amp;gt;-cols and this cols has a structure CXTAB_COLUMN by varying&lt;/P&gt;&lt;P&gt;the attributes of this cols field you can disable the fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write below code in your PBO&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;If flag = 'X' (condition on which you will be varying the table control o/P to show 1,2,3,5 column)

data wa_cols type cxtab_column.

LOOP AT &amp;lt;ctrl&amp;gt;-COLS INTO wa_cols.

 IF wa_cols-index = 6 or
    wa_cols-index = 7 or
    wa_cols-index = 8 or
    wa_cols-index = 9 or.    
    wa_cols-INVISIBLE= 'X'. 
    MODIFY &amp;lt;ctrl&amp;gt;--COLS FROM wa_cols INDEX SY-TABIX.
 ENDIF.
ENDLOOP.

else. (condition on which you will be varying the table control o/P to show 6,7,8,9 column)

in above code just replace 6,7,8,9 with 1,2,3,5

endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pawan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Oct 2010 12:05:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/enable-disable-in-table-control/m-p/7261153#M1528899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-06T12:05:12Z</dc:date>
    </item>
  </channel>
</rss>

