A date alone may not define a unique work order

Two dispatches can have the same due date. If a user or downstream step needs a predictable first row, add a tie-breaker such as the unique dispatch ID.

Sort, then access by index

SORT dispatches BY due_date ASCENDING dispatch_id ASCENDING.
READ TABLE dispatches INDEX 1 INTO DATA(first_dispatch).

Index access is available for standard and sorted tables, not hashed tables. The secondary sort component makes the intended order deterministic for equal due dates. It does not imply the original input order is preserved.

Sort only when the workflow needs this ordering. A sorted table keeps a key order as rows are added; sorting a standard table is an explicit operation. If the collection is large and repeatedly needs a specific key order, consider whether an appropriate sorted table/key is a better design.

Sources

Developer practice · ABAP

Practice: order overdue dispatches consistently

Sort dispatches by due date ascending, then by dispatch ID ascending, and read the first row.

Choose your ABAP environment

This choice changes the output pattern checked here: WRITE belongs in a classic executable report, while out->write( ) uses the supplied output reference in an ABAP Cloud class-run method. It does not switch the language version of the other code; check release and API availability in your target system.

Complete the task and include the output statement shown for your selected environment. Variable names can differ if you use them consistently. This browser checker checks structure only; it does not compile or run ABAP.

0 required structures detected · 0 checks