Get Example source ABAP code based on a different SAP table
C1 Contract Rules for Providing CDS Scalar Functions A provider of a CDS scalar function > must obey the following rules:
CDS Scalar Function Definition> Before release
If a parameter of a scalar function definition is typed using a DDIC data element> or a CDS simple type>, the respective DDIC data element or CDS simple type must be classified with the C1 contract. After release:
The name of the scalar function definition must not be changed.
The parameter interface must remain stable. This means that parameters must not be added or removed, parameter names must not be changed and their order must not be changed. The data types of parameters must not be changed incompatibly. In particular, the following rules apply:
- The typing of an input parameter or of the return parameter can be changed under the condition that the data type remains the same. For example, a built-in ABAP Dictionary data type can be changed into a CDS simple type of the same data type.
- The typing of an input parameter can be changed from a built-in data type into a generic data type under the condition that the scope of the generic data type includes the original built-in data type. The other way around, from a generic data type to a built-in data type, is not allowed.
CDS scalar function implementation reference> Before release:
The scalar function definition to which the implementation reference refers must be classified with the C1 contract.
The AMDP function implementation> that implements the scalar function in question must exist. After release:
The name of the scalar function implementation reference must not be changed.
The type of implementation, that is, the runtime environment to which the scalar function in question is bound, must not be changed.