Be explicit when names or data boundaries differ
The operational record calls a value dispatch_id; a partner-facing report calls it tracking_code. CORRESPONDING can express that relationship and deliberately leave fields out.
Rename and omit
DATA(report) = CORRESPONDING ty_report(
dispatch
MAPPING tracking_code = dispatch_id
EXCEPT internal_note ).
MAPPING target = source names the field on each side. EXCEPT prevents a same-named field from being copied, so internal_note remains initial in the report. This is a useful safeguard, but a mapping list is not by itself a complete security policy. Define the target data shape narrowly and review every field that crosses a boundary.
Mapping expressions and their additions vary by release and context. Check the target system’s ABAP Keyword Documentation, especially when combining mappings, defaults, or deep components.
Sources
- SAP Samples: Constructor Expressions — CORRESPONDING additions
- ABAP Keyword Documentation: CORRESPONDING mapping
Developer practice · ABAP
Practice: map only approved report fields
Build a report row that renames dispatch_id to tracking_code and excludes internal_note.
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
TYPES: BEGIN OF ty_dispatch,
dispatch_id TYPE string,
status TYPE string,
internal_note TYPE string,
END OF ty_dispatch.
TYPES: BEGIN OF ty_report,
tracking_code TYPE string,
status TYPE string,
internal_note TYPE string,
END OF ty_report.
DATA(dispatch) = VALUE ty_dispatch( dispatch_id = 'D-708' status = 'READY' internal_note = 'dock change' ).
DATA(report) = CORRESPONDING ty_report( dispatch MAPPING tracking_code = dispatch_id EXCEPT internal_note ).
DATA(result) = report-tracking_code.
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.
Debug this code
Assume the dispatch and report structures are already defined. The field mapping is reversed; correct the target and source sides.
Edit the code, then check for the expected repair. This is a structure check, not an ABAP compiler.
Find the issue, repair it, and check your change.
Diagnosis and repair
Diagnosis: CORRESPONDING MAPPING uses target_field = source_field. tracking_code belongs to the target report; dispatch_id belongs to the source dispatch.
DATA(report) = CORRESPONDING ty_report(
dispatch
MAPPING tracking_code = dispatch_id
EXCEPT internal_note ).