‎2008 Jun 05 10:55 AM
hi experts,
can u plz send me a simple code to delete data from z table.
regards,
raman
‎2008 Jun 05 10:57 AM
Hello.
Use statement: DELETE FROM ztable WHERE ....
Regards.
Valter Oliveira.
‎2008 Jun 05 10:58 AM
Hi Raman,
Yes, Above answer is correct. We can use DELETE command for deleting records.
Regards,
Kumar.
‎2008 Jun 05 10:59 AM
Have you ever thought about pressing the F1 key on the keyword DELETE.
OR IS THAT TO EASY FOR YOU TO DO.
‎2008 Jun 05 10:59 AM
DELETE { {FROM target (WHERE sql_cond)}
| {target FROM source} }.
Effect
The statement DELETE deletes one or more rows from the database table specified in target. The rows that are to be deleted are specified either in a WHERE condition sql_cond or with data objects in source.
System Fields
The statement DELETE sets the values of the system fields sy-subrc and sy-dbcnt.
sy-subrc Meaning
0 A least one row was deleted.
4 At least one row could not be deleted, since it was not found in the database table.
Syntax
... WHERE sql_cond.
Effect
The WHERE addition uses a logical expression sql_cond to specify which rows in the database table are deleted. The same applies to the logical expression sql_cond as for the WHERE condition of the SELECT statement. If there is no row in the database that satisfies the WHERE condition, no row is deleted and sy-subrc is set to 4. If no WHERE condition is specified, all rows are deleted.
... FROM wa|{TABLE itab}.
Alternatives:
1. ... FROM wa
2. ... FROM TABLE itab
Effect
After FROM, you can specifiy a data object wa that is not table-type or an internal table itab. The content of the data objects determines the row(s) to be deleted.
thanks
Reward If useful
richa
‎2008 Jun 05 11:00 AM
‎2008 Jun 05 11:00 AM
please use search help which already given by SDN.
I gave Delete database entry i got my answer.
please close this thread by giving mark.
Amit.
‎2008 Jun 05 11:02 AM
DELETE { {FROM target [WHERE sql_cond]}
| {target FROM source} }.
Example :
PARAMETERS p_carrid TYPE sflight-carrid.
DELETE FROM sflight
WHERE carrid = p_carrid AND
fldate = sy-datum AND
seatsocc = 0.
PARAMETERS p_carrid TYPE sflight-carrid.
TYPES: BEGIN OF sflight_key,
mandt TYPE sflight-mandt,
carrid TYPE sflight-carrid,
connid TYPE sflight-connid,
fldate TYPE sflight-fldate,
END OF sflight_key.
DATA sflight_key_tab TYPE TABLE OF sflight_key.
SELECT carrid connid fldate
FROM sflight
INTO CORRESPONDING FIELDS OF TABLE sflight_key_tab
WHERE carrid = p_carrid AND
fldate = sy-datum AND
seatsocc = 0.
DELETE sflight FROM TABLE sflight_key_tab.
if any other probs do let us know..