‎2018 Jul 04 8:10 PM
Hello Experts,
wanted to sort my internal table in sequence. for example
Sno Mat id Rec_id Sequence no
The above mentioned is my internal table data. i wanted to sort my internal table as below.
Can any one provide me the idea, how to achieve this sort based on sequence no. this is small example, i have more than 100 records are available in my internal table.
<inappropriate comment removed by moderator>
Thanks,
Srikanth.
‎2018 Jul 04 8:15 PM
‎2018 Jul 05 3:29 PM
‎2018 Jul 05 3:33 PM
Instead of writing +1, why not press the arrow above the zero, and upvote the answer you like?
‎2018 Jul 06 2:27 PM
‎2018 Jul 04 9:06 PM
You've given inconsistent information as the records in your first set of data do not match any in the second. You really need to be clear exactly how you expect the data to be sorted, which columns, ascending or descending etc. But most of all you probably need to read the ABAP keyword documentation of SORT.
‎2018 Jul 04 9:48 PM
‎2018 Jul 05 1:43 AM
Hi Srikanth
For me, it is not 100% clear about what kind of sort sequence do you want.
Feels like you want to sort the table by "Mat id" and "Sequence no"
If yes, try this:
sort <internal table> by <Mat id> <Sequence no> ascending.
‎2018 Jul 05 7:42 AM
Sure. First data order is this:
Sno Mat id Rec_id Sequence no
1 BOG6C210F 5857FB1D 2
2 BOG6C210F 5857FB20 1
3 BOG6C210F BOG6C210F 3
4 BOG6C2166 584232BF 2
5 BOG6C2166 584232C0 1
6 BOG6C2166 584232A2 3
<br>
Second is this
Sno Mat id Rec_id Sequence no
1 BOG6C210F 5857FB20 1
2 BOG6C210F 5857FB1D 2
3 BOG6C210F BOG6C210F 3
4 BOG6C2166 584232C0 1
5 BOG6C2166 584232BF 2
6 BOG6C2166 584232A2 3
The record 1 BOG6C210F 5857FB1D 2 in the first set does not exist in the second data set.
Of course, you've made the assumption that the Sno column should be ignored, which is probably true, but the point I was making is that it's really important when people ask questions to be as clear as possible.
And that it would be nice if people would put in a little effort to resolve issues themselves before posting here. I mean, how hard is it to read the keyword documentation? If this question had not received some answers already, I'd have deleted the question on the grounds of RTM.
‎2018 Jul 05 8:02 AM
‎2018 Jul 06 4:23 PM
"how hard is it to read the keyword documentation?"
Hopefully, not as hard as writing it 😉