Application Development 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: 

Group by an internal table with contition?

Former Member
0 Kudos

Hello guys, I have an internal table with data sorted:

sort it_datos by aerolinea fecha1 hora .

I need group by matric becase I need the follow order: A - S A-S No: A-A S-S

this becase this is a table of Flights, when A: Arrivals When S: Departures. Ans I need my report wihr arrivals and departures.

here I have an error on my report:

As you can see I have not the order I want, because in XA-ACO the next row is not XA-ACO (I have market the rows like I want in pair)

The question is, how can I group this table by matric for follow the order A/S ??

3 REPLIES 3

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

See https://blogs.sap.com/2016/06/23/group-by-for-internal-tables-step-by-stepc/

With additions ASCENDING|DESCENDING you can define the sort order.

raghug
Active Contributor

Looks like you need to hire a programmer, or at least someone who can manage to sort an excel spreadsheet. Maybe you should put your data in to Excel and try different sorts to see what works.

In this particular case, sort by all the fields that you need an order of importance aerolina, matrlo, numero, a/s, fecha and hora.

raghug
Active Contributor
0 Kudos

Before down voting, why don't you try it? Your "matrlo" field groups your flights together within an airline, if you start your sort with that, they will all stay together. So Airline, Matrlo... then whatever else.