<?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: Problem with table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018594#M1347243</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;    Here is a description of how to play with rows and columns in a table controll&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SORTING BY COLUMN&lt;/P&gt;&lt;P&gt;We have to first determine which column of table control was selected for sorting.Then we have to determine the name of the field from this information to use in SORT itab STABLE BY field command.&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: col LIKE LINE OF tab_con-COLS "tab_con is name of table control,
                                                            "COLS field is an internal table of TYPE
                                                            "CXTAB_COLUMN  .This variable will 
                                                            "be used to access column attributes of
                                                            "the table control. 
 
*We will read the column properties of selected column into col variable from
*collection of columns COLS. 
*SELECTED is the field of structure CXTAB_COLUMN and indicates selection.
 
READ TABLE tab_con-COLS INTO col WITH KEY selected = 'X' .
 
IF SY_SUBRC EQ 0.
*col-SCREEN-NAME(+offset)  is used to determine the actual field name(like *PHONE) as*col-SCREEN-NAME will return the screen name like ADDRESS-*PHONE.
*the value of offset depends upon the length of the name of the structure.
 
SORT itab STABLE BY col-SCREEN-NAME(+offset) 
ENDIF.&lt;/CODE&gt;&lt;/PRE&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;DELETING SELECTED ROWS&lt;/P&gt;&lt;P&gt;Deletion of selected rows is simple. To delete selected rows first we will determine the rows which have been selected through selection column .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FOR SINGLE ROW SELECTION&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF mark EQ 'X' .             "mark is the name of selection column field
DELETE itab FROM workarea .  
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR MULTIPLE ROW SELECTION&lt;/P&gt;&lt;P&gt;*To deetermine the rows selected we will use the selection column field to loop&lt;/P&gt;&lt;P&gt;*through the internal table.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT itab WHERE mark EQ 'X'.  "mark is the name of selection column field
DELETE itab                                    " and is part of the internal table . 
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIDING A COLUMN&lt;/P&gt;&lt;P&gt;To hide a column we will use the INVISIBLE field of the structure CXTABA_CONTROL and set its value to 'X'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;e.g. To hide column number 3.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA col LIKE LINE OF tab-con-COLS .
READ TABLE tab_con-COLS INTO col WHERE index = 3. "tab_con is the name                                                                                
" of table control.
col-INVISIBLE = 3.
MODIFY  tab-con-COLS FROM col INDEX 3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Similarly other operations can be performed by changing the value of various fields of structure CXTAB_CONTROL.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; Thank You,&lt;/P&gt;&lt;P&gt;Pavan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2009 05:45:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-04T05:45:16Z</dc:date>
    <item>
      <title>Problem with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018588#M1347237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is the first time I am working in table control.I have made a table control  named tab_cntrl.&lt;/P&gt;&lt;P&gt;this tab_cntrl have 6 columns and 5 row..Now each row will have different values as I will be selecting it from 5 different database table and display it in each row.I just wanted to know how can we access different row in table control..is there any system field which stores the line no or row number and column number of table control...as well as how can I write in it. Any sample code will be of grt help.&lt;/P&gt;&lt;P&gt;Thanx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:24:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018588#M1347237</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018589#M1347238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Priya!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can find the solution on Forum as well ..... her is the link i hope this will help u&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac9f35c111d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ashu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:30:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018589#M1347238</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018590#M1347239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check program DEMO_DYNPRO_TABCONT_LOOP&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:31:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018590#M1347239</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018591#M1347240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Priya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any control that we represent on screen has equvalent field in ABAP code that means&lt;/P&gt;&lt;P&gt;table control will also have some internal table representing in ABAP code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, You can manipulate that internal table and Table control will display those content accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refre SAP help for more information on table control and internal table working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is pretty simple! Just try once!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Augustin.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:35:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018591#M1347240</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018592#M1347241</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;have a look on this link,&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="500116"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it will help.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Archana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:40:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018592#M1347241</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018593#M1347242</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;In the table control to access the fields for click the code goes as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the screen there is a checkbox for table control to respond on double click check that.&lt;/P&gt;&lt;P&gt;Sample Code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data:
  w_tabix     TYPE sy-tabix.         " Stores Tabix Value
  w_data      TYPE likp-vbeln  ,     " Stores data on Cusor
  line_sel    TYPE sy-stepl ,        " Stores Line Number

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FORM call_screen_300.

 GET CURSOR FIELD fs_likp-vbeln LINE line_sel VALUE w_data.

