2008 Feb 19 9:20 AM
i have a report with some fields..
i want to delete the records where few fields are coming with zero values,,,
how can i remove the entire record where the field has zero values
i have a report with some fields..
i want to delete the records where few fields are coming with zero values,,,
how can i remove the entire record where the field has zero values
2008 Feb 19 9:23 AM
Hello Swetha,
If the records are availble in an internal table. YOu can delete the records based upon the condition before displaying.
Do like this:
DELETE IT_TC01 WHERE WTG001 LE 0
AND MEG001 LE 0.
" Here from the table IT_TC01 records will be deleted will WTG001 or MEG001 is initial.
Hope this will solve ur issue.
Cheers,
Vasanth
2008 Feb 19 9:24 AM
Hi,
Using the statement DELETE.
DELETE itab WHERE <Logical expression>.
Rgds,
Bujji
2008 Feb 19 9:24 AM
Hi,
Try this...
Delete itab where f1 = 0 and f2 = 0 and f3 = 0.
or..
Loop at itab into istab.
if f1 = 0 and f2 = 0 and f3 = 0.
istab-flag = 'X'.
modify itab from istab index sy-tabix transporting flag.
endif.
delete itab where flag = 'X'.
Regards....
2008 Feb 19 9:26 AM
Hi,
Suppose ur internal table has 10 fields and u want to delete all the records for which either field1 or field2 is zero, Then do like this.
SORT itab BY field1 field2.
DELETE itab WHERE field1 EQ 0
OR field2 EQ 0.
If u want to delete only if both the fields are 0 then just give AND instead of OR.
SORT itab BY field1 field2.
DELETE itab WHERE field1 EQ 0
AND field2 EQ 0.
Thanks,
Vinod.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |