Separate ABAP values from database-language text

carrier_code is an ABAP variable; carriercode is a database field. The @ host-variable escape makes that difference explicit in modern ABAP SQL.

WHERE carriercode = @carrier_code

The SQL statement remains a statement with a defined query structure, while the value is bound from ABAP. This is safer and clearer than concatenating user input into dynamic SQL text.

Escaping outside conditions

The escape is also used for ABAP targets and values, for example INTO TABLE @DATA(orders) and WHERE createdat >= @since_date. In older syntax versions, escaping conventions differ; do not mechanically paste the modern @ form into legacy code without checking the language version.

Parameters vs dynamic SQL

Use a typed host variable for a value such as a carrier code or date. Dynamic SQL should be reserved for cases where the query structure itself must vary and must use the language’s safe APIs and validation practices. User values should not determine arbitrary SQL fragments.

Practice

Complete the carrier filter with @carrier_code, collect results, and count them. The browser checker checks patterns only; it does not connect to a database.

Sources

Developer practice · ABAP

Practice: bind a carrier code with @

Use the supplied carrier_code ABAP variable in WHERE with the host-variable escape. Do not put the variable name inside a quoted string.

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

Debug this code

The filter is treating the carrier value incorrectly. Repair the condition so it uses the ABAP variable, not a quoted text literal.

Edit the code, then check for the expected repair. This is a structure check, not an ABAP compiler.