<?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: Table Control Selection Column in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931479#M1150437</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Big Mug,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this code, to use the selection column in the table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOP Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
program  sapmz_tabctrl message-id zmsg.

CONTROLS : po_tab TYPE TABLEVIEW USING SCREEN '8002'. "table control

TYPES : BEGIN OF t_ekpo,
          ebeln TYPE ekpo-ebeln,
          ebelp TYPE ekpo-ebelp,
          matnr TYPE ekpo-matnr,
          werks TYPE ekpo-werks,
          menge TYPE ekpo-menge,
          netpr TYPE ekpo-netpr,
          flag(1), "flag for selection column in table control
        END OF t_ekpo.

"check the select column for the table in attributes and name it as wa_ekpo-flag

DATA : it_ekpo TYPE STANDARD TABLE OF t_ekpo, "internal table
       wa_ekpo TYPE t_ekpo. "work area
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At screen flow logic&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

PROCESS BEFORE OUTPUT.
  MODULE status_8002.

  LOOP WITH CONTROL po_tab. "po_tab is the name of table control on screen
    MODULE pass_data. "pass data from internal table into table control on screen
  ENDLOOP.

PROCESS AFTER INPUT.
  MODULE user_command_8002.

  LOOP WITH CONTROL po_tab. "po_tab is the name of table control on screen
    MODULE modify_data. "modify data into the internal table from table control
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE status_8002 OUTPUT.
  SET PF-STATUS 'ZTG_SELTB'.
  DATA : line_count TYPE i.

  DESCRIBE TABLE it_ekpo
  LINES line_count.
  po_tab-lines = line_count + 5.
ENDMODULE.                 " STATUS_8002  OUTPUT

MODULE pass_data OUTPUT.
  READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE.                 " PASS_DATA  OUTPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PAI Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE USER_COMMAND_8002 INPUT.
  OK_CODE = SY-UCOMM.
  CASE OK_CODE.
    WHEN 'BACK'.
      LEAVE TO SCREEN 8001.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_8002  INPUT

MODULE MODIFY_DATA INPUT.
  MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
ENDMODULE.                 " MODIFY_DATA  INPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Dec 2008 10:42:36 GMT</pubDate>
    <dc:creator>I355602</dc:creator>
    <dc:date>2008-12-17T10:42:36Z</dc:date>
    <item>
      <title>Table Control Selection Column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931477#M1150435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a table control with selection column. How do I detect when a row is selected using the selection column? Must the selection column created as pushbutton so that I could make use of ok code? My current settings is table_control_name-LINE_SEL_MODE = 1. Please advise. Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 10:18:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931477#M1150435</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-17T10:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Table Control Selection Column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931478#M1150436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;the internal table that you use for table control fields ,take a field in internal table BOX TYPE C.&lt;/P&gt;&lt;P&gt;when you define selection clm you write the name of this box there.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now you can use as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if &amp;lt;itab-box&amp;gt; eq 'X'.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 10:33:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931478#M1150436</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-17T10:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Table Control Selection Column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931479#M1150437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Big Mug,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this code, to use the selection column in the table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TOP Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
program  sapmz_tabctrl message-id zmsg.

CONTROLS : po_tab TYPE TABLEVIEW USING SCREEN '8002'. "table control

TYPES : BEGIN OF t_ekpo,
          ebeln TYPE ekpo-ebeln,
          ebelp TYPE ekpo-ebelp,
          matnr TYPE ekpo-matnr,
          werks TYPE ekpo-werks,
          menge TYPE ekpo-menge,
          netpr TYPE ekpo-netpr,
          flag(1), "flag for selection column in table control
        END OF t_ekpo.

"check the select column for the table in attributes and name it as wa_ekpo-flag

DATA : it_ekpo TYPE STANDARD TABLE OF t_ekpo, "internal table
       wa_ekpo TYPE t_ekpo. "work area
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At screen flow logic&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

PROCESS BEFORE OUTPUT.
  MODULE status_8002.

  LOOP WITH CONTROL po_tab. "po_tab is the name of table control on screen
    MODULE pass_data. "pass data from internal table into table control on screen
  ENDLOOP.

