Ansicht
Dokumentation

ABENMOVE_CORRESPONDING_STRUC_ABEXA - MOVE CORRESPONDING STRUC ABEXA

ABENMOVE_CORRESPONDING_STRUC_ABEXA - MOVE CORRESPONDING STRUC ABEXA

BAL_S_LOG - Application Log: Log header data   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

MOVE-CORRESPONDING for Structures

This example demonstrates the statement MOVE-CORRESPONDING for structures.

Source Code

Execute

Description

Two structures, struct1 and struct2 are declared using the available additions and MOVE-CORRESPONDING assigns struct1 to struct2.

  • struct1 contains two elementary components, col1 and col2, and a tabular component col3 with the components col1 and col2.
  • struct2 contains two elementary components, col2 and col4, and a tabular component col3 with the components col2 and col3.

The structures are filled with values. For the output, the structured components are resolved to elementary components of an output table, output.

The statement MOVE-CORRESPONDING finds the identically named components col2 and col3 in struct1 and struct2 and the assignments work as follows:

  • MOVE-CORRESPONDING
After the assignment, the components col2 and col3 in struct2 have the same content as in struct1. Component col4 keeps its value.
  • MOVE-CORRESPONDING EXPANDING NESTED TABLES
After the assignment, the component col2 in struct2 has the same content as in struc1. col4 preserves its value. The tabular component col3 is resolved and the identically named component col2 is found there. The original content of struct2-col3 is deleted. After the assignment, the column col2 has the same content as in struct1-col3, whereas the column col3 remains initial.





General Data in Customer Master   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 2177 Date: 20240425 Time: 161553     sap01-206 ( 35 ms )