<?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 with Display/Change/Add/Delete Function in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-with-display-change-add-delete-function/m-p/1886498#M371802</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why don't you use table maint.-generator (in tcode se11) for sm30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 13 Jan 2007 14:24:23 GMT</pubDate>
    <dc:creator>andreas_mann3</dc:creator>
    <dc:date>2007-01-13T14:24:23Z</dc:date>
    <item>
      <title>Table Control with Display/Change/Add/Delete Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-with-display-change-add-delete-function/m-p/1886497#M371801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got a request to require a module program to maintain customer table, the SPEC is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the screen there are 2 fields as selection criteria value, after input them and press ENTER, all related record from this table should be list on the table control below, that is easy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, I will  1) modify some of listed records &lt;/P&gt;&lt;P&gt;                2)add new records (press add new item button below table control to get one line active for input, then ENTER to check the valid of this record and keep it on the screen if it's OK,  or get error message, after correct press ENTER again the valid again and keep it on the screen)&lt;/P&gt;&lt;P&gt;                3) delete some listed records (press delete item button below table control to delete selected record, then refresh the table control list again)&lt;/P&gt;&lt;P&gt;              Then press a UPDATE button to make save/update/delete the database table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I do it? Is there is example code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank in Advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jan 2007 06:32:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-with-display-change-add-delete-function/m-p/1886497#M371801</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-13T06:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Table Control with Display/Change/Add/Delete Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-with-display-change-add-delete-function/m-p/1886498#M371802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why don't you use table maint.-generator (in tcode se11) for sm30&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jan 2007 14:24:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-with-display-change-add-delete-function/m-p/1886498#M371802</guid>
      <dc:creator>andreas_mann3</dc:creator>
      <dc:date>2007-01-13T14:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Table Control with Display/Change/Add/Delete Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-with-display-change-add-delete-function/m-p/1886499#M371803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi i think u need a Module pool program which performs this , check this code it will surely help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Insert a new field CHK at the end of internal table.. of type , this marks the selected records in table control&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHK LIKE DEMO_CONN-MARK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;define OK_Code which will capture SY-UCOMM and then in module pool program u can use the following code, if u want the whole thing I can paste it here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CASE OK_CODE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHEN 'DELETE'. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      READ TABLE IT_ORD WITH KEY CHK = 'X'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        PERFORM RET_BLOCKED_AMOUNT. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;&lt;/P&gt;&lt;P&gt;        DELETE IT_ORD WHERE CHK = 'X'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        DESCRIBE TABLE IT_ORD LINES TC1-LINES. &lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;      ELSE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        MESSAGE I000(ZZ) WITH 'PLEASE CHECK AN ORDER TO DELETE'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHEN 'BACK'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LEAVE TO SCREEN 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    WHEN 'LOGOFF'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      LEAVE PROGRAM. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;    WHEN 'MODIFY'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        IF IT_ORD-CHK = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          MODIFY IT_ORD INDEX TC1-CURRENT_LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ENDIF. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or if u are dealing with more than 1 record during editing then u can use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     MODIFY IT_ORD WHERE CHK = 'X'. &lt;/P&gt;&lt;P&gt; &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDCASE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR OK_CODE. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMODULE.                 " USER_COMMAND_1000  INPUT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code will only modify the Internal table, u can now define a UPDATE button and then insert the following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;    WHEN 'UPDATE'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     MODIFY ZTAB FROM TABLE ITAB.&lt;/P&gt;&lt;P&gt; &amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here modify works in 2 ways&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this statement modifies records already existing in ZTABLE if its already there otherwise it inserts a new record into it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For deleting multiple records just enable multiple records selection in Table Control properties&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for inserting new records into the internal table u can make ur internal table into input mode enabled and then u can some button APPEND which will add records into it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;award points if found helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jan 2007 14:50:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-with-display-change-add-delete-function/m-p/1886499#M371803</guid>
      <dc:creator>rahulkavuri</dc:creator>
      <dc:date>2007-01-13T14:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Table Control with Display/Change/Add/Delete Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-with-display-change-add-delete-function/m-p/1886500#M371804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rahul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I should created a internal table you describe than make a a table control with this internal table.&lt;/P&gt;&lt;P&gt;After I put select criteria fields, just populate this internal table from database table and list on the screen table. Just maintain data in the screen table and modify the internal table before updating (insert/change/delete) the datbase table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But no matter the user press ENTER or not before press UPDATE( insert / change / delete), all data records on screen (or internal table) should be validated, if there is some error (article doesn't exist or articel type is invalid), there should be error message and user have to correct all errors before UPDATE can be committed actually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope what I describe make you sense.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks all&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Jan 2007 08:43:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/table-control-with-display-change-add-delete-function/m-p/1886500#M371804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-14T08:43:19Z</dc:date>
    </item>
  </channel>
</rss>