PROCESS AFTER INPUT.
  MODULE user_command_8002.

  LOOP WITH CONTROL po_tab. "po_tab is the name of table control on screen
    MODULE modify_data. "modify data into the internal table from table control
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE status_8002 OUTPUT.
  SET PF-STATUS 'ZTG_SELTB'.
  DATA : line_count TYPE i.

  DESCRIBE TABLE it_ekpo
  LINES line_count.
  po_tab-lines = line_count + 5.
ENDMODULE.                 " STATUS_8002  OUTPUT

MODULE pass_data OUTPUT.
  READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE.                 " PASS_DATA  OUTPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PAI Module&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODULE USER_COMMAND_8002 INPUT.
  OK_CODE = SY-UCOMM.
  CASE OK_CODE.
    WHEN 'BACK'.
      LEAVE TO SCREEN 8001.
    WHEN 'EXIT'.
      LEAVE PROGRAM.
  ENDCASE.
ENDMODULE.                 " USER_COMMAND_8002  INPUT

MODULE MODIFY_DATA INPUT.
  MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
ENDMODULE.                 " MODIFY_DATA  INPUT
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this solves your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Tarun Gambhir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 10:42:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931479#M1150437</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2008-12-17T10:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Table Control Selection Column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931480#M1150438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have created wrongly during the table control creation using wizard. I did it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) define at TOP&lt;/P&gt;&lt;P&gt;TYPES: BEGIN OF gty_item,&lt;/P&gt;&lt;P&gt;       line(1) type c,&lt;/P&gt;&lt;P&gt;       maktx type goitem-maktx,&lt;/P&gt;&lt;P&gt;       take_it type goitem-take_it,&lt;/P&gt;&lt;P&gt;       erfmg type goitem-erfmg,&lt;/P&gt;&lt;P&gt;       lgobe type goitem-lgobe,&lt;/P&gt;&lt;P&gt;       END OF gty_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: gt_item TYPE STANDARD TABLE OF gty_item,&lt;/P&gt;&lt;P&gt;      gwa_item LIKE LINE OF gt_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) create table control with wizard&lt;/P&gt;&lt;P&gt;I entered gt_item for table and gwa_item for work area. Then at fields selection, i select all the above fields. When I need to set the selection column, I typed in gwa_item-line, but it returned message of no such field in table. What does that mean? Therefore I typed in line instead.. but now it doesn't seem to work. I guess I have defined the wrong selection column. Please advise.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: big mug on Dec 18, 2008 2:52 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Dec 2008 11:26:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931480#M1150438</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-17T11:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Table Control Selection Column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931481#M1150439</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;  Use current_line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE check INPUT.&lt;/P&gt;&lt;P&gt;  MODIFY it_zmara INDEX &lt;STRONG&gt;t_ctrl-current_line&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;  IF t_ctrl-current_line GT ln.&lt;/P&gt;&lt;P&gt;    READ TABLE it_zmara WITH KEY matnr = it_zmara-matnr.&lt;/P&gt;&lt;P&gt;    IF sy-subrc NE 0.&lt;/P&gt;&lt;P&gt;*INSERTING REC IF IT DOES NOT EXIST&lt;/P&gt;&lt;P&gt;      APPEND it_zmara.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      MESSAGE i005 WITH 'MATERIAL NO.' it_zmara-matnr&lt;/P&gt;&lt;P&gt;      'ALREADY EXIST'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " CHECK  INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Krishna...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 03:01:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931481#M1150439</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-18T03:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Table Control Selection Column</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931482#M1150440</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;Check this link &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/EN/d1/802338454211d189710000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/EN/d1/802338454211d189710000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/EN/d1/802338454211d189710000e8322d00/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/EN/d1/802338454211d189710000e8322d00/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Dec 2008 03:02:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-selection-column/m-p/4931482#M1150440</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-18T03:02:37Z</dc:date>
    </item>
  </channel>
</rss>

