Skip to Content
0
Jul 17, 2016 at 07:17 PM

creation of superclass for reusability, how to define DDIC types in methods?

37 Views

Hi everyone,

For our inbound interfaces, I'm planning on creating a superclass for each BAPI we'll be using. Within it, I'll have a method for each table/structure that the BAPI can accept.

For example, we are using 'BAPI_ACC_DOCUMENT_POST'. I have created a superclass with the following mapping methods:

  • HEADER_MAPPING
  • ACCT_GL_MAPPING
  • VENDOR_MAPPING
  • CURRENCY_MAPPING
  • TAX_MAPPING
  • EXTENSION_MAPPING

To make the superclass reusable, I plan on passing in data using TYPE REF TO DATA in the constructor method. However, in my mapping methods, how can cast that into something useful (at the superclass level)?

Or, do I just have to wait until I inherit it out to a subclass, then declare a specific DDIC to cast into?

Hope that makes sense.

Robert.