Application Development 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: 

hi all -- gurus- abap

Former Member
0 Kudos
95

hi

i have 5 records in itab_del internal table after the endloop.

now i have to delete the ztable records that is matching with itab_del table and for that i have written following code after endloop.

ITAB_DEL = ITAB_DEL3.

append ITAB_DEL.

clear ITAB_DEL.

endloop.

DELETE Ztable FROM table ITAB_DEL.

but ztable records are not deleting although 5 records are matching.

is my syntax wrong ? what is the issue ???

pl help.

thanx in advance

rocky

5 REPLIES 5

Former Member
0 Kudos
69

hi,

Use this Statement

DELETE Ztable FROM table ITAB_DEL.

Commit Work.

Thanks

Yogesh

former_member210123
Active Participant
0 Kudos
69

in your code u r clearing the contents of the internal table.So the internal table is empty.So remove that line clear_itab_del.

and try it will work.

There are no issues with syntax.

Former Member
0 Kudos
69

Hi rocky,

ITAB_DEL = ITAB_DEL3.
append ITAB_DEL.
clear ITAB_DEL.
endloop.

DELETE Ztable FROM table ITAB_DEL.

You are trying to deleting the records after clearing the ITAB_DEL work area. So modify your coding as below.

ITAB_DEL = ITAB_DEL3.
append ITAB_DEL.
clear ITAB_DEL.
endloop.

loop at itab_del.
DELETE Ztable FROM table ITAB_DEL.
endloop.

I hope it may help you. If you still facing the problem feel free to contact me . And dont forget reward points.

Regards,

Sreenivasa Sarma K.

Former Member
0 Kudos
69

Hi,

LOOP AT itab_del.

select fields for ztabe where xxx = itab_del .....

IF sy-subrc eq 0.

DELETE FROM ZTABLE WHERE xxxx = itab_del-xxx.

endif.

ENDLOOP.

Former Member
0 Kudos
69

Please check if the client field(MANDT) is the first field in the

internal table.(If ZTABLE also has MANDT field)