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

dlete from db table

Former Member
0 Likes
1,105

hi gurus,

how can i delete records from database table from work area which is not compatable i.e, the work area has not all the fields of db table.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,076

for deleting records from Db table u can directly do it via sm30 or se 11. no need for work area to delete DB table.

if this is not the answer u r lookinf for then elaborate ur question.

10 REPLIES 10
Read only

Former Member
0 Likes
1,077

for deleting records from Db table u can directly do it via sm30 or se 11. no need for work area to delete DB table.

if this is not the answer u r lookinf for then elaborate ur question.

Read only

h_senden2
Active Contributor
0 Likes
1,076

DELETE FROM table WHERE condition.

where the condition is the primary key for instance

regards,

Hans

Read only

Former Member
0 Likes
1,076

HI Venu,

Yes you can but, 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.

Thanks,

Chidanand

Read only

Former Member
0 Likes
1,076

Actually my requirement is i have values for four fields in work area using that i can delete the records from db table

if i use 'delete db from wa' it says incomptable becouse wa has only 4 fields

how i can i delete the records from db table

Read only

0 Likes
1,076

First and Foremost...

PLEASE mention if its a standard table or a Custom table who's entries you want deleted.

Surprising, even those who replied to your query did not bother finding this out .

pk

Read only

0 Likes
1,076

I need to delete from database table

Read only

0 Likes
1,076

Sweet!!

Read only

Former Member
0 Likes
1,076

Hi,

write the following code in se38.

DELETE FROM table WHERE condition.

where condition u have to give the primary key.

Thanks & regards.

Y.R.Prem Kumar

Read only

Former Member
0 Likes
1,076

Hi

If the WA and table have different structure, then you need to read the table using the wa fields. Using the WA from read

you can delete the table.

or if you are deleting inside the loop,do like this way

LOOP ITAB into wa_itab.

get the sy-tabix.

check wa_itab 4 fields with your wa 4 fields.

if sy-subrc = 0.

delete itab using the tabix.

endloop.

Regards,

R

Read only

Former Member
0 Likes
1,076

Hello,

Please take care while deleting a entry from a DBASE table that the primary key in your work area and dbase table should match as Chidanand has mentioned earlier.

If a maintanence view exist for the table then better delete the entry from there.

Thanks,

Jayant