Ask the database for only the rows that satisfy the task

The dispatch analyst needs open orders created since a chosen date. Filtering at the database keeps irrelevant rows out of the result and makes the rule visible in one place.

Add predicates incrementally

Start with one comparison:

WHERE status = 'OPEN'

Add a date condition with AND:

WHERE status = 'OPEN'
  AND createdat >= @since_date

For alternatives, use parentheses to make precedence clear:

WHERE status = 'OPEN'
  AND ( carriercode = @carrier_a OR carriercode = @carrier_b )

Do not assume capitalization or text semantics without checking the field’s type and collation. Use a typed host variable for user-provided values rather than concatenating values into a SQL string.

Ranges and optional filters

ABAP range tables can express sets of include/exclude conditions in supported ABAP SQL contexts. A plain WHERE is often easiest for a small fixed rule; use ranges when the user/business logic genuinely supplies a set. Optional criteria should be expressed deliberately rather than by building unsafe dynamic SQL.

Practice

Add the status predicate, date predicate, and table target, then count rows in result. This checker verifies the statement patterns only.

Sources

Version note: SQL condition capabilities and expression support vary by release and source type.

Developer practice · ABAP

Practice: add status and date filters

Filter open orders created on or after the ABAP date variable since_date. Use AND to combine both predicates.

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