‎2007 Feb 28 7:48 AM
HI ALL,
I have statements like this
SORT I_OUT_REC BY BUKRS LIFNR STAT WAERS BELNR. " xblnr.
LOOP AT I_OUT_REC.
...............
At one time in loop i require the priority to be given to the second field i.e; LIFNR. i dont want to loop th I_OUT_REC again and sorting with LIFNR first as that takes a considerable amount of time.Is there any way out
‎2007 Feb 28 7:51 AM
U ca use where in Loop statement.
SORT i-out_rec by lifnr.
LOOP AT i_out_rec where lifnr = ....
‎2007 Feb 28 7:53 AM
use SORT <table> STABLE by lifnr
in side the loop.
Hope this solves ur problem.
Message was edited by:
sai ramesh
‎2007 Feb 28 7:54 AM
Hi,
Since you have already sorted the int table by BUKRS LIFNR...
the second priority will be given to LIFNR field automatically. But what you wants to do at LIFNR level?
Do you wants to display something on LIFNR level.
like Totals for individual Vendor.
Then Use control break statements on Vendor like AT NEW LIFNR write Vendor no and Name and AT END OF LIFNR do SUm. it will give totals.
Regards,
Anji
‎2007 Feb 28 9:02 AM
actually there are three IF conditions in the loop out of which two if conditions require the table to be sorted using BUKRS.Now The third IF condition requires the table to sorted using LIFNR.Is there any way i coul do it without using the looping again?