IF fs_likp-vbeln  NE 'FS_LIKP-VB'.

   MESSAGE 'Click on Delivery Number Only'(004) TYPE 'E'.

  ENDIF.                               " IF FS_LIPS-VLELN...

  w_tabix =  table_control-top_line + line_sel - 1 .

  CALL  SCREEN 300.

ENDFORM
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can give a mark field for the leads for the row....&lt;/P&gt;&lt;P&gt;  W_MARK      TYPE C VALUE 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  you need to define a variable of 1 char  like below which will return the selected row in the PAI where through read statement you can get the corresponding row values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://wiki.sdn.sap.com/wiki/display/ABAP/Learn" target="test_blank"&gt;https://wiki.sdn.sap.com/wiki/display/ABAP/Learn&lt;/A&gt;&lt;EM&gt;Making&lt;/EM&gt;First&lt;EM&gt;Table&lt;/EM&gt;Control&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also u can give a look to DEMO_DYNPRO program for getting the current line in table mark and ither functionality in table control.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:42:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018593#M1347242</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018594#M1347243</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;    Here is a description of how to play with rows and columns in a table controll&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;SORTING BY COLUMN&lt;/P&gt;&lt;P&gt;We have to first determine which column of table control was selected for sorting.Then we have to determine the name of the field from this information to use in SORT itab STABLE BY field command.&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: col LIKE LINE OF tab_con-COLS "tab_con is name of table control,
                                                            "COLS field is an internal table of TYPE
                                                            "CXTAB_COLUMN  .This variable will 
                                                            "be used to access column attributes of
                                                            "the table control. 
 
*We will read the column properties of selected column into col variable from
*collection of columns COLS. 
*SELECTED is the field of structure CXTAB_COLUMN and indicates selection.
 
READ TABLE tab_con-COLS INTO col WITH KEY selected = 'X' .
 
IF SY_SUBRC EQ 0.
*col-SCREEN-NAME(+offset)  is used to determine the actual field name(like *PHONE) as*col-SCREEN-NAME will return the screen name like ADDRESS-*PHONE.
*the value of offset depends upon the length of the name of the structure.
 
SORT itab STABLE BY col-SCREEN-NAME(+offset) 
ENDIF.&lt;/CODE&gt;&lt;/PRE&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;DELETING SELECTED ROWS&lt;/P&gt;&lt;P&gt;Deletion of selected rows is simple. To delete selected rows first we will determine the rows which have been selected through selection column .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;FOR SINGLE ROW SELECTION&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;IF mark EQ 'X' .             "mark is the name of selection column field
DELETE itab FROM workarea .  
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FOR MULTIPLE ROW SELECTION&lt;/P&gt;&lt;P&gt;*To deetermine the rows selected we will use the selection column field to loop&lt;/P&gt;&lt;P&gt;*through the internal table.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT itab WHERE mark EQ 'X'.  "mark is the name of selection column field
DELETE itab                                    " and is part of the internal table . 
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIDING A COLUMN&lt;/P&gt;&lt;P&gt;To hide a column we will use the INVISIBLE field of the structure CXTABA_CONTROL and set its value to 'X'.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;e.g. To hide column number 3.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA col LIKE LINE OF tab-con-COLS .
READ TABLE tab_con-COLS INTO col WHERE index = 3. "tab_con is the name                                                                                
" of table control.
col-INVISIBLE = 3.
MODIFY  tab-con-COLS FROM col INDEX 3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Similarly other operations can be performed by changing the value of various fields of structure CXTAB_CONTROL.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt; Thank You,&lt;/P&gt;&lt;P&gt;Pavan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:45:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018594#M1347243</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:45:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018595#M1347244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data in a Table Control come from an internal Table. In the Process Before Output you populate the Dynpro Table from the ABAP Internal Table. So, you are left with the possibilities of manipulating the table control accordingly and can populate the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a look at the demo code for table control where in which it populates the data:&lt;/P&gt;&lt;P&gt;DEMO_DYNPRO_TABCONT_LOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Samantak.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 05:55:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018595#M1347244</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T05:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018596#M1347245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://www.sapdev.co.uk/dialog/tabcontrol/tc_basic.htm" target="test_blank"&gt;http://www.sapdev.co.uk/dialog/tabcontrol/tc_basic.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Aug 2009 13:00:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-table-control/m-p/6018596#M1347245</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-08T13:00:38Z</dc:date>
    </item>
  </channel>
</rss>

