Ansicht
Dokumentation

ABENOO_OBS_CORRESPONDING_2 - OO OBS CORRESPONDING 2

ABENOO_OBS_CORRESPONDING_2 - OO OBS CORRESPONDING 2

RFUMSV00 - Advance Return for Tax on Sales/Purchases   General Data in Customer Master  
This documentation is copyright by SAP AG.
SAP E-Book

Cannot Perform Arithmetic Operations on Identically-Named Structure Components

,,In ABAP Objects, you cannot use statements that perform calculations on identically-named components in two structures.

In ABAP Objects, the following statements cause an error message:

ADD-CORRESPONDING struc1 TO struc2.

DIVIDE-CORRESPONDING struc1 BY struc2.

MULTIPLY-CORRESPONDING struc1 BY struc2.

SUBTRACT-CORRESPONDING struc1 FROM struc2.

Cause:

The system performs calculations regardless of the data type of the component. Just because two components are identically named, it does not follow that the results of these calculations will be meaningful. Therefore, always program these calculations explicitly.

Note:

The same rule applies to the MOVE-CORRESPONDING statement and the INTO CORRESPONDING FIELDS of the SELECT statement. At present, these statements cannot be made illegal for practical reasons. However, you should replace MOVE-CORRESPONDING statements with explicit assignments. This also allows you to bundle and assign structure components in substructures, in both the source and the target structure. If a structure cannot contain a substructure, because it is typed with reference to a database table, you can achieve the same effect using group names (the AS NAMEaddition of the INCLUDE STRUCTURE | TYPE statement). At least in static cases, you should avoid the INTO CORRESPONDING FIELDS addition of the SELECT statement and replace it with explicit field name in an INTO clause, since this addition affects performance.






RFUMSV00 - Advance Return for Tax on Sales/Purchases   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 1889 Date: 20240420 Time: 055845     sap01-206 ( 47 ms )