‎2010 Sep 01 5:55 AM
Hi Experts,
I have a requirement where an internal table itab has some fileds.
and one of those fields say 'x' will be having values like Z002,Z003,Z010,Z012....
Now i have to sort the above internal table and i should get the records in the below manner
1) Firstly i should get records with field 'x' = Z012
2) Then i should get records with field 'x' = Z002
3) Then i should get records with field 'x' = Z010
4) Then i should get records with field 'x' = Z003
Again for this records i have to sort the internal table by other fields
5) i should get the records with field 'x' = other than above values.
Please let me know can we achieve this by using Sort statement or what logic we can apply to get the above result.
Thank you,
Regards,
Kavya
‎2010 Sep 01 6:01 AM
Hi,
Take another field say NUM in your internal table(ITAB) and assign 1 to the records where field 'x' = Z012
similarly assign 2 to the records where field 'x' = Z002 .....
Do this while populatin ITAB.
Now sort ITAB by NUM x other_field1 ....
Regards,
Srini.
‎2010 Sep 01 6:01 AM
Hi,
Take another field say NUM in your internal table(ITAB) and assign 1 to the records where field 'x' = Z012
similarly assign 2 to the records where field 'x' = Z002 .....
Do this while populatin ITAB.
Now sort ITAB by NUM x other_field1 ....
Regards,
Srini.
‎2010 Sep 03 6:34 AM