Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

intenal table

Former Member
0 Likes
639

how is date and time field sorted if i do sort ascending on internal table

say i have date 1 = 10.04.2008

date 2 = todays date

sort ascending - how will it sort dates

how is date and time field sorted if i do sort ascending on internal table

say i have date 1 = 10.04.2008

date 2 = todays date

sort ascending - how will it sort dates

4 REPLIES 4
Read only

Former Member
0 Likes
616

Hi ,

it will give u sort as follows,

10.04.2008

20.08.2008.

if u give it as descending...the result will be,

20.08.2008

10.04.2008

Regards,

kk.

Read only

Former Member
0 Likes
616

Date is stored internaly as YYYYMMDD format,thus,

Date 1 = 20080410

and current date = 20080520

so upon sort ascending :

20080410

20080520

i.e. date 1 will be on top as its less then current date.

Read only

Former Member
0 Likes
616

hi,

Internal Tables are sorted as follows.

SORT <itab> [ASCENDING|DESCENDING] [AS TEXT] [STABLE].

Read only

Former Member
0 Likes
616

Hi,

Try ds,

Sort ITAB by Date.

Regards,

Mehul Shah