SAP VALUE TYPE INFERENCE ABEXA



Get Example source ABAP code based on a different SAP table
  



Value Operator, Type Inference
This example demonstrates a type inference for the value operator VALUE.

ABAP_SOURCE_CODE
DEMO CL_DEMO_VALUE_TYPE_INFERENCE

ABAP_DESCRIPTION
Constructor expressions with the value operator VALUE for initial values are passed to differently typed formal parameters of methods.
Completely typed formal parameter When the method meth1 is called with a completely typed formal parameter, the operand type for # is determined using this parameter and the result of the value operator is an initial field of type c with length 10.
Formal parameter typed generically with c No call is possible here, since there is no inference rule for the generic type c.
Formal parameter typed generically with csequence In accordance with the inference rule for csequence, the result of the value operator is an initial field of type string, which is indicated by a syntax check warning.