Copy the data shape your report needs

A screen or report often needs a smaller record than the operational object. If source and target components have matching names, CORRESPONDING builds the target from those matching fields. It is safer to describe the mapping than to depend on component order.

Map the common fields

DATA(summary) = CORRESPONDING ty_summary( dispatch ).

Only identically named target components are populated by default. Target-only fields stay initial. Check types and conversion rules; a matching name does not guarantee that the value converts as intended.

MOVE-CORRESPONDING dispatch TO summary is a statement alternative for updating an already-declared target. The constructor expression returns a new value and initializes components not supplied by the mapping, unless you use BASE. These are similar tools, not identical in their effects on existing target data.

Use the smallest target structure that serves the consumer. Do not copy sensitive or irrelevant fields just because they happen to exist on the source type.

Sources

Developer practice · ABAP

Practice: map a shipment into a summary

Create a summary structure from dispatch using matching component names, then read the copied status.

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