SAP® Documentation

Single view

ABAPADD - ADD

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

ADD

Short Reference



Syntax

ADD dobj1 TO dobj2.

Effect

This statement has the same effect as the statement

dobj2 = dobj2 + dobj1.

The content of dobj1 is added to the content of dobj2 and the result is assigned to dobj2. The data objects dobj1 and dobj2 have to be numeric. Only data objects can be specified, no calls or other expressions. The calculation type is determined like an arithmetic expression.

Use the operator format

Note

Obsolete forms of the statement ADD are ADD...THEN...UNTIL and ADD-CORRESPONDING.

Example

After adding, the result contains the character string "_________1". The calculation type is decfloat34. The content of the character-like field result is converted to decfloat34 before the operation and back to c after the operation.

DATA: operand TYPE decfloat16 VALUE 1,
      result  TYPE c LENGTH 10.

ADD operand TO result.

Exceptions

Catchable Exceptions

CX_SY_ARITHMETIC_OVERFLOW

  • Cause: Overflow in arithmetic operation (type p)
    Runtime Error:BCD_OVERFLOW
  • Cause: Integer overflow while adding
    Runtime Error:COMPUTE_INT_PLUS_OVERFLOW

CX_SY_CONVERSION_OVERFLOW

  • Cause: Overflow in arithmetic operation (type p, with specified length)
    Runtime Error:BCD_FIELD_OVERFLOW


Non-Catchable Exceptions

Runtime Error:ADD_FIELDS_ILLEGAL_ACCESS

  • Cause:p field does not contain the correct BCD format
    Runtime Error:BCD_BADDATA









RFUMSV00 - Advance Return for Tax on Sales/Purchases   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 3609 Date: 20200122 Time: 180445     sap01-206 ( 65 ms )

Our Service

Looking for Support? Questions?

The

Consolut

Callback-Service

Leave us your contact details and we will call you back. Panels marked with * are mandatory.