‎2007 Nov 09 5:07 PM
Hi all,
i have to sort the date field which is in [eg MAR 15 2006]
the data is coming in this way , when i am sorting the ITAb it is not sorting
sending this data to EXCEL sheet.
could you please any one tell me the way how to sort the data when date comes in this manner.
regards
kiran
‎2007 Nov 09 5:19 PM
if you wnat perfect sort than you can convert this date to system formatted date and than sort it. I know, this is cumbersome but this is the only way .. I think so..
You can use this sort of code to make your in date to system date for all records and than use the SORT ITAB BY SY_DATE for sorting.
DATA: L_DATE(20) TYPE C.
DATA: L_SY_DATE TYPE D.
L_DATE = 'MAR 15 2006'.
SELECT SINGLE MNR
FROM T247
INTO L_SY_DATE+4(2)
WHERE KTX = L_DATE+0(3).
L_SY_DATE+0(4) = L_DATE+7(4).
L_SY_DATE+6(2) = L_DATE+4(2).Regards,
Naimesh Patel
‎2007 Nov 09 5:20 PM
You should fix the date data...Convert MAR to 03 and concatenate the other values so you end with...
20060315
Use an internal table to get the range...
JAN --> 01
FEB --> 02
MAR --> 03
and so on...
That way, you could use SORT without any problems -:)
Greetings,
Blag.