on 12-01-2007 1:33 PM
I am making a report for qm module. In report while I sort a field of type c (but having numbers) I face a problem. I describe briefly as this.
The contents of field are like this as
10, 12, 10, 8, 10, 12, 14, 8, 13.
When I sort it ascending it should be
8, 8, 10, 10, 12, 12, 13, 14 like this.
But result is coming 10, 10, 12, 12, 13, 14, 8, 8 as this. I think the problem occurred when it detects only 8 , because when the field kept different contents for different operation it sort correctly.
Here is my code.
Loop at itab.
..
.
.
SORT COMP_TAB BY FINAL_VAL ASCENDING.
LOOP AT COMP_TAB.
READ TABLE COMP_TAB INDEX 1 INTO MIN.
ENDLOOP.
..
..
Clear COMP_TAB.
Refresh COMP_TAB.
Endloop.
Try changing the field from C to N.
Since its a character field and sap takes 1 as a lower number than 8 ... that is why the sorting is coming in that way
if your data is stored as
10, 12, 10, <b>08</b>, 10, 12, 14, <b>08</b>, 13 then i think the sort will be proper.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Remove this statement
Refresh COMP_TAB
Why are you reading the same table inside the same table loop?
LOOP AT COMP_TAB.
READ TABLE COMP_TAB INDEX 1 INTO MIN.
ENDLOOP.
Regards,
Satish
Message was edited by:
Satish Panakala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.