2006 Sep 14 6:59 AM
Hi,
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
.
.
endloop.
In above code how to find number of records selected fulfilling condition.
This I want to check within a loop and not after the endloop.
Thanks,
Pratibha.
2006 Sep 14 7:10 AM
Hi,
First
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
w_count = w_count + 1.
endloop.
Then again
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
*HERE CHECK W_COUNT AND DO THE REQUIRED MANIPULATION.
.
.
endloop.
Thanks and Regards,
Bharat Kumar Reddy.V
Hi,
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
.
.
endloop.
In above code how to find number of records selected fulfilling condition.
This I want to check within a loop and not after the endloop.
Thanks,
Pratibha.
2006 Sep 14 7:02 AM
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
<b>if sy-subrc eq 0.
count = count + 1.
endif.</b>.
.
<b>at last.
write : / count.
endat.</b>endloop.
2006 Sep 14 7:09 AM
Thanks Sekhar for reply.
But just after loop statement I want to know the number of records selected if greater than two I want to transfer records to another internal table.
Thanks,
Pratibha
2006 Sep 14 7:12 AM
Hi,
That obviously you can get. For every loop pass chek the count and if the count is greater than 2 then pass them to other table.
Thanks and Regards,
Bharat Kumar Reddy.V
2006 Sep 14 7:17 AM
hi,
the change ur code like this.
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
count = count + 1.
if count > 2.
append itab3 from itab2.
endif.
endloop.
rgds
anver
2006 Sep 14 7:10 AM
Hi,
First
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
w_count = w_count + 1.
endloop.
Then again
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
*HERE CHECK W_COUNT AND DO THE REQUIRED MANIPULATION.
.
.
endloop.
Thanks and Regards,
Bharat Kumar Reddy.V
2006 Sep 14 7:11 AM
hi,
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
count = count + 1.
AT LAST
write count.
.
endloop.
rgds
anver
2006 Sep 14 7:31 AM
Hi,
Count = 0.
Sort itab2 by lifnr WRBTR.
loop at itab2 where lifnr = DLIFNR
and WRBTR = Dwrbtr.
count = count + 1 .
if count GT 2.
Move to itab3 the contents.
endif.
endloop.