SAP AMDP POLYMORPHISM ABEXA



Get Example source ABAP code based on a different SAP table
  



ABAP_AMDP - AMDP Methods in Interfaces and Superclasses
This example demonstrates how AMDP methods are implemented from interfaces and superclasses.

ABAP_SOURCE_CODE
DEMO CL_DEMO_AMDP_POLYMORPHISM

ABAP_DESCRIPTION
An interface IF_DEMO_AMDP_INTERFACE and an abstract superclass CL_DEMO_AMDP_SUPERCLASS implement the tag interface IF_AMDP_MARKER_HDB and contain the method GET_SCARR, which meets the prerequisites of an AMDP method .
The interface method is implemented once as an AMDP method and once as a regular method in the classes CL_DEMO_AMDP_IMPLEMENT_HDB and CL_DEMO_AMDP_IMPLEMENT_OPEN. In the same way, the method of the abstract superclass is redefined in the fixed subclasses CL_DEMO_AMDP_SUBCLASS_HDB and CL_DEMO_AMDP_SUBCLASS_OPEN.
This class demonstrates how objects are created using either the AMDP method or the regular method and called polymorphically, depending on the current database.