‎2008 Jun 20 9:42 AM
Hi frdz,
Below SORT statement is not working. Can any one explain me why this is happening.
SORT i_bseg ASCENDING BY belnr bukrs
DESCENDING kunnr.
I have table content as below.
BELNR BUKRS KUNNR
0016000000|CROP |
0016000000|CROP |0008910168
Before and after the sort content order is same.
I want to sort the content like below.
0016000000|CROP |0008910168
0016000000|CROP |
Is there any thing wrong with the sort statement???
i_bseg is defined as TYPE STANDARD TABLE OF
Sort criteria must not change i. e ascending by belnr and bukrs and descending by kunnr.
Thanks,
Vinod.
‎2008 Jun 20 9:45 AM
Hello.
Try:
SORT i_bseg BY belnr bukrs kunnr DESCENDING.
Default is ASCENDING. What I worte is similar to SORT i_bseg BY belnr ASCENDING bukrs ASCENDING kunnr DESCENDING.
Regards,
Valter Oliveira.
‎2008 Jun 20 9:45 AM
Hello.
Try:
SORT i_bseg BY belnr bukrs kunnr DESCENDING.
Default is ASCENDING. What I worte is similar to SORT i_bseg BY belnr ASCENDING bukrs ASCENDING kunnr DESCENDING.
Regards,
Valter Oliveira.
‎2008 Jun 20 9:48 AM
hi vinod,
this is because on your statement, you are sorting BUKRS in descending order and KUNNR in ASCENDING order.
please take note that the sort order should come after the sorted field. if no order is given, the default which is ASCENDING will be used.
do your sorting like this
SORT i_bseg BY belnr bukrs kunnr DESCENDING.
regards,
Peter