Read through the entity behavior, not a database table
When an application needs one purchase request’s status and supplier, EML lets it ask the RAP BO for those fields using the business key. The BO and its behavior definition determine the available entity alias, keys, and fields.
Request only the fields needed
READ ENTITIES OF ZR_PURCHASE_REQUEST
ENTITY Request
FIELDS ( RequestId Status SupplierId )
WITH VALUE #( ( RequestId = 'PR-2202' ) )
RESULT DATA(request_data)
FAILED DATA(failed)
REPORTED DATA(reported).
The WITH VALUE table supplies key data. RESULT holds the returned instance data; FAILED and REPORTED carry failure and message information. A missing or inaccessible instance is not a successful empty business answer—inspect the response tables according to the BO contract.
Field names and capitalization here are illustrative. In ADT, use the generated BDEF-derived types and the actual entity alias from the project’s BO. EML availability and syntax depend on the target ABAP release and scenario.
Sources
Developer practice · ABAP
Practice: read fields for one request
Read RequestId, Status, and SupplierId for request PR-2202 and count the returned rows.
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
Write your solution, then check its structure.
One possible solution
READ ENTITIES OF ZR_PURCHASE_REQUEST
ENTITY Request
FIELDS ( RequestId Status SupplierId )
WITH VALUE #( ( RequestId = 'PR-2202' ) )
RESULT DATA(request_data)
FAILED DATA(failed)
REPORTED DATA(reported).
DATA(result) = lines( request_data ).
WRITE result.out->write( result ).These are context-specific output examples. In your own program, use the result variable from your solution and the output mechanism available in that program.