Skip to Content
0
Dec 30, 2020 at 06:44 PM

Add-On: Exclude Module dynamically at import-time? Or check module requirements via ABAP at runtime?

193 Views

We have a function module (call it Function Module A) that we are packaging with the AddOn Assembly Kit, so that it can be imported into a System via the SAINT Transaction.

One of our function modules includes several variables of TYPEs from the namespace /gsd/, like such:

  DATA: y_event_ll      TYPE /gsd/oc_event_interface_data,
    y_events_lt     TYPE TABLE OF /gsd/oc_event_interface_data,
        y_ndoc_lt       TYPE TABLE OF ndoc,
        y_key_lf        TYPE rn2doc_key,
        y_xml_lf        TYPE string,

Not all of our customers have access to this namespace. Of course, we could simply build two separate add-ons:

  • One for customers who have access to the /gsd/ namespace. This add-on would include Function Module A.
  • One for our customers who do not have access to the /gsd/ namespace. This add-on would be the same as the first add-on; except for the fact that we would exclude Function Module A from this package.

But, we are wondering whether there is any solution that would enable us to build only one package. We envision this in one of two potentially possible ways:

  • Runtime solution: Within Function Module A, we could, at runtime, dynamically check if the system the module is running on has access to namespace /gsd/. If this check returns positive, we execute this function module as usual. If this check returns negative, we skip this function module. This would presumably require some kind of additional ABAP-code in Function Module A.
  • "Load/import-time solution": Is there any way for us to build our package with the AddOn Assyembly Kit in such a way, that, when the customer is importing our Add-on via SAINT, Function Module A is only imported into the system if namespace/component /gsd/ is avialable on the system? In other words, if namespace/component /gsd/ is not avilable in the system, the SAINT import would simply skip Function Module A?

Are either of these solutions feasible - and if so, how? Alternatively, are there any other sensible solutions such that we can build only AddOn for the two possible target system landscapes (one landscape that has /gsd/, and one that doesn't)?