Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Badi document

12,752 views

Published on

Published in: Education
  • If you want to discover how you can increase your cup size within 6 weeks then you need to see this new website... ➤➤ https://dwz1.cc/iZqgQnlK
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Ich kann eine Website empfehlen. Er hat mir wirklich geholfen. ⇒ www.WritersHilfe.com ⇐ Zufrieden und beeindruckt.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • A professional Paper writing services can alleviate your stress in writing a successful paper and take the pressure off you to hand it in on time. Check out, please HelpWriting.net
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ❶❶❶ http://bit.ly/2F90ZZC ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ❤❤❤ http://bit.ly/2F90ZZC ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Badi document

  1. 1. I. Kernel-BAdI enhancement A BAdI • is an anticipated point of extension – these points act like sockets and exist in the original source code. • is a predefined anchor for an Object PlugIn. • has a well-defined interface in contrast to source code plugIns and is therefore more stable to changes in the original source code. Kernel BAdIs - New Features • Are integrated directly in the ABAP Language/Runtime • Improved filter support allows non-character filter types (packed, numeric, string) and complex filter conditions. • Enable reusable implementation instances. • Allow for inheritance of implementations. • Can be switched by the Switch Framework. You have additional control over which BAdI implementations are processed at runtime. • The new BAdIs are faster than the classic ones.Special optimizations for BAdIs with • No active implementations: o ‘GET BADI’ is ignored while compiling o ‘CALL BADI’ just takes the time for a simple if-statement. • One active implementation o Direct call of that implementation • Only implementations, that are switched on are considered. • Active Flag o Only active implementations are considered 40-600 times faster than Classic BAdIs The old classic-BADI used to mix both implementation selection and method call in the same CALL METHOD statement. The implementations could only be chosen at run-time because of the above reason and due to the fact that the BADI handle could only be gotten from another method call by passing the BADI name. Whereas in the new Kernel-BADI, the active BADI implementations are included into the load of BADI handle at compile time and the filter criterion are expanded as IF statements. This is the reason the new Kernel-BADI’s are much faster than classic- BADI’s.
  2. 2. Comparison: Usage of Old BAdIs vs. New BAdIsWith Classic BAdI With New BAdIDATA: bd TYPE REF TO if_intf. DATA bd TYPE REF TODATA: flt TYPE flt. badi_name.CALL METHODcl_exithandler=>get_instance GET BADI bd EXPORTING FILTERS exit_name = `BADI_NAME` lang = `D`. CHANGING instance = bd. flt-lang = `D`. CALL BADI bd->method exporting x = 10.CALL METHOD bd->method EXPORTING x =10 flt_val = flt.
  3. 3.  Obviously getting a new BAdI and calling its methods is much simpler and needs less code.  The old classic-BADI used to mix both implementation selection and method call in the same CALL METHOD statement. The implementations could only be chosen at run-time because of the above reason and due to the fact that the BADI handle could only be gotten from another method call by passing the BADI name. Whereas in the new Kernel-BADI, the active BADI implementations are included into the load of BADI handle at compile time and the filter criterion are expanded as IF statements. This is the reason the new Kernel- BADI’s are much faster than classic-BADI’s. Steps in Creating a kernel-BAdI. 1. Create a composite enhancement spot SE80 (Right-click on the package name Create->Enhancement->Composite Enhancement Spot). 2. Similar to the Step 1, create a simple enhancement spot. Enhancement technique should be Object Plug-in (BAdI). Put Superordinate Composite Enhancement Spot as the one created in Step 1. 3. Create all other components of the BAdI like Interface, methods and filters. Once the BAdI has been created, it can be used inside the program using thecommands GET BADI and CALL BADI. Steps in implementing the BAdI. 1. Create a composite enhancement implementation just like the composite enhancement was created previously. 2. Create a BAdI implementation. (Right click on the BAdI definition name in the enhancement spot and say Create BAdI Implementation)
  4. 4. 3. Use the composite enhancement implementation name as created in Step 1 above. This will guide you through the process of creation of the BAdI implementation. 4. Create the filter values for the implementation.Programming Concepts using New BAdISince Kernel-BADI is yet another enhancement technology under EnhancementFramework, we need to create Enhancement Spot in order to hold the BADI definitions.Similarly, the BADI implementations must also be assigned to EnhancementImplementations.Please refer to the package YOTOCN_DEV in BH1 for the examples and screenshotspresented here.
  5. 5. Global Logic This BAdI can be implemented later to include country-specific logicThese enhancement implementations should be part of the local country specific package.All these enhancement implementations can be switched “ON” or “OFF” together usingthe switch framework.Advantages of using the Switch framework: • Evaluate the source of a bug at a high level. • Faster country-specific testing by switching on/off enhancements of other countries. • Support for parallel developments, since they will not be working on the parent object but on separate BAdI implementations for the BAdI definition available on the parent object.Please note that Packages are assigned to Switches. Hence, ALL the “switchable” objectsin a package can be activated/deactivated by having the switch on/off.SWITCH FRAMEWORKThe Switch Framework can be used to • Switch on industry solutions / Enterprise Add-ons • Develop new functions without affecting existing ones
  6. 6. • Enhance delivered systems at partner and customer site in the context of the enhancement framework with own functionsCreate at least one switch and one Business Function.Assign the switch to your packages containing Enhancement Implementations. Usetransaction sfw5 to activate and deactivate the Enhancement Implementations. CREATING A SWITCH AND SWITCHING IT ON/OFF 1. Create a Switch through SFW1. Press on “Append Row”. Enter the Name of the Switch, description etc. 2. Double click on the newly entered switch name. 3. Enter the Name of the Package under the “Packgs” tab. Activate the Switch. A background job SFW_ACTIVATE_SWITCH is scheduled in the background to activate it.Switch ZOTOCN_SWITCH created with the package YOTOCN_DEV assigned to it. 4. Create a business function through SFW2 and enter the name of the Switch under the “Switches” tab. Activate it. A background job SFW_ACTIVATE_BFUNC is scheduled in the background to activate it.
  7. 7. Business Function ZOTOCN_BUSFN created and the switch ZOTOCN_SWITCHassigned to it. Note the “reversible” flag ticked. 5. Once the Switch and the business function are activated, the business function can be sitched on/off using SFW5. After switching on the business function and then activating it, the switchable objects under the package(linked to the switch) are activated. Similarly they can also be deactivated by switching off the business function.  Please note, it takes 30-120 minutes to switch on/off the business function. There is background job, which gets scheduled. Business Function Switched onDo not deactivate a reversible Business Function ina production system to keep data integrity.
  8. 8. Business Function ZOTOCN_BUSFN created and the switch ZOTOCN_SWITCHassigned to it. Note the “reversible” flag ticked. 5. Once the Switch and the business function are activated, the business function can be sitched on/off using SFW5. After switching on the business function and then activating it, the switchable objects under the package(linked to the switch) are activated. Similarly they can also be deactivated by switching off the business function.  Please note, it takes 30-120 minutes to switch on/off the business function. There is background job, which gets scheduled. Business Function Switched onDo not deactivate a reversible Business Function ina production system to keep data integrity.

×