<?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: editable table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-table-control/m-p/5561099#M1268926</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can check programs : DEMO_DYNPRO_TABLE_CONTROL_1 &amp;amp; DEMO_DYNPRO_TABLE_CONTROL_2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 May 2009 18:40:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-06T18:40:38Z</dc:date>
    <item>
      <title>editable table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-table-control/m-p/5561097#M1268924</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;I m looking for a sample program of an editable table control, where i can add/modify rows (without popup screens) to a control table , and restore the result in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;table control must have 4 columns : position , material number, material description and quantity.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The columns position and material description are not editable.&lt;/P&gt;&lt;P&gt;The value of positions is an integer : every new row results : last position + 1.&lt;/P&gt;&lt;P&gt;material description will be filled automatically after filling the material number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 18:28:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-table-control/m-p/5561097#M1268924</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T18:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: editable table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-table-control/m-p/5561098#M1268925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using a Table control with an internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table control  : TC1&lt;/P&gt;&lt;P&gt;Internal table : it_zsd00003&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attributes of the table control, select w/SelColumn to get a selection&lt;/P&gt;&lt;P&gt;column on the table control, and give a name (In this example IT_ZSD00003-LINESEL).&lt;/P&gt;&lt;P&gt;Remember to include the field IT_ZSD00003-LINESEL in the &lt;/P&gt;&lt;P&gt;internal table ( linesel(1)       type c, ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When used with an internal table, remember to program&lt;/P&gt;&lt;P&gt;the update functionality of the database tables. Update and &lt;/P&gt;&lt;P&gt;validation can be done when leaving the screen or in PAI using controlname-&lt;/P&gt;&lt;P&gt;current_line (E.g. TC1-current_line ) to indentify the entry in the internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
process before output.
  module status_0100.
  loop at it_zsd00003 with control tc1 cursor tc1-
current_line.
    module tc1_set_field_attr.     "Optional
  endloop.

module status_0100 output.
  set pf-status 'SCREEN0100'.

* OPTIONAL: If it_zsd00003 hasn't allready been filled with
* data, you can do it the first time PBO is called
  module read_data.


* Setting the number of lines of the table control
  describe table it_zsd00003 lines tc1-lines.


* Optional: Place the cursor on line  g_current_line e.g. after a
* validation error has occured 
  if not ( g_current_line is initial ).
    tc1-top_line =  g_current_line.
    clear g_current_line.
  endif.

endmodule.                 " STATUS_0100  OUTPUT

module read_data.
  if flag is initial.
    perform read_data.
    flag = 1.

  endif.
endmodule.        

module tc1_set_field_attr output.
* Optional: Protect some of the columns on the
* table control
    loop at screen.
      if screen-group1 = 'X'.
        screen-input = 0.
        modify screen.
      endif.
    endloop.
  endif.
endmodule.                 " tc1_set_field_attr  OUTPUT

 
process after input.
  loop at it_zsd00003.
     module modify_tc1.
  endloop.

  module user_command_0100.



module modify_tc1 input.

* Modify an existing entry
  modify it_zsd00003 index tc1-current_line.

* OR

* Appending a new entry
  append it_zsd00003.


endmodule.                 " modify_tc1  INPUT



Deleting a single line selected with the selection column: 

form delete_record.

  loop at it_zsd00003.
    if it_zsd00003-linesel = 'X'.
       exit.
    endif.
  endloop.
  
   delete from zsd00003
       where  zdriftscenter     = it_zsd00003-zdriftscenter
              ................................. 
             
endform.                    

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;                                &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 18:34:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-table-control/m-p/5561098#M1268925</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T18:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: editable table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/editable-table-control/m-p/5561099#M1268926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can check programs : DEMO_DYNPRO_TABLE_CONTROL_1 &amp;amp; DEMO_DYNPRO_TABLE_CONTROL_2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 May 2009 18:40:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/editable-table-control/m-p/5561099#M1268926</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-06T18:40:38Z</dc:date>
    </item>
  </channel>
</rss>

