<?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: select deselect in table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025438#M1169098</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Please ensure your code is after the LOOP statement for the table control in FLOW LOGIC.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Please understand the ORDER in a flow logic matters a lot..for eg. if you have the code given by you before the LOOP. the loop copies data from the screen onto ITAB and that will nullify whatever operation you did on the ITAB.&lt;/P&gt;&lt;P&gt; So please check the Flow Order and confirm if this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply if the issue is resolved and if so HOW ..&lt;/P&gt;&lt;P&gt;Thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Jan 2009 09:18:26 GMT</pubDate>
    <dc:creator>KN-Nampoothiry</dc:creator>
    <dc:date>2009-01-03T09:18:26Z</dc:date>
    <item>
      <title>select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025434#M1169094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;am providing two options like select , deselect  and how can i delete and modify the selected line in table control .if possible provide the code for both select and deselect and delete modify.But i have done this for select deselect it is not wrking.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CASE SY-UCOMM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHEN 'SELECTALL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      wa_tablecontrol-sel = 'X'.   "  seletion field on table control&lt;/P&gt;&lt;P&gt;      MODIFY it_tbcontrol from wa_tablecontrol TRANSPORTING SEL WHERE SEL IS INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHEN 'DESELECTALL'.&lt;/P&gt;&lt;P&gt;      wa_tablecontrol-sel  = SPACE.&lt;/P&gt;&lt;P&gt;      MODIFY it_tbcontrol from wa_tablecontrol TRANSPORTING SEL WHERE SEL = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDCASE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2009 09:00:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025434#M1169094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-03T09:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025435#M1169095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;go through the below demo program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DEMO_DYNPRO_TABLE_CONTROL_1&lt;/P&gt;&lt;P&gt;DEMO_DYNPRO_TABLE_CONTROL_2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refer below link..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://saptechnical.com/Tutorials/ABAP/TableControl/Demo.htm" target="test_blank"&gt;http://saptechnical.com/Tutorials/ABAP/TableControl/Demo.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2009 09:07:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025435#M1169095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-03T09:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025436#M1169096</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;Go through this link, its will help to to delete and modify the line in table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://saptechnical.com/Tutorials/ABAP/TableControl/Demo.htm" target="test_blank"&gt;http://saptechnical.com/Tutorials/ABAP/TableControl/Demo.htm&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2009 09:08:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025436#M1169096</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-03T09:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025437#M1169097</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;Check the Function Code SELECTALL &amp;amp; DESELECTALL are proporly defined in the PF-STATUS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2009 09:10:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025437#M1169097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-03T09:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025438#M1169098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Please ensure your code is after the LOOP statement for the table control in FLOW LOGIC.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Please understand the ORDER in a flow logic matters a lot..for eg. if you have the code given by you before the LOOP. the loop copies data from the screen onto ITAB and that will nullify whatever operation you did on the ITAB.&lt;/P&gt;&lt;P&gt; So please check the Flow Order and confirm if this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply if the issue is resolved and if so HOW ..&lt;/P&gt;&lt;P&gt;Thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2009 09:18:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025438#M1169098</guid>
      <dc:creator>KN-Nampoothiry</dc:creator>
      <dc:date>2009-01-03T09:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025439#M1169099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Please ensure your code is after the LOOP statement for the table control in FLOW LOGIC.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Please understand the ORDER in a flow logic matters a lot..for eg. if you have the code given by you before the LOOP. the loop copies data from the screen onto ITAB and that will nullify whatever operation you did on the ITAB.&lt;/P&gt;&lt;P&gt; So please check the Flow Order and confirm if this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply if the issue is resolved and if so HOW ..&lt;/P&gt;&lt;P&gt;Thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2009 09:18:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025439#M1169099</guid>
      <dc:creator>KN-Nampoothiry</dc:creator>
      <dc:date>2009-01-03T09:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025440#M1169100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Please ensure your code is after the LOOP statement for the table control in FLOW LOGIC.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Please understand the ORDER in a flow logic matters a lot..for eg. if you have the code given by you before the LOOP. the loop copies data from the screen onto ITAB and that will nullify whatever operation you did on the ITAB.&lt;/P&gt;&lt;P&gt; So please check the Flow Order and confirm if this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply if the issue is resolved and if so HOW ..&lt;/P&gt;&lt;P&gt;Thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2009 09:19:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025440#M1169100</guid>
      <dc:creator>KN-Nampoothiry</dc:creator>
      <dc:date>2009-01-03T09:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025441#M1169101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Please ensure your code is after the LOOP statement for the table control in FLOW LOGIC.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Please understand the ORDER in a flow logic matters a lot..for eg. if you have the code given by you before the LOOP. the loop copies data from the screen onto ITAB and that will nullify whatever operation you did on the ITAB.&lt;/P&gt;&lt;P&gt; So please check the Flow Order and confirm if this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reply if the issue is resolved and if so HOW ..&lt;/P&gt;&lt;P&gt;Thankx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2009 09:19:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025441#M1169101</guid>
      <dc:creator>KN-Nampoothiry</dc:creator>
      <dc:date>2009-01-03T09:19:19Z</dc:date>
    </item>
    <item>
      <title>Re: select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025442#M1169102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Modify as below...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CASE SY-UCOMM.&lt;/P&gt;&lt;P&gt;WHEN 'SELECTALL'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop at it_tbcontrol into wa_tablecontrol.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_tablecontrol-sel = 'X'. " seletion field on table control&lt;/P&gt;&lt;P&gt;MODIFY it_tbcontrol from wa_tablecontrol .&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endloop&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'DESELECTALL'.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop at it_tbcontrol into wa_tablecontrol.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;wa_tablecontrol-sel = SPACE.&lt;/P&gt;&lt;P&gt;MODIFY it_tbcontrol from wa_tablecontrol .&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endloop.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDCASE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Jan 2009 10:20:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025442#M1169102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-03T10:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: select deselect in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025443#M1169103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use this code to select, deselect, delete and modify data from table control into the database table, its working:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take the names of the input/output fields as work_area-field_name and select column in table control as work_area-flag.&lt;/P&gt;&lt;P&gt;Also take a flag field of size 1 datatype character as the last field in the internal table and work area while declaration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At Screen Logic:-&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
