Skip to Content
Author's profile photo Abyson Joseph

Switch Framework – A simple demo on creation and usage of a custom switch

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.

Switch Framework

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.

/wp-content/uploads/2013/10/dialog_294273.jpg

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.

A business function set groups into a unit several business functions that:

●      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.

/wp-content/uploads/2013/10/dialog3_294272.jpg

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.

Thanks.

Assigned Tags

      41 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Abyson,

      Very useful.. Even I have looked for a tutorial on switch. Thanks for sharing

      Thanks,

      Riju.

      Author's profile photo Jitendra Kansal
      Jitendra Kansal

      very well explained doc. 🙂

      thanks for sharing.

      Rgrds,

      Jitendra

      Author's profile photo Abyson Joseph
      Abyson Joseph
      Blog Post Author

      Thanks you Jitendra Kansal for the comment.

      Author's profile photo Madhu Vadlamani
      Madhu Vadlamani

      Good one.

      Author's profile photo Former Member
      Former Member

      Interesting doc 🙂

      Thanks for sharing

      Regards,

      Anoop

      Author's profile photo Former Member
      Former Member

      Nice one

      Thanks for sharing

      Author's profile photo Former Member
      Former Member

      Hi,

      Nice doc 🙂

      Author's profile photo Former Member
      Former Member

      Thanks for sharing the valuable info.

      Nice documents.

      Author's profile photo Abyson Joseph
      Abyson Joseph
      Blog Post Author

      Thanks Syed, for the comment.

      Author's profile photo Former Member
      Former Member

      hi.

      useful document

      Author's profile photo Abyson Joseph
      Abyson Joseph
      Blog Post Author

      Thanks suneesh thampi for the comment.

      Author's profile photo Former Member
      Former Member

      well explained..

      Thank u for sharing Abyson Joseph

      Author's profile photo Former Member
      Former Member

      Hi Abyson,

      Thanks for sharing 🙂

      Author's profile photo Former Member
      Former Member

      Hi,

      Appreciate your work! Clearly explained about creation of  switches and how it works.

      Regards,

      Shahanaz.

      Author's profile photo Former Member
      Former Member

      Good one and well explained

      Author's profile photo Wouter Peeters
      Wouter Peeters

      Great document. Does anyone know any specific use cases for this ( that they actually used at customers ) ?

      I can only imagine this is useful in case of a bigger custom development?

      Author's profile photo Abyson Joseph
      Abyson Joseph
      Blog Post Author

      Hi Wouter,

      In real scenarios we usually use the standard Business Function Sets provided by the SAP, which relates to the particular industry solution and corresponding set of business attributes and functions. I have given here a very basic demo to understand the various components in the switch framework and how they are correlated.

      Regards,

      Author's profile photo Sougata Chatterjee
      Sougata Chatterjee

      Yes, you can look here for a real business scenario.

      Cheers,

      Sougata.

      Author's profile photo Abyson Joseph
      Abyson Joseph
      Blog Post Author

      Thanks Sougata Chatterjee for sharing the link.

      Author's profile photo Former Member
      Former Member

      Now the concept is  clear.. Great post

      Author's profile photo Satish Kumar Balasubramanian
      Satish Kumar Balasubramanian

      Very Useful Document again. Keep going.All the best.

      Author's profile photo Abyson Joseph
      Abyson Joseph
      Blog Post Author

      Thanks Satish Kumar Balasubramanian for the nice comment.

      Author's profile photo Former Member
      Former Member

      Very helpful post. Thank you for sharing.

      Author's profile photo nabheet madan
      nabheet madan

      Thanks for sharing:)

      Author's profile photo Kiran K
      Kiran K

      Abyson,

      I read quite a few documents explaining the concept of Switch ON/OFF of Enhancements but this is the first document where I got to know how to create a Switch and then linking it to Business Function/SET and then to SFW5.Very nice and useful document.

      My queries are

      1.What are the advantages of using this SWITCH concept instead of deactivating (Comment the Code) or activating (Uncomment the Code) the Enhancement at the Code level.

      2.Is it mandatory that we have the Static and Dynamic Enhancement within the same Spot ?

      3.How it will behave if we have different spots  within the same package or different package for each ?

      Thanks,

      K.Kiran.

      Author's profile photo Abyson Joseph
      Abyson Joseph
      Blog Post Author

      Hi Kiran,

      Thanks for the comments.

      Query 1:

      The main use of  Switch Framework is, 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.

      Means, switch frameworks are be considered in a broader aspect.

      For a better understanding I will explain it in a simple way. In case of an enhancement for a small business requirement, we just can go with usual enhancement techniques and can activate/deactivate the changes by comment/uncomment the code. But think of a huge development with many number of enhancements. If we want to deactivate it, we need to go each object and has to comment the code. But if all the packages in the development are added to a switch, we just can simply activate/deactivate the full development by on/off the switch.

      Query2:

      It is not mandatory. Its fully based on your requirement. Switch works on the package level. Switch considers static and dynamic enhancements based on the 'Switch Type' maintained in Business function. Check this doc Static Enhancement vs Dynamic Enhancement

      Query3:

      Switch considers the enhancement in the packages which are assigned to it via Business function. You can add multiple packages to a switch. If your enhancement implementations are saved in two package and both assigned to a switch, the on/off of switch will affect both. The 'switch type' maintained against switch in Business function has some role with the behavior of objects(Static and dynamic). Check this document Static Enhancement vs Dynamic Enhancement

      Author's profile photo Parveen Kumar
      Parveen Kumar

      Hello Abyson,

      Thanks for sharing the useful information.

      An important use of Switches/Business Functions can also be made when adding new values to a domain.

      We can add a new Fixed value append to a domain and control the fixed value append from a switched package.

      i.e. when the switch is on , the domain will show additional values.

      Regards,

      Parveen Kumar

      Author's profile photo Abyson Joseph
      Abyson Joseph
      Blog Post Author

      Hi Praveen,

      Thanks for this very valuable information.

      Regards,

      Abyson Joseph

      Author's profile photo Former Member
      Former Member

      hi Joseph

      very informative document. but i have one query for different purpose.

      we need to migrate transports from one landscape to another landscape without using the data and cofiles. is it possible to bundle all the RICEFW in one package and use the package in the switch framework feature to move from one landscape to another landscape ( import and export of files like BC sets )  ?

      Thanks

      Sol man

      Author's profile photo Abyson Joseph
      Abyson Joseph
      Blog Post Author

      Switch Framework is used to activate various industry solutions which are already delivered in the system in an inactive status. That means, the objects should be available in system. As of my understanding Switch frame work cannot be used to import/export objects between different landscape. Also BC Set are  used to share 'customization settings'. We can also centrally activate business functions in managed systems from Switch Framework Cockpit in Solution Manager, but it does not have the provision for migrating transports between landscapes.

      Author's profile photo abilash n
      abilash n

      Nicely Explained...

      Author's profile photo Former Member
      Former Member

      Its very useful document for me thank your for sharing this document

      Regards,

      Kumar

      Author's profile photo Former Member
      Former Member

      Great explanation.

      Thanks!

      Author's profile photo Mohamed Aimen DAHANE
      Mohamed Aimen DAHANE

      Thanks, very uesful 😀

      Author's profile photo Kiran Kerudi
      Kiran Kerudi

      Hey Abyson,

      Thanks for sharing this valuable info. A very good documentation.

      Regards.

      Author's profile photo Former Member
      Former Member

      Thank u, very useful...explained nicely

      Author's profile photo ABAPUSER Sao Martinho
      ABAPUSER Sao Martinho

      Hi Abyson!

      Very good this post.

      Do You already activated the switch DIMP GENERAL?

      How did?

      Sérgio Freitas

      Author's profile photo Former Member
      Former Member

      I am new at this and going to try this. Just out of curiosity. I see that  the individual DDIC objects or say append structures under a business functions are shown in status 'switched off' . Is it possible to manually activate them from say Se11 without actually activating business function. ?

      If not is there a SAP note that confirms it.?

      Author's profile photo Former Member
      Former Member

       

      Hi

      We are using EMMAX and want to replace it BDEX for our SAP ISU system. How can I disable the switch framework of EMMAX? Do I need to uninstall the EMMAX addons?

      Author's profile photo Thej Kumar C V
      Thej Kumar C V

      Hi Abyson Joseph,

      Many Thanks for sharing such valuable information.

      Author's profile photo Graham Day
      Graham Day

      Hi Abyson,

       

      Excellent post, just have one question.

      Is there anyway in which you can password control the activation of a switch..

      Example, is that we have 2 SAP products that we are selling and there is common code between the 2 products. The plan would be to install all the code for both products via the SAINT transaction, what would be very useful is to be able to password control the Switch activation for both products.

      Any help would be much appreciated.

      Kind regards

      Graham