Rap - Interface & Abstarct Class
Rap - Interface & Abstarct Class
Interface:
1.) If_rap_querry_provider:
This interface is commonly used in unmanaged RAP with custom entities as data
models. The logic is implemented in the If_rap_query_provider~select method of
the query implementation class.
• If classes are not related by inheritance but need to provide common
services (like the select method here), an interface is used.
• The interface offers shared functionality, which future classes must
implement.
• By default, interfaces are final, meaning they cannot be inherited or
instantiated.
• In an interface, the select method is declared in the public section (we can
only declare public, as both inheritance and instantiation is not allowed).
Custom entity
In rap, virtual elements are used in projection view to expose a data in ui or odata
service, which does not exist in db. Here the
IF_SADL_EXIT_CALC_ELEMENT_READ~CALCULATE method is used to set the
value for the virtual element.
Implementation class
Abstract class: