‎2011 Oct 21 8:01 AM
Hello SAP Experts,
I need a small doubt to be clarified.
I found one SORT statement which sorts an internal table according to SO number & posnr but this table has one more field as quantity.No order has been defined for this sorting so it should be taken default as ASCENDING.
But the issue is for some line items qty is getting displayed in descending order & for some it is in ascending order.Table has not been sorted as per qty.Its only as per vbeln & posnr.
For example,
SORT int_tab vbeln,posnr.
int_tab is
vbeln posnr qty
12345 100 4
12345 200 4
12345 200 0
12345 400 8
12345 400 0
But after sorting
vbeln posnr qty
12345 100 4
12345 200 4
12345 200 0
12345 400 0
12345 400 8
Please clarify me on this.
BR,
Nisha
‎2011 Oct 21 8:12 AM
Hi Nisha,
Add Quantity field in sort statement.
SORT int_tab vbeln posnr QTY.
Regards,
Surya
‎2011 Oct 21 2:57 PM
If you want to keep the same order for fields not used in the SORT statement, you have to add the STABLE option to the SORT statement. Press F1 on SORT. It's documented.
Rob