Hi Christian,
I guess your requirement can be achieved through Standard Clearing Configuration.
Creation a new Clearing Step, in your existing clearing variant, as follows-
Grouping Characteristics-
1.004-Main Tr. Grp Rule-3
Char value-Main Tr. value used to post the IP (Standard SAP Main Tr.-0080)
AIRI- Blank
Group-1
2.010-Due Date
Sorting Characteristics-
1. 010- Due Date
Sort-Ticked.
All the other values will be blank.Configure this and try to check your scenario.
Hope it helps..
Thanks,
Amlan