A demo on creating and using a custom switch, which is explained via various steps involved in the process. Many documents are available in the internet on Switch framework, but most of them end up with definition and explanation. I thought of creating a simple, very basic demo, which is aimed to the beginners, for them to understand the creation of switches and how the switch on/off reflects in the system.
The main purpose of the Switch Framework is to simplify an ABAP-based system landscape by adopting one or more industry solutions in a standard system. The Switch Framework allows you to externally control the visibility of repository objects or their components by means of switches. By using the Switch Framework, all industry solutions and a restricted list of repository objects are delivered in an inactive state in the system. With minor exceptions, you no longer need to install an industry solution – you can activate it when required.
Here we discuss about the creation of switches. Starting with Tcode SFW1, where we will create a new switch. In the ‘Packgs’ tab, we can add our package name. Here I have added my package ‘ZABY_SFW_TEST_PACKAGE’, where I will be saving the enhancements which I add later. Save and activate the switch.
Next we need to create a Business Function via the Tcode SFW2.
A Business Function is a building block of a business function set. From a business perspective, it represents a self-contained function that you can switch on. Technically, a business function is a set of switches that assign objects to the business function. Business functions are switched on at a system level. By activating a business function, you activate all of its switches except for conflict switches. Conflict switches are not assigned to business functions.
When you switch on a business function, all switches assigned to it are switched to ON or STANDBY, respectively, depending on the definition of the business function.
The business functions can be reversible and non-reversible. Only reversible business functions can be switched off.
The following types of business functions are available:
● Industry Business Function: always needs a business function set to be attached to
● Enterprise Business Function: independent of business function sets
● Enterprise Add-Ons: can no longer be created. Semantically they are the same as Enterprise Business Functions but are based on another technique.
I have created a business function with Type G which is an enterprise business function.
In the Business function, I have added the switch which we have created in the previous step. See the image below.
In case if you have created a Industry Business Function, its always needs a business function set to be attached to. Those who are following with Enterprise Business Function(as followed above) can avoid this step of creating Business function set, and can continue with SFW5 to switch on business functions.
A Business Function Set is the top component of the Switch Framework and represents an industry solution that you tailor from existing solutions in the SAP system.
● meet the requirements of an industry solution
● can be switched on in parallel (unless they are defined as excluding in transaction SFW2).
To create a business function set, use Tcode SFW3 and. And add your business function to the business function tab in the business function set, as shown below. Save and activate it.
Now use transaction SFW5 to switch on business functions and all switches assigned to them. Expand the node ENTERPRISE_BUSINESS_FUNCTIONS, as shown in the image below.
Since the switch is a reversible one, again we can switch off it, thereby the enhancement.