Ansicht
Dokumentation

ABENCALCULATION_ASSIGNMENTS - CALCULATION ASSIGNMENTS

ABENCALCULATION_ASSIGNMENTS - CALCULATION ASSIGNMENTS

CPI1466 during Backup   CPI1466 during Backup  
This documentation is copyright by SAP AG.
SAP E-Book

+=, -=, *=, /=, Calculation Assignments

lhs +=
  $| -=
  $| *=
  $| /= rhs.


Effect

Calculation assignment with one of the following calculation assignment operators:

  • addition assignment operator +=
  • subtraction assignment operator -=
  • multiplication assignment operator *=
  • division assignment operator /=

These assignments have the same effect as the following assignments of arithmetic expressions:

lhs = lhs + ( rhs ).
lhs = lhs - ( rhs ).
lhs = lhs * ( rhs ).
lhs = lhs / ( rhs ).

The content of lhs

  • gets the result of the parenthesized expression rhs added to it,
  • or has the result of the parenthesized expression rhs subtracted from it,
  • or is multiplied by the result of the parenthesized expression rhs,
  • or is divided by the result of the parenthesized expression rhs,

and the result is assigned to lhs. The calculation type is determined accordingly.

The following applies to the operands lhs and rhs:

  • can be specified.

  • can be specified.
Type inference with the character # is not currently possible in constructor expressions. Character-like expressions and bit expressions cannot be specified.

Division by the value 0 is undefined and raises a catchable exception. The only situation where division by 0 does not raise an exception is if the dividend is also 0. Here, the result is set to 0.

Notes

  • Apart from data objects, calculation assignments also allow expressions in the operand positions. This makes them more powerful than the statements ADD, SUBTRACT, MULTIPLY, DIVIDE, and also makes them obsolete.
  • Calculation assignments can currently only be specified as standalone statements. They are not possible in other expressions, such as after NEXT in the reduction operator REDUCE.

The variable n has the value 1.50 after the calculation assignments.






Fill RESBD Structure from EBP Component Structure   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 6122 Date: 20240425 Time: 190557     sap01-206 ( 53 ms )