2009 Dec 21 2:12 PM
Hi experts,
I have a requirement in which I need to delete the data of 1st table based on the data from the 2nd table.
Its like:
1st internal table has the following entries:
GT_T001W
MTES
Z001
Z002
Z003
Z004
Z005
ZREF
ZTST
2nd internal table has the following entries:
Gt_mard
14 M004 000000000000276001 1000 9987.990
15 M002 000000000000276003 1000 6.000
16 M004 000000000000276003 1000 3.600
17 Z003 000000009800000635 1001 100.000-
Now I want that in GT_MARD, all the entries except the common one (Z003) should be deleted.
How do I do this?
Thanks,
Ajay.
2009 Dec 21 2:16 PM
Hi
Loop at GT_T001W .
Read table Gt_mard with key MTES = gt_t001w-mtes.
If sy-subrc = 0.
delete gt_mard index sy-tabix.
endif.
Endloop.
Try this .. this will work.
Regards,
Raghu.
Hi
Loop at GT_T001W .
Read table Gt_mard with key MTES = gt_t001w-mtes.
If sy-subrc = 0.
delete gt_mard index sy-tabix.
endif.
Endloop.
Try this .. this will work.
Regards,
Raghu.
2009 Dec 21 2:16 PM
Hi
Loop at GT_T001W .
Read table Gt_mard with key MTES = gt_t001w-mtes.
If sy-subrc = 0.
delete gt_mard index sy-tabix.
endif.
Endloop.
Try this .. this will work.
Regards,
Raghu.
2010 Mar 03 5:49 PM
Hi
The above code will not work properly.
Your check for subrc is ok But if it is true, then it deletes the entries which is common to both the tables which is not the requirement.
PLease clarify
BR
Jerry
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |