2008 Jun 19 5:37 AM
Hi
I have 2 int tables called it_final and it_z1log1.
I want to delete the records from it_final using it_z1log1.
following statement is going to dump. Both table has same structure
if it_z1log1[] is not initial.
delete it_final from it_z1log1.
endif.
2008 Jun 19 5:41 AM
Hi,
Try like this...
Loop at it_final .
read table it_z1log1 with key xyz = it_final-xyz.
if sy-subrc = 0.
delete it_final.
continue.
endif.
Endloop.Regards,
Vrithika
Hi
I have 2 int tables called it_final and it_z1log1.
I want to delete the records from it_final using it_z1log1.
following statement is going to dump. Both table has same structure
if it_z1log1[] is not initial.
delete it_final from it_z1log1.
endif.
2008 Jun 19 5:39 AM
hi,
Use like this.
loop at itab1 into wa.
delete itab2 from wa.
endloop.
Regards,
Subramanian
2008 Jun 19 5:40 AM
hi.....
is there any field mismatch.....just check.....whats the dump which you are getting.
check the character lenth of variables in oth the structures.
2008 Jun 19 5:41 AM
Hi,
How you want to delete ?
is that using the whole record
do following way
loop at itab1 into wa.
delete table itab2 from wa.
endloop.
2008 Jun 19 5:41 AM
Hi,
Try like this...
Loop at it_final .
read table it_z1log1 with key xyz = it_final-xyz.
if sy-subrc = 0.
delete it_final.
continue.
endif.
Endloop.Regards,
Vrithika
2008 Jun 19 5:42 AM
loop at it_final into wa_final.
v_tabix = sy-tabix.
read table it_zlog1 into wa_zlog1 with key field1 = wa_final-field1.
if sy-subrc eq 0.
delete it_final index v_tabix.
endif.
endloop.Regards
Kannaiah
2008 Jun 19 5:43 AM
Hi Kumar,
Your question is quite incomplete.. What I have understood is that you want to delete the table IT_FINAL based on the table it_z1log1.
What you have to do is
data: tabix type sy-tabix.
Loop at it_final.
tabix = sy-tabix.
Read table it_z1log1 with key = <key val>.
if sy-subrc = 0.
delete it_final index tabix.
endif.
Endloop.
2008 Jun 19 5:44 AM
Hi,
Does your internal tables have work area. If yes then it will delete only the entry present in the work area. Else write :
delete it_final[] from it_z1log1[].
This should work, Give it a try.
Regards,
Lalit Kabra
2008 Jun 19 5:46 AM
use
loop at itab1 where itab1-value eq ' '.
loop at itab2.
delete itab2
..........
.............
nested loops
with where conditions
2008 Jun 19 5:53 AM
hi,
see below example
DATA : it_kna1 TYPE TABLE OF kna1 WITH HEADER LINE,
it_kna2 TYPE TABLE OF kna1 WITH HEADER LINE.
SELECT * FROM kna1 INTO TABLE it_kna1 UP TO 10 ROWS.
SELECT * FROM kna1 INTO TABLE it_kna2 UP TO 30 ROWS.
LOOP AT it_kna1 . " you can use where condition also with the loop
DELETE TABLE it_kna2 FROM it_kna1.
ENDLOOP.
LOOP AT it_kna1.
WRITE : / it_kna1-kunnr.
ENDLOOP.
SKIP.
write : 'SECOND TABLE'.
LOOP AT it_kna2.
WRITE 😕 it_kna2-kunnr.
ENDLOOP.
regards
prasanth
2008 Jun 19 5:56 AM
Hi,
We cannot delete internal table form other internal table , we can delete the contents on internal table from workarea.
Create a workarea for it_z1log1, example wa_it_z1log1.
Loop at it_final.
Read table it_z1log1 into wa_it_z1log1 with key abc = it_final-abc.
If sy-subrc eq 0.
Delete it_final from wa_it_z1log1.
Endif.
Endloop.This will surely work.
Plz rewardi if useful.
Thanks,
Dhanashri.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |