‎2008 Jan 22 11:03 AM
Hi,
I have standard table with entries,Now my problem is deleting those entries(in QPCT) TABLE.How todelete and send some sample codes.
thank you very much in advance
‎2008 Jan 22 11:04 AM
- DELETE FROM dbtab WHERE cond.
DELETE FROM dbtab WHERE cond.
DELETE FROM (dbtabname) WHERE cond.
- DELETE dbtab.
DELETE *dbtab.
DELETE (dbtabname) ... .
- DELETE dbtab FROM TABLE itab.
DELETE (dbtabname) FROM TABLE itab.
- DELETE dbtab VERSION vers.
DELETE *dbtab VERSION vers.
‎2008 Jan 22 11:07 AM
But that is not work out mukesh.I applied already but the entries still existing
‎2008 Jan 22 11:14 AM
‎2008 Jan 22 11:14 AM
hi...
just copy all the entries in an internal table
and use delete (db) from table itab.
then it will work
‎2008 Jan 22 11:18 AM
REPORT ZDELETE.
tables: qpct.
PARAMETERS: p_Code like qpct-code .
DATA: BEGIN OF itab occurs 0,
katalogart TYPE qpct-katalogart,
codegrupee TYPE qpct-codegruppe,
code TYPE qpct-code,
END OF ITAB.
start-of-selection.
SELECT katalogart code CODEGRUPPE
FROM qpct
INTO TABLE itab
WHERE CODE = p_Code .
DELETE QPCT from table itab.
commit work.
‎2008 Jan 22 11:24 AM
Hi Ramakrishna,
There are 5 primary keys in table QPCT(KATALOGART,CODEGRUPPE,CODE,SPRACHE and VERSION). From the documentation of DELETE command it seems in your internal table all the primary keys should be present.
Variant 3
DELETE dbtab FROM TABLE itab.
DELETE (dbtabname) FROM TABLE itab.
Addition:
... CLIENT SPECIFIED
Effect
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.
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.
‎2008 Jan 22 11:33 AM
REPORT ZDELETE.
PARAMETERS: p_Code like qpct-code .
delete from qpct where code = p_Code.
this ll do.
‎2008 Jan 22 11:07 AM
yes,u can also delete the records from ur report itself.
TABLES SBOOK.
DELETE FROM SBOOK WHERE CARRID = 'LH' AND
CONNID = '0400' AND
FLDATE = '19950228'.
check this link to know more about delete operation
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/delete02.htm
also u can use.....
data : itab like dbtab occurs 0 with header line.
select * from dbtab into table itab.
delete dbtab from itab.
‎2008 Jan 22 11:34 AM
Hi,
You can do as below :
Go to SE11 --> Input the table name --> Display --> Select Utilities --> Database utility(Directly you can use SE14) --> Select Delete data Radio button --> And click Active and adjust database.
Thanks,
Sriram Ponna.