<?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: DELETE FROM ZTABLE in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461908#M217909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use COMMITWORK AND WAIT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Jul 2006 09:40:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-04T09:40:01Z</dc:date>
    <item>
      <title>DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461904#M217905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT * FROM ZTABLE INTO TABLE it_table1.&lt;/P&gt;&lt;P&gt;DELETE ZTABLE FROM TABLE it_table1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:36:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461904#M217905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T09:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461905#M217906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SORRY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;imade this and it's not deleteing the table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:37:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461905#M217906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T09:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461906#M217907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Whats the query?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:38:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461906#M217907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T09:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461907#M217908</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;Check this syntax :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variants: &lt;/P&gt;&lt;P&gt;1. DELETE FROM  dbtab. or &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;DELETE FROM (dbtabname). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. DELETE  dbtab      FROM wa. or &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;DELETE (dbtabname) FROM wa. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. DELETE  dbtab      FROM TABLE itab. or &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;DELETE (dbtabname) FROM TABLE itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. DELETE  dbtab. or &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;DELETE *dbtab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. DELETE  dbtab VERSION vers. or &lt;/P&gt;&lt;P&gt;    &lt;/P&gt;&lt;P&gt;DELETE *dbtab VERSION vers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Deletes a set of lines in a database table (see relational database). You can specify the name of the database table either directly in the program in the form DELETE FROM dbtab ... or at runtime as the contents of the variable dbtabname in the form DELETE FROM (dbtabname) .... In both cases, the database table must be known to the ABAP Dictionary. By default, the system deletes only data from the current client. You can only use a view to delete data, if the view refers to a single table and was created in the ABAP Dictionary with the maintenance status "no restriction". &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE is part of the OPEN SQL command set. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs.See Open SQL and Unicode. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;Authorization checks are not supported by the DELETE statement and must be carried out at program level. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you delete lines using the DELETE command, the process is only complete after a database commit (see LUW). Before the commit, any database change can be reset using a database rollback (see Programming Transactions). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In dialog systems, synchronizing parallel user access to a single dataset cannot be handled by the locking mechanism of the database system alone. In many cases, you therefore have to use the SAP locking mechanism. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 1 &lt;/P&gt;&lt;P&gt;DELETE FROM  dbtab. or &lt;/P&gt;&lt;P&gt;DELETE FROM (dbtabname).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extras: &lt;/P&gt;&lt;P&gt;1. ... WHERE condition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ... CONNECTION con &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Deletes lines in a database table. If you do not specify a WHERE clause, the system deletes all lines (in the current client). If you specify a WHERE clause, the system deletes all lines that fulfill the WHERE condition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the statement is executed, the system field SY-DBCNT contains the number of lines that were deleted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Return Code is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;At least one line was deleted. &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;No line was deleted since no lines were selected. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Delete all flight bookings (in the current client): &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE FROM SBOOK. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... WHERE condition &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The system deletes only those lines that fullfill the&lt;/P&gt;&lt;P&gt;condition specified in the WHERE Clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Delete all bookings of Lufthansa flight 0400 on 02/28/2001 (in the current client): &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE FROM SBOOK WHERE CARRID = 'LH'       AND &lt;/P&gt;&lt;P&gt;                        CONNID = '0400'     AND &lt;/P&gt;&lt;P&gt;                        FLDATE = '20010228'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Switches off automatic client handling. This allows you&lt;/P&gt;&lt;P&gt;to delete data across all clients in case of client-specific tables. The client field is then handled like a normal table field for which you can specify appropriate conditions in the WHERE clause. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The addition CLIENT SPECIFIED must be specified directly after the name of the database table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 3 &lt;/P&gt;&lt;P&gt;... CONNECTION con &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;The Open SQL command is not executed on the&lt;/P&gt;&lt;P&gt;standard database but on the Secondary Database Connection specified using con. con is the name of the database connection as it was specified in the table DBCON in the column CON_NAME. The database connection con can als be specified dynamically in the form (source_text) - the field source_text contains the name of the database connection and must be type C or STRING. &lt;/P&gt;&lt;P&gt;The CONNECTION con addition must be specified directly after the name of the database table or after the CLIENT SPECIFIED addition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 2 &lt;/P&gt;&lt;P&gt;DELETE  dbtab      FROM wa. or &lt;/P&gt;&lt;P&gt;DELETE (dbtabname) FROM wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extras: &lt;/P&gt;&lt;P&gt;1. ... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... CONNECTION con &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;These are SAP-specific short forms to delete a single line from a database table. The primary key for the line to be deleted is taken from the explicitly specified work area wa. The key values are read from left to right according to the structure of the primary key of the database table. The structure of wa is not considered. This is why the work area wa must be at least as wide (DATA) as the primary key of the database table dbtab, and the alignment of the work area wa must correspond to that of the database table. Otherwise, a runtime error occurs. &lt;/P&gt;&lt;P&gt;If the database table dbtab or the work area wa contain strings, wa must be compatible with the line structure of dbtab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the statement is executed, the sytem field SY-DBCNT contains the number of lines that were deleted (0 or 1). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Return Code is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;The line was deleted. &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;No line could be deleted since there was no line with the primary key specified. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Delete the booking with the booking number 3 of Lufthansa flight 0400 on 02/28/2001 (in the current client): &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA wa TYPE sbook. &lt;/P&gt;&lt;P&gt;wa-carrid = 'LH'. &lt;/P&gt;&lt;P&gt;wa-connid = '0400'. &lt;/P&gt;&lt;P&gt;wa-fldate = '20010228'. &lt;/P&gt;&lt;P&gt;wa-bookid = '00000003'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE sbook FROM wa. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;As in variant 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... CONNECTION con &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;As in variant 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 3 &lt;/P&gt;&lt;P&gt;DELETE  dbtab      FROM TABLE itab. &lt;/P&gt;&lt;P&gt;DELETE (dbtabname) FROM TABLE itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extras: &lt;/P&gt;&lt;P&gt;1. ... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... CONNECTION con &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Deletes sets: All lines of the database table for which the internal table itab contains values for the fields of the primary key are deleted. The lines of the internal table itab must fulfill the same conditions as the work area wa in variant 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system field SY-DBCNT contains the number of lines that were deleted, that is, the number of lines in the internal table itab for whose key values lines existed in the database table dbtab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Return Code is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;All lines in itab could be used for deleting lines in dbtab. &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;For at least one line of the internal table, the database table did not contain a line with the same primary key. All lines found were deleted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If the internal table itab is empty, SY-SUBRC and SY-DBCNT are set to 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 1 &lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;As in variant 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition 2 &lt;/P&gt;&lt;P&gt;... CONNECTION con &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;As in variant 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 4 &lt;/P&gt;&lt;P&gt;DELETE  dbtab. or &lt;/P&gt;&lt;P&gt;DELETE *dbtab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition: &lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas.See Cannot Use Short Forms and Cannot Use * Work Areas. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;This variant is obsolete. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;These are the SAP-specific short forms of variant 2. They work like variant 2 but the work area is not specified explicitly. Instead, the table work area dbtab or *dbtab is implicitly used which is declared with a TABLES statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE  dbtab. or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE *dbtab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is also equivalent to &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE dbtab FROM  dbtab. or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE dbtab FROM *dbtab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the statement is executed, the system field SY-DBCNT contains the number of lines that were deleted (0 or 1). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Return Code is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;The line was deleted. &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;No line could be deleted since no line with the primary key specified existed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example &lt;/P&gt;&lt;P&gt;Delete the booking with the booking number 3 of Lufthansa flight 0400 on 02/28/2001 (in the current client): &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES sbook. &lt;/P&gt;&lt;P&gt;sbook-carrid = 'LH'. &lt;/P&gt;&lt;P&gt;sbook-connid = '0400'. &lt;/P&gt;&lt;P&gt;sbook-fldate = '20010228'. &lt;/P&gt;&lt;P&gt;sbook-bookid = '00000003'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE sbook. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If you do not explicitly specify a work area, the values for the line to be deleted are taken from the table work area dbtab even if the statement occurs in a subroutine (FORM) or function module (FUNCTION), in which the table work area is obscured by an identically named formal parameter or local variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition &lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;As in variant 1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variant 5 &lt;/P&gt;&lt;P&gt;DELETE  dbtab VERSION vers. &lt;/P&gt;&lt;P&gt;DELETE *dbtab VERSION vers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This variant is not allowed in an ABAP Objects context.See Cannot use the VERSION Addition. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;This variant has become obsolete since the variants 1 - 3 allow you to specify the database table name dynamically. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Deletes a line in a database table whose name is taken from the field vers at runtime. The database table must be known to the ABAP Dictionary, and its name must comply with the following naming convention: The name must begin with a 'T' and may contain at most five characters, including the leading 'T'. The field vers must contain the table name without the leading 'T'. The system deletes only lines in the current client. The line to be deleted is taken from the statically specified table work area dbtab or *dbtab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Return Code is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;The line was deleted. &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;No line could be deleted since no line with the primary key specified existed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additional help &lt;/P&gt;&lt;P&gt;Deleting Table Lines &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Laxman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:39:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461907#M217908</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-07-04T09:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461908#M217909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use COMMITWORK AND WAIT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:40:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461908#M217909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T09:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461909#M217910</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;Where's the problem?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also write:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DELETE FROM ZTABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you don't need to upload the data in an internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But If I believe this statament can be used without WHERE condition only from release 4.7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:40:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461909#M217910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T09:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461910#M217911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DELETE ZTABLE.&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Ravikumar Allampallam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:42:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461910#M217911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T09:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461911#M217912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) I believe, &amp;lt;b&amp;gt;it_table1&amp;lt;/b&amp;gt; should have the primary key fields of the table. Can you try by adding those to internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rgds,&lt;/P&gt;&lt;P&gt;TM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Thomas Mann&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:42:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461911#M217912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T09:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461912#M217913</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT * FROM ZTABLE INTO TABLE it_table1.&lt;/P&gt;&lt;P&gt;DELETE ZTABLE FROM TABLE it_table1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the above should work , provided the type of itab it_table1 is same as ZTABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:46:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461912#M217913</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2006-07-04T09:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461913#M217914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i get the statment into is missing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:47:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461913#M217914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T09:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461914#M217915</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;DATA: IT_TABLE1 LIKE TABLE OF ZTABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM ZTABLE INTO TABLE it_table1.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;DELETE ZTABLE FROM TABLE it_table1.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;WRITE: 'Delete data from ZTABLE'.&lt;/P&gt;&lt;P&gt;COMMIT WORK AND WAIT.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;WRITE 'No data in ZTABLE'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 09:57:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461914#M217915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T09:57:20Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461915#M217916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DELETE dbtab FROM TABLE itab. &lt;/P&gt;&lt;P&gt;DELETE (dbtabname) FROM TABLE itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... CLIENT SPECIFIED &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;Mass deletion: Deletes all database table lines for which the internal table itab contains values for the primary key fields. The lines of the internal table itab must satisfy the same condition as the work area wa in addition 1 to variant 2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The system field SY-DBCNT contains the number of deleted lines, i.e. the number of lines of the internal table itab for whose key values there were lines in the database table dbtab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The return code is set as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SY-SUBRC = 0: &lt;/P&gt;&lt;P&gt;All lines from itab could be used to delete lines from dbtab. &lt;/P&gt;&lt;P&gt;SY-SUBRC = 4: &lt;/P&gt;&lt;P&gt;For at least one line of the internal table in the database table, there was no line with the same primary key. All found lines are deleted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;If the internal table itab is empty, SY-SUBRC and SY-DBCNT are set to 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regads,&lt;/P&gt;&lt;P&gt;Ramesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 10:31:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461915#M217916</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T10:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461916#M217917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi liat, I am not getting you exactly what u want ? Do u want to delete the table from the database or u wanna delete all rows in the table?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 11:00:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461916#M217917</guid>
      <dc:creator>jwalithtatikonda2</dc:creator>
      <dc:date>2006-07-04T11:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461917#M217918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI liat,&lt;/P&gt;&lt;P&gt;           If u want to delete u'r Z table from DB goto se14, enter u'r db table name n select "table" radio button and press enter, then u'll find a button below as "Delete Database Table".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 11:04:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461917#M217918</guid>
      <dc:creator>jwalithtatikonda2</dc:creator>
      <dc:date>2006-07-04T11:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461918#M217919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Liat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this code. Check for SY-SUBRC after &lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;COMMIT WORK AND WAIT&amp;lt;/b&amp;gt; .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: it_table1 TYPE STANDARD TABLE OF ztable.

SELECT * FROM ztable INTO TABLE it_table1.

IF sy-subrc EQ 0.

  DELETE ztable FROM TABLE it_table1.

  IF sy-subrc EQ 0.

    COMMIT WORK AND WAIT.
    
    IF sy-subrc EQ 0.
      MESSAGE 'Database table deletion successful' TYPE 'S'.
    ENDIF.
    
  ENDIF.

ELSE.

  MESSAGE 'No records exists' TYPE 'E'.
  
ENDIF.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Arun Sambargi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Arun Sambargi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 11:32:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461918#M217919</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T11:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE FROM ZTABLE</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461919#M217920</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;DELETE ZTABLE FROM TABLE it_table1.&lt;/P&gt;&lt;P&gt;COMMIT WORK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regs,&lt;/P&gt;&lt;P&gt;Venkat Ramanan N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Jul 2006 11:39:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/delete-from-ztable/m-p/1461919#M217920</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-04T11:39:11Z</dc:date>
    </item>
  </channel>
</rss>