PROCESS BEFORE OUTPUT.
  MODULE status_8002. "for pf-status

  LOOP WITH CONTROL po_tab. "po_tab is name of table control
    MODULE pass_data. "to pass data into table control from internal table
  ENDLOOP.

PROCESS AFTER INPUT.
  MODULE user_command_8002. "to handle other user commands (back and exit)

  LOOP WITH CONTROL po_tab. "po_tab is name of table control
    MODULE modify_data. "to modify data from table control into internal table
  ENDLOOP.

  MODULE function. "to select &amp;amp; deselect all records int table control
  MODULE delete. "to delete the selected entries
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In PBO,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  PASS_DATA  OUTPUT
*&amp;amp;---------------------------------------------------------------------*
MODULE pass_data OUTPUT.
  READ TABLE it_ekpo into wa_ekpo INDEX po_tab-current_line.
ENDMODULE.                 " PASS_DATA  OUTPUT
"it_ekpo is internal table and wa_ekpo is the work area
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In PAI,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  MODIFY_DATA  INPUT
*&amp;amp;---------------------------------------------------------------------*
MODULE MODIFY_DATA INPUT.
  MODIFY IT_EKPO INDEX PO_TAB-CURRENT_LINE FROM WA_EKPO.
  "modify records from table control into the internal table
ENDMODULE.                 " MODIFY_DATA  INPUT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  FUNCTION  INPUT
*&amp;amp;---------------------------------------------------------------------*
MODULE FUNCTION INPUT.
  OK_CODE = SY-UCOMM.

  CASE OK_CODE.

    WHEN 'SELECT'. "to select all records
      LOOP AT IT_EKPO INTO WA_EKPO.
        WA_EKPO-FLAG = 'X'. "set flag field as 'X'
        MODIFY IT_EKPO FROM WA_EKPO.
      ENDLOOP.

    WHEN 'DESEL'. "to de-select all records
      LOOP AT IT_EKPO INTO WA_EKPO.
        WA_EKPO-FLAG = ' '. "set flag field as space
        MODIFY IT_EKPO FROM WA_EKPO.
      ENDLOOP.
  ENDCASE.

ENDMODULE.                 " FUNCTION  INPUT

*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Module  DELETE  INPUT
*&amp;amp;---------------------------------------------------------------------*
MODULE DELETE INPUT.
"take one more internal table and work area for deleting the records
"from the initial internal table and delete from the database table
"of same type as of the initial internal table and work area
  OK_CODE = SY-UCOMM.

  CASE OK_CODE.

    WHEN 'DELETE'.
      SORT IT_EKPO BY FLAG DESCENDING. "sort for selected fields
      CLEAR WA_EKPO1.
      CLEAR WA_EKPO.
      REFRESH IT_EKPO1.
      LOOP AT IT_EKPO INTO WA_EKPO WHERE FLAG = 'X'.
        DATA : J TYPE I.
        CLEAR J.
        J = SY-TABIX. "get index of selected record
        MOVE-CORRESPONDING WA_EKPO TO WA_EKPO1. "move selected records
        APPEND WA_EKPO1 TO IT_EKPO1. "into another internal table for processing
        DELETE IT_EKPO. "delete selected records from initial internal table
      ENDLOOP.
      IF J = 0. "if no records selected then message displayed
        MESSAGE I006.
      ELSE.
        DELETE ZEKPO FROM TABLE IT_EKPO1. "delete selected records from db table
        "or you can process them as per your requirement
        "rememeber not to delete records from standard tables
        "in my case i am using a Z table
        COMMIT WORK.
        IF SY-SUBRC = 0.
          MESSAGE S007. "sucess message after deleting selected records
        ENDIF.
      ENDIF.

  ENDCASE.
ENDMODULE.                 " DELETE  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>Mon, 05 Jan 2009 04:03:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-deselect-in-table-control/m-p/5025443#M1169103</guid>
      <dc:creator>I355602</dc:creator>
      <dc:date>2009-01-05T04:03:12Z</dc:date>
    </item>
  </channel>
</rss>

