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

Sortinf problem in ztable

Former Member
0 Likes
685

Moved to correct forum by moderator. Duplicate deleted - don't post the same subject in more than one forum

Hi All,

I created one ztable with three primery keys in order

ZRECNO

ZSUBREC

ZUKEY

All have same domain sytabix.

Data is sorting on ZUKEY FIRST THEN ZSUBRC But not sort on ZRECNO.

I want to sort data in above order means zrecno zsubrec and zukey..

Please sort me out from this problem...

Thanks,

Edited by: Matt on Dec 17, 2008 3:59 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
651

Hi

SY-TABIX is an integer number, so it's not really a good type of data to be used for a key field.

If you need to have a numeric key field u should use a type N ( so a char number)

Probably if u change the domain u'll solve the problem on sorting

Max

Moved to correct forum by moderator. Duplicate deleted - don't post the same subject in more than one forum

Hi All,

I created one ztable with three primery keys in order

ZRECNO

ZSUBREC

ZUKEY

All have same domain sytabix.

Data is sorting on ZUKEY FIRST THEN ZSUBRC But not sort on ZRECNO.

I want to sort data in above order means zrecno zsubrec and zukey..

Please sort me out from this problem...

Thanks,

Edited by: Matt on Dec 17, 2008 3:59 PM

5 REPLIES 5
Read only

Former Member
0 Likes
652

Hi

SY-TABIX is an integer number, so it's not really a good type of data to be used for a key field.

If you need to have a numeric key field u should use a type N ( so a char number)

Probably if u change the domain u'll solve the problem on sorting

Max

Read only

Former Member
0 Likes
651

Hi,

u have to use order by in your select query.

for example:

DATA: wa_sflight TYPE sflight.

SELECT * FROM sflight INTO wa_sflight

WHERE carrid = 'LH' AND

fldate BETWEEN '20010227' AND '20010305'

ORDER BY planetype ASCENDING seatsocc DESCENDING.

WRITE: / wa_sflight-planetype, wa_sflight-seatsocc,

wa_sflight-connid, wa_sflight-fldate.

ENDSELECT.

Regards,

Arun.

Read only

Former Member
0 Likes
651

Didn't you ask this question 10 minutes ago?

Read only

matt
Active Contributor
0 Likes
651

Duplicate has been deleted. This one moved to correct forum.

Read only

Former Member
0 Likes
651

removed