<?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: Determining selected lines in screen table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-selected-lines-in-screen-table-control/m-p/4781237#M1120084</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 PAI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;describe table itab1 lines tc1-lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tc1-current_line &amp;gt; tc1-lines.&lt;/P&gt;&lt;P&gt;append itab1.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;modify itab1 index tc1-current_line.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then your other coding follows.&lt;/P&gt;&lt;P&gt;in PAI&lt;/P&gt;&lt;P&gt;module enter.&lt;/P&gt;&lt;P&gt;in the program&lt;/P&gt;&lt;P&gt;module enter&lt;/P&gt;&lt;P&gt;if you want multilple rows to be selected you need to loop the itab1 else single read statement will do the job&lt;/P&gt;&lt;P&gt;refresh itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab1 where selcol = 'X'&lt;/P&gt;&lt;P&gt;move itab1 to itab1.&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;endlmodule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will work for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ramchander Rao.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Nov 2008 04:23:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-11-27T04:23:52Z</dc:date>
    <item>
      <title>Determining selected lines in screen table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-selected-lines-in-screen-table-control/m-p/4781235#M1120082</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;I have developed a screen in Screen Painter (SE51) with two table controls. I am using two internal tables, ITAB1 and ITAB2 to fill these tables. Using the code below the screen tables get filled with the data in the internal tables without any problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I need that the rows displayed on the screen for ITAB1 should be selectable and upon clicking a button the selected rows should be displayed in ITAB2 on screen. In Screen Painter for control SCR_ITAB1 I have defined both line and column selection attributes as 'Multiple' and checked the w / SelColumn checkbox with name SELCOL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I determine which rows have been selected? Example code would be very helpful. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP Program Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONTROLS: SCR_ITAB1 TYPE TABLEVIEW USING SCREEN '9501'.&lt;/P&gt;&lt;P&gt;CONTROLS: SCR_ITAB2 TYPE TABLEVIEW USING SCREEN '9501'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE FILL_ITAB1 OUTPUT.&lt;/P&gt;&lt;P&gt;   DESCRIBE TABLE ITAB LINES SCR_ITAB1-LINES.&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODULE FILL_ITAB2 OUTPUT.&lt;/P&gt;&lt;P&gt;   DESCRIBE TABLE ITAB2 LINES SCR_ITAB2-LINES.&lt;/P&gt;&lt;P&gt;ENDMODULE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PBO in Screen Painter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS BEFORE OUTPUT.&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;MODULE TESTTAB_CHANGE_TC_ATTR.&lt;/P&gt;&lt;P&gt;   LOOP AT ITAB1&lt;/P&gt;&lt;P&gt;      INTO ITAB1&lt;/P&gt;&lt;P&gt;      WITH CONTROL SCR_ITAB1&lt;/P&gt;&lt;P&gt;      CURSOR SCR_ITAB1-CURRENT_LINE.&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;&lt;/P&gt;&lt;P&gt;MODULE DISPLAY_MYTAB_9501.&lt;/P&gt;&lt;P&gt;   LOOP AT ITAB2&lt;/P&gt;&lt;P&gt;      INTO ITAB2&lt;/P&gt;&lt;P&gt;      WITH CONTROL SCR_ITAB2&lt;/P&gt;&lt;P&gt;      CURSOR SCR_ITAB2-CURRENT_LINE.&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;&lt;/P&gt;&lt;P&gt;PAI in Screen Painter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROCESS AFTER INPUT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT ITAB2.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 20:13:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-selected-lines-in-screen-table-control/m-p/4781235#M1120082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T20:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: Determining selected lines in screen table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-selected-lines-in-screen-table-control/m-p/4781236#M1120083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;when you have checked the w/Selcolumn you will give a name for it in the textbox.(ex: s_row)take that and in your internal table add that to your column. ITAB1.  if a row is selected this column will be filled with 'X'.you can loop through the internal table and get the selected orws.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;in PAI. 
LOOP AT itab1. 
IF itab1-s_row = 'X'. 
move itab1-current_line to i_itab2-row.
ENDIF.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Nov 2008 21:45:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-selected-lines-in-screen-table-control/m-p/4781236#M1120083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-26T21:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Determining selected lines in screen table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determining-selected-lines-in-screen-table-control/m-p/4781237#M1120084</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 PAI,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;describe table itab1 lines tc1-lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tc1-current_line &amp;gt; tc1-lines.&lt;/P&gt;&lt;P&gt;append itab1.&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;modify itab1 index tc1-current_line.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then your other coding follows.&lt;/P&gt;&lt;P&gt;in PAI&lt;/P&gt;&lt;P&gt;module enter.&lt;/P&gt;&lt;P&gt;in the program&lt;/P&gt;&lt;P&gt;module enter&lt;/P&gt;&lt;P&gt;if you want multilple rows to be selected you need to loop the itab1 else single read statement will do the job&lt;/P&gt;&lt;P&gt;refresh itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table itab1 where selcol = 'X'&lt;/P&gt;&lt;P&gt;move itab1 to itab1.&lt;/P&gt;&lt;P&gt;append itab2.&lt;/P&gt;&lt;P&gt;endlmodule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will work for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Ramchander Rao.K&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Nov 2008 04:23:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determining-selected-lines-in-screen-table-control/m-p/4781237#M1120084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-27T04:23:52Z</dc:date>
    </item>
  </channel>
</rss>

