Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

TABLE

Former Member
0 Likes
879

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

9 REPLIES 9
Read only

Former Member
0 Likes
856

- 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.

Read only

0 Likes
856

But that is not work out mukesh.I applied already but the entries still existing

Read only

0 Likes
856

Send your code

Read only

0 Likes
856

hi...

just copy all the entries in an internal table

and use delete (db) from table itab.

then it will work

Read only

0 Likes
856

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.

Read only

0 Likes
856

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.

Read only

0 Likes
856

REPORT ZDELETE.

PARAMETERS: p_Code like qpct-code .

delete from qpct where code = p_Code.

this ll do.

Read only

Former Member
0 Likes
856

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.

Read only

Former Member
0 Likes
856

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.