SAP Message WL387 - Result of operation '& & &' cannot be of type '&'

Diagnosis
The following abbreviations are used in the message:
'I': whole numbers (ABAP data type Int1, Int2, Int4)
'P': packed numbers with decimal places and +/- signs (Dec, Packed)
'N': character string with numerical values (Numc)
'C': character strings (Character)
'D': date
'T': time
'O' or 'o': objects from the Business Object Repository

Procedure
Only use elements or expressions that can be linked with the requiredoperation, that is, define the operation only between compatiable ABAPdata types or between object types:

  • You can only calculate with numbers (types I, P). As well as the basic
  • arithmetical operations (+ - * /), DIV operations (whole numberdivision) and MOD operations (modulo) are supported.
    • With date/time, only the following operations are allowed:

    • 'Date - Date' result: whole number
      'Date - Number' result: date
      'Time - Number' result: time
      'Time - Time' result: whole number.
      • You can only compare numbers with numbers (type I, P, N), dates with
      • dates, times with times, character-based types (C, N) or objects thesame as each other (o).
        • The result of a calculation or an assignment must be compatible in type
        • with the operand(s) and must not lead to an overflow, that is, theresult element selected must be large enough.
          • Hexadecimal numbers (X, RAW) and floating point numbers (F, FLTP) are
          • not supported in container operations at present. If applicable, defineobject methods to implement operations with these types in a program.
            You can find more information in the ABAP editor online help under thekeywords 'Data' and 'Move'.