Wednesday, November 16, 2011

The 'Switch' in 'Enhancement & Switch framework'

I had been wondering if the switch framework could be something I could use to structure enhancements I do to the system.

So, at TechEd in Madrid, I decided to learn more about the framework, and I would like to share that with you.

As the name suggests, the switch framework enables you to switch functionality on and off. System wide. So, not for certain users, user groups or businessroles, nor for certain clients, no, system wide. A switch object is not switchable at runtime.

SAP uses the switch framework for industry-specific functionality and enhancement packages. So, after implementing an enhancement package, you might have to switch the new functionality on before you can use it.
Switch framework maintenance can be done in transaction SFW1 - SFW5.

The switch framework technically consists of 2 important objects:
  1. Switch object
  2. Business functions
A switch object is a grouping of packages and enhancements. The content of the package as well as the assigned enhancements will be switched. 

The business function is a grouping of switch objects.

If you switch on a business function, the packages assigned to the switch objects assigned to the business function will be activated (compiled, generated etc).

Only the following objects will be influenced by the switch. Other objects in a package would be activated as normal:
  • Enhancement Implementations
  • Appends, SI-, CI-includes for dictionary structures
  • Fixed value appends to domains
  • Append Search Helps
  • Secondary Indexes
  • Switch Business Configuration Sets
  • Screen elements & Flow logic
  • Menu entries & functions
  • IMG nodes
  • Easy Access Menu
  • Customizing
If you switch off a business function, the objects will be deactivated and the functionality can not be used anymore.

In the business function definition, there is a setting whether an activated business function can be switched off again, or whether this is a switch-on-only business function. You will generally find a switch-on-only business function if the switch includes data dictionary objects

So, could the switch framework be something I could use?
I suppose the switch framework will not help me when developing for a single system. The switch framework could be interesting though when coding general enhancements which could be implemented for several different customers.

Food for thought
As switching on the functionality is optional, you can imagine this requires extra attention when working on these functions. You cannot assume the functionality has been switched on... For instance, functionality in enhancement pack 5 should not require the functionality of enhancement pack 2 to be active.

This would be the same when developing enhancements yourself. If you do develop new functionality that requires a switchable object to be active, you can of course add that switch object to your own business function.