07-03-2007 11:36 PM
Hello All,
I am trying to delete the records if the value is less than zero.
IF it_tab-rhrs < 0 .
DELETE it_tab INDEX p_tabix.
ENDIF.
but its not deleting those records, still its displaying -ve values.
Points are rewarded.
thx.
~R
07-03-2007 11:38 PM
Are you in a loop? What is the type of the field "rhrs"? It should be number type.
You can simply use the following syntax.
DELETE it_tab WHERE rhrs < 0.
07-03-2007 11:38 PM
Are you in a loop? What is the type of the field "rhrs"? It should be number type.
You can simply use the following syntax.
DELETE it_tab WHERE rhrs < 0.
07-03-2007 11:56 PM
Im in loop and i took rhrs as CHAR type.
Basically im doing plant maintenance and trying to calculate Remaning works hours based on planned hours and actual hours.
it_tab-rhrs = it_tab-arbei - it_tab-ismnw.
if it_tab < 0.
i want to delete whole record.
thx.
~R
07-04-2007 12:14 AM
Hi Raghu,
What is data type it_tav-rhrs ?
IF it_tab-rhrs < 0 .
delete table it_tab iNDEX p_tabix.-> use like this
ENDIF.
Thanks
seshu
07-04-2007 12:22 AM
Hi,
I hope following code will solve your problem.
If you are not in a LOOP, then as Srinivas has said
DELETE it_tab WHERE rhrs < 0.
But, if you are in a LOOP, then
IF it_tab-rhrs < 0.
DELETE it_tab INDEX sy-tabix.
ENDIF.
<b>OR</b>
IF it_tab-rhrs CS '-'.
DELETE it_tab INDEX sy-tabix.
ENDIF.
Reward points if the answer is helpful.
Regards,
Mukul