<?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: issue with delete in table control in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007516#M957335</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 following code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF &amp;lt;mark_field&amp;gt; = 'X'.&lt;/P&gt;&lt;P&gt;DELETE &amp;lt;table&amp;gt; INDEX syst-tabix.&lt;/P&gt;&lt;P&gt;MODIFY zctf_as400intpro FROM TABLE g_tc_as400intpro_itab.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&amp;lt;tc&amp;gt;-lines = &amp;lt;tc&amp;gt;-lines - 1.&lt;/P&gt;&lt;P&gt;ENDIF.&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;you have used an internal table name g_tc_as400intpro_itab. What does it contain?&lt;/P&gt;&lt;P&gt;Use &amp;lt;table&amp;gt; instead of g_tc_as400intpro_itab. I think it has the data to be modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it does not work, you can use the below logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a fieldsymbol (&amp;lt;fs&amp;gt;) of type any.&lt;/P&gt;&lt;P&gt;Move the key field of the table row to be deleted to this fieldsymbol.&lt;/P&gt;&lt;P&gt;assign component &amp;lt;keyfield&amp;gt; of structure &amp;lt;wa&amp;gt; to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;DELETE FROM zctf_as400intpro WHERE &amp;lt;keyfield&amp;gt; = &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Lakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jun 2008 16:06:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-10T16:06:06Z</dc:date>
    <item>
      <title>issue with delete in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007514#M957333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i had created table control for ztable.in  that table control i have added 2 pushbuttons (add and delete).whenever i hit 'add' the record shuld be added in the database table and whenever  i hit 'delete' selected records should be deleted in database also.add is working properly but delete is deleting records in table control but it is not deleting the records in database.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the code i had written for delete is as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; FORM fcode_delete_row&lt;/P&gt;&lt;P&gt;               USING    p_tc_name           TYPE dynfnam&lt;/P&gt;&lt;P&gt;                        p_table_name&lt;/P&gt;&lt;P&gt;                        p_mark_name   .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;SPWIZARD: BEGIN OF LOCAL DATA----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   DATA l_table_name       LIKE feld-name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   FIELD-SYMBOLS &amp;lt;tc&amp;gt;         TYPE cxtab_control.&lt;/P&gt;&lt;P&gt;   FIELD-SYMBOLS &amp;lt;table&amp;gt;      TYPE STANDARD TABLE.&lt;/P&gt;&lt;P&gt;   FIELD-SYMBOLS &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;   FIELD-SYMBOLS &amp;lt;mark_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;SPWIZARD: END OF LOCAL DATA----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   ASSIGN (p_tc_name) TO &amp;lt;tc&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;SPWIZARD: get the table, which belongs to the tc                     *&lt;/P&gt;&lt;P&gt;   CONCATENATE p_table_name '[]' INTO l_table_name. "table body&lt;/P&gt;&lt;P&gt;   ASSIGN (l_table_name) TO &amp;lt;table&amp;gt;.                "not headerline&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;SPWIZARD: delete marked lines                                        *&lt;/P&gt;&lt;P&gt;   DESCRIBE TABLE &amp;lt;table&amp;gt; LINES &amp;lt;tc&amp;gt;-lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   LOOP AT &amp;lt;table&amp;gt; ASSIGNING &amp;lt;wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;SPWIZARD: access to the component 'FLAG' of the table header         *&lt;/P&gt;&lt;P&gt;     ASSIGN COMPONENT p_mark_name OF STRUCTURE &amp;lt;wa&amp;gt; TO &amp;lt;mark_field&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     IF &amp;lt;mark_field&amp;gt; = 'X'.&lt;/P&gt;&lt;P&gt;       DELETE &amp;lt;table&amp;gt; INDEX syst-tabix.&lt;/P&gt;&lt;P&gt;       MODIFY zctf_as400intpro FROM TABLE g_tc_as400intpro_itab.&lt;/P&gt;&lt;P&gt;       IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;         &amp;lt;tc&amp;gt;-lines = &amp;lt;tc&amp;gt;-lines - 1.&lt;/P&gt;&lt;P&gt;       ENDIF.&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; ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 15:51:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007514#M957333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T15:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: issue with delete in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007515#M957334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MODIFY can be used instead of INSERT or UPDATE. You can't use it for DELETE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODIFY zctf_as400intpro FROM TABLE g_tc_as400intpro_itab.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you must use:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DELETE from zctf_as400intpro where (condition)
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;See the extract of the online help:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The MODIFY statement inserts one or several lines specified in source in the database table specified in target, or overwrites existing lines. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 16:03:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007515#M957334</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2008-06-10T16:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: issue with delete in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007516#M957335</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 following code,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF &amp;lt;mark_field&amp;gt; = 'X'.&lt;/P&gt;&lt;P&gt;DELETE &amp;lt;table&amp;gt; INDEX syst-tabix.&lt;/P&gt;&lt;P&gt;MODIFY zctf_as400intpro FROM TABLE g_tc_as400intpro_itab.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&amp;lt;tc&amp;gt;-lines = &amp;lt;tc&amp;gt;-lines - 1.&lt;/P&gt;&lt;P&gt;ENDIF.&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;you have used an internal table name g_tc_as400intpro_itab. What does it contain?&lt;/P&gt;&lt;P&gt;Use &amp;lt;table&amp;gt; instead of g_tc_as400intpro_itab. I think it has the data to be modified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it does not work, you can use the below logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create a fieldsymbol (&amp;lt;fs&amp;gt;) of type any.&lt;/P&gt;&lt;P&gt;Move the key field of the table row to be deleted to this fieldsymbol.&lt;/P&gt;&lt;P&gt;assign component &amp;lt;keyfield&amp;gt; of structure &amp;lt;wa&amp;gt; to &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;DELETE FROM zctf_as400intpro WHERE &amp;lt;keyfield&amp;gt; = &amp;lt;fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will solve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Lakshmi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jun 2008 16:06:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007516#M957335</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-10T16:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: issue with delete in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007517#M957336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i hav field mark in tc control where as it is not there in dbtab.based on mark i am able to delete table control records but i m unable to delete those records from dbtable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to do this?can anyone plz help me out in this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 07:41:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007517#M957336</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T07:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: issue with delete in table control</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007518#M957337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi NEED HELP  ,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to read the marked record from the table control. then use the values of the key fields of the record read  for giving condition in the Delete Query, as specified in previous threads&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sarath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2008 09:21:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-delete-in-table-control/m-p/4007518#M957337</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-11T09:21:18Z</dc:date>
    </item>
  </channel>
</rss>

