<?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 regarding deleting data from database table in  module pool in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018737#M412913</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 using table control for showing multiple data in the o/p screen , i have two buttons display and delete.&lt;/P&gt;&lt;P&gt;display button is working fine...but for deletion purpose what i want is on selecting any row in table control  if i press delete button then the data will be deleted from database table as per row's data. plz help me regarding this how will i do this plz help me with codes.&lt;/P&gt;&lt;P&gt;i m using lfa1 table for displaying fields on the table control...what sud i write in w/selcolumn.&lt;/P&gt;&lt;P&gt;thnx in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        ravi gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Mar 2007 05:42:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-20T05:42:07Z</dc:date>
    <item>
      <title>regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018737#M412913</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 using table control for showing multiple data in the o/p screen , i have two buttons display and delete.&lt;/P&gt;&lt;P&gt;display button is working fine...but for deletion purpose what i want is on selecting any row in table control  if i press delete button then the data will be deleted from database table as per row's data. plz help me regarding this how will i do this plz help me with codes.&lt;/P&gt;&lt;P&gt;i m using lfa1 table for displaying fields on the table control...what sud i write in w/selcolumn.&lt;/P&gt;&lt;P&gt;thnx in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        ravi gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 05:42:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018737#M412913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T05:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018738#M412914</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;&lt;/P&gt;&lt;P&gt;i think in the table control u are displaying some of the fields of the data base table.&lt;/P&gt;&lt;P&gt;so if u try to delete that row from DBtable means it will search for the records which is having the records with values same as the table ctrl selected line and all other fields(which u didn't display) in the DBtable are null values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 05:50:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018738#M412914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T05:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018739#M412915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First u will have to maintain OK-Code for the delete button . In the PAI event of the screen you should write this .&lt;/P&gt;&lt;P&gt;The table control should be with selection column .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WHEN 'OK-CODE'.&lt;/P&gt;&lt;P&gt;Delete itab where sel = 'X'.(Sel is the column which u have selected).&lt;/P&gt;&lt;P&gt;Modify dbtab from itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 05:54:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018739#M412915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T05:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018740#M412916</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 the attributes of the table control, enable w/selcolumn and give a name for it..in your itab (which you are displaying in the table control), have a field mark of character type...when a row is selected in the table control, the field mark will be set to X...in the PAI of the user command delete button, write something like this..&lt;/P&gt;&lt;P&gt;case sy-ucomm.&lt;/P&gt;&lt;P&gt;when 'DELE'.&lt;/P&gt;&lt;P&gt;loop at itab where mark = 'X'&lt;/P&gt;&lt;P&gt;delete ztable where primary key eq itab-key..&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endcase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this program  DEMO_DYNPRO_TABCONT_LOOP_AT exactly does what you are looking for...have a look at this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if helpful, reward.&lt;/P&gt;&lt;P&gt;Sathish. R&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 05:58:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018740#M412916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T05:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018741#M412917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sathish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this statement is showing error,"delete ztable where primary key eq itab-key.."&lt;/P&gt;&lt;P&gt;plz help me,,i have to delete the data from lfa1 table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;null&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 06:08:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018741#M412917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T06:08:20Z</dc:date>
    </item>
    <item>
      <title>Re: regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018742#M412918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write this in PAI - Module &lt;/P&gt;&lt;P&gt; LOOP AT itab.&lt;/P&gt;&lt;P&gt;MODIFY itab index t300-current_line.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write this in PAI - User-command&lt;/P&gt;&lt;P&gt;  WHEN 'DELETE'.&lt;/P&gt;&lt;P&gt;      LOOP AT itab.&lt;/P&gt;&lt;P&gt;        IF itab-sel = 'X'.&lt;/P&gt;&lt;P&gt;                 APPEND itab TO iDel.&lt;/P&gt;&lt;P&gt;          DELETE &amp;lt;dbtabname&amp;gt; from table iDel .&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;hope this helps.&lt;/P&gt;&lt;P&gt;regds,&lt;/P&gt;&lt;P&gt;Seema&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 06:09:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018742#M412918</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T06:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018743#M412919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete from ztable where field1 = itab-field1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 06:10:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018743#M412919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T06:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018744#M412920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ravi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for deletion of row what you can do is that,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;**you can change the logic as per your requirement as this is just a psudocode to expalin you the logic&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
**FLOW LOGIC
MODULE CHECK_BUTTON_PRESS

you must be having a F-CODE for the delete button say 'DEL'. 
in the PAI module check for the DEL button pressed in CASE condition.

WHEN 'DEL'.
    MOVE 'X' TO DEL_FLAG.
**here only set the delete flag and check it later.
**end of module check_button_press.

FLOW LOGIC:
loop at internal table used for the table control say TBL_OUT
LOOP AT TBL_OUT.

FIELD: TBL_OUT-MARK 
              MODULE DELETE_DATA_FROM_DB.

ENDLOOP.

**module DELETE_DATA_FROM_DB

IF TBL_OUT-MARK = 'X' AND DEL_FLAG = 'X'.

*here you can get the primary key(s) field and then using that key delete the data from the database table as deleting records with the help of primary key will assure you that only 1 record is deleted.

ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**NOTE: for this logic to work find you need to select the lines to be deleted on the table control.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this is helpful to you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kunjal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 06:16:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018744#M412920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T06:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018745#M412921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can create a delete button using the menu painter and in the code you can give the delete statement as per your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 06:19:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018745#M412921</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T06:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: regarding deleting data from database table in  module pool</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018746#M412922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thnx for urs suggestion ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2007 10:21:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-deleting-data-from-database-table-in-module-pool/m-p/2018746#M412922</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-20T10:21:59Z</dc:date>
    </item>
  </channel>
</rss>

