Hi Larry,
If you start your report using the SAP system layout as a base, this functionality is automatically there. Check one of the system layouts, they use a tnsp to bring in the lines from qut1 and qut10 (text rows) which orders them correctly.
there are multiple details sections which are displayed & hidden based on line type