Showing posts with label BADI'S IN ABAP. Show all posts
Showing posts with label BADI'S IN ABAP. Show all posts

BADI and Customer exits in SAP ABAP

Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included inthe standard delivery. Since specific industries often require special functions, SAP allows you to predefine these points in your software.

As with customer exits two different views are available:

1·In the definition view, an application programmer predefines exit points in a source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.

2· In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.

In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, partner, and customer solutions, as well as country versions, industry solutions, and the like). Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.

SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.

The Business Add-In enhancement technique differentiates between enhancements that can only
 be implemented once and enhancements that can be used actively by any number of customers at the same time. In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example).

All ABAP sources, screens, GUIs, and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard. A single Business Add-In contains all of the interfaces necessary to implement a specific task.

Related Posts:

IMPORT BADI - Procedure

Conflicts can occur at release upgrade or when transporting a Business Add-In within a system infrastructure containing multiple levels (country versions, industry solutions, partners, etc.).

Possible collisions include:

.......................................................................................................................

Whenever such collisions occur, corresponding error messages and warnings are created in the transport log at import. Their long texts provide you with information on how to proceed.

If the collision described in case 1 occurs in your system, proceed as follows:

1. Choose Utilities ® Adjustment ® Multiple active implementations (in transaction SE18).A list appears displaying your Business Add-Ins. A red traffic light indicates that multiple active implementations exist for that add-in.

2. Deactivate these implementations using the appropriate pushbutton or double-click on the name of the implementation to branch to the corresponding transaction where you can then correct the problem .

In cases 2 and 3, proceed as follows:

1. Choose Utilities ® Adjustment ® Multiple assigned interfaces or Multiple function codes assigned.

Both of these menu options display an overview; the add-ins in question are marked with a red traffic light.

2. The people responsible for those add-in definitions where identical interfaces and function codes occur must now decide how to proceed. To delete a function code or change an interface name, call the ABAP Workbench and use the appropriate pushbutton to call the tool you need. A new transport may be necessary.

The previous post of the topic is regarding screen enhancements implementation using BADI.
SAP Authorization and ALE
Authorization and implementation of SAP
Mysap market place introduction

badi screen enhancements implementation

The present post is in continuation with BADI SCREEN ENHANCEMENTS DEFINITION. Going through that post will give you more convenience and comfort in following this topic.

Here is the way of implementing SCREEN ENHANCEMENTS using BADI.

The user of the screen enhancement should perform the following steps:

1. Create a screen of the Sub screen type. Arrange the required fields on the screen.

2. Write the program for the screen by creating either a module pool or a function group. The program could have the following contents,

for example:

Top Include:

DATA: exit TYPE REF TO if_ex_badi_screen,

flight TYPE sflight.

TABLES sflview.

PBO:

MODULE status_0100 OUTPUT.

IF exit IS INITIAL.

CALL METHOD cl_exithandler=>get_instance_for_subscreens

CHANGING

instance = exit

EXCEPTIONS

OTHERS = 6.

...

ENDIF.

CALL METHOD exit->get_data_from_screen

IMPORTING

flight = flight

EXCEPTIONS

reserved = 1

OTHERS = 2.

...

SELECT SINGLE * FROM sflview

WHERE carrid = flight-carrid AND

connid = flight-connid AND

fldate = flight-fldate.

..

ENDMODULE.

PAI:

If data has been changed, the method PUT_DATA_TO_SCREEN is called at PAI.

MODULE user_command_0100 INPUT.

CALL METHOD exit->put_data_to_screen

EXPORTING

flight = flight

EXCEPTIONS

reserved = 1

OTHERS = 2.

IF sy-subrc <> 0.
...
ENDMODULE.

3. Choose the Subscreens tab. Enter the name of the called program and of the subscreen.

4. Choose the Interfaces tab.

If required, add any lines necessary to the sample code.


You can go through entire BADI COURSE HERE.

Authorization and implementation of SAP

ABAP BADI SCREEN ENHANCEMENTS DEFINATION

This topic is in continuation with ABAP BADI SCREEN ENHANCEMENTS PART .It will be more convenient to if you go through that first if you are new to this blog.

Here is the step by step procedure for screen enhancement definitions using BADI .

1. Create the following methods.

The methods PUT_DATA_TO_SCREEN and GET_DATA_FROM_SCREEN are required for data transport. These methods are called from within the program of the application at PBO or PAI .

Here is the screen shot for defining the methods mentioned above and you can click it for enlarging.


2. Create an instance attribute in the interface. This attribute is used for passing data.


3. Write the code for the call of the screen enhancement in the program of the application:

Top Include:

DATA: program Type program,
dynpro Type dynnr.
exit type ref to if_ex_badi_screen
The variable for the object reference is created using data and typed to the interface.

PBO:

MODULE initialize OUTPUT.
CLEAR: sflight, ok_code.
IF exit IS INITIAL.
CALL METHOD cl_exithandler=>get_instance
CHANGING
instance = exit.
ENDIF.
CALL METHOD cl_exithandler=>set_instance_for_subscreen
EXPORTING
instance = exit.
ENDMODULE.

The factory method is used to create an instance of the adapter class. You then declare the instance using the public static method SET_INSTANCE_FOR_SUBSCREEN to allow the data for display on the screen to be used in the function group of the user or in the module pool.

MODULE data_for_subscreen OUTPUT.

program = sy-repid.
dynpro = sy-dynnr.
CALL METHOD cl_exithandler=>get_prog_and_dynp_for_subscr
EXPORTING
exit_name = 'BADI_SCREEN'
calling_program = program
calling_dynpro = dynpro
subscreen_area = 'SUB'
IMPORTING
called_program = program
called_dynpro = dynpro.
CALL METHOD exit->put_data_to_screen
EXPORTING
flight = sflight
EXCEPTIONS
reserved = 01.
ENDMODULE.

PAI:

MODULE user_command_0200 INPUT.
CASE save_ok.
WHEN 'BACK'.
SET SCREEN 100.
WHEN 'SAVE'.
PERFORM save_flights.
WHEN '+EXT'.
CALL METHOD exit->get_data_from_screen
IMPORTING
flight = sflight
EXCEPTIONS
reserved = 01.
ENDCASE.
ENDMODULE.

The method GET_PROG_AND_DYNP_FOR_SUBSCR and the input/output parameters specified above are used to determine the name of the customer program and the name of the subscreen. The method PUT_DATA_TO_SCREEN which is called at PBO as well as the method GET_DATA_FROM_SCREEN which is called at PAI are used to transport the data to be displayed.

These methods are implemented by the user:

When you define a screen enhancement, you are strongly recommended to provide sample code for the methods PUT_DATA_TO_SCREEN and GET_DATA_FROM_SCREEN. This code is automatically copied when you create an implementation and can be added to if required. The user of the BAdI definition should not be responsible for the data transport.

Y

Billing and payment process in erp sap abap

ABAP BADI SCREEN ENHACEMENTS

Besides program and menu enhancements, you can also create screen enhancements for business Add-Ins. Screen enhancements are not supported, however, for Business Add-Ins designed for multiple use.

With the old enhancement technique based on customer exits, X function groups were used for data retention and data processing purposes. These tasks are now performed by a user function group or a module pool if you implement a screen enhancement using BAdIs. The instance of the implementing class is only used for data transport.

The name of the function group lies in the namespace of the implementing person/user. The 'X' which was necessary at the beginning of a function group in case of customer exits is now no longer required and therefore eliminated.

An instance of the BAdI class must be passed to the user of the BAdI to allow that user to get the data to be displayed on the screen. For this purpose, the instance is saved in a public static readomly attribute DYNPRO_INSTANCE of the BAdI class. This attribute is generated.

A public static method SET_INSTANCE_FOR_SUBSCREEN sets the attribute on the application side to the parameter passed. Using the method GET_INSTANCE_FOR_SUBSCREEN the parameter is then read on the user side.

Different sub screen states can be represented by different instances.

The relationships shown between the calling program, the classes and the user function group or module pool are illustrated below by means of an example.

Example:

A user wants to display flight data in a transaction and enters the airline carrier, the flight number, and the flight date first.


At the specific request of the customer, you are to enhance this function to allow the user to additionally display the time of departure and arrival as well as the departure and destination airport.

The definition of a Business Add-In containing the functionality required is then delivered to the customer. If the customer creates an implementation, the system displays additional fields.


If you are interested with SAP ABAP BADI MENU ENHANCEMENTS you can try the highlighted link.

You can go through entire SAP ABAP BADI COURSE HERE.

Customer Relationship Management and mysap an introduction
CRM Management and sales and service strategy of mysap crm
MySAP CRM and customer as business partner

SAP ABAP BADI MENU ENHANCEMENTS

SAP allows you to enhance menus in its user interfaces using function codes. These function codes must adhere to the form /namespace/+<...>, just like in SMOD/CMOD enhancements.They are assigned to a specific enhancement and only appear in their corresponding menus once an  implementation of this enhancement has been activated.

Application developers reserve specific function codes for customers when defining a Business Add-In. They use the Menu Painter to include these codes in the appropriate menu lists.

Application developers must also ensure that these menu options are called in their applications and that the corresponding add-in methods are also retrieved. Customers can take advantage of menu enhancements by creating a new implementation, choosing a text for the menu option, and then programming the method used to determine what action is performed when the menu enhancement is called.

Menu enhancement is only possible using single use add-ins (not multiple use add-ins) that are not filter-dependent. Currently, menu enhancements can only be created in conjunction with program enhancements (interfaces).

To create a menu enhancement, proceed as follows:

1 . Create an add-in and define its interface.
2 . Choose Fcodes from the tabstrip.
3 . Enter the name of your program, the function code, and a description.

4 . Call the Menu Painter or double-click on your program name or function code to branch to user interface maintenance in the Menu Painter. Enter your function code in the appropriate menu list. If you have accessed the Menu Painter directly during add-in definition, you can call your menu lists by choosing Goto ® Object lists ® Menu list instead.


Calling a Menu Enhancement from an Application Program

You programming should look like this:

(…)
case fcode.
when 'SAP'.
(…)
when '+CUS'
call method …

Implementing a Menu Enhancement

When implementing menu enhancements, proceed as follows:

1. Create an implementation and choose Fcodes. All data adopted from your Business Add-In's definition is displayed here. You can make entries for the implementation on the right.

You can also double-click on the first input field. The following dialog box appears:

Here you may enter a text for your function code, the name of an icon and a text for the icon, and a short informational text.

The actions that you want the system to perform after the pushbutton is chosen must be programmed in the appropriate method, either manually or using default source code that has been provided to you.

Menu enhancements only become visible after the implementation has been activated and the application program that calls the Business Add-In has been executed.




You can learn SAP ABAP BADI IMPLEMENTATION here.

You can go through entire SAP ABAP BADI COURSE HERE.
Organizational Challenges with crm and mysap crm solutions
My sap crm and marketing planning

SAP ABAP Business Add-Ins implementation

This concept is in continuation with SAP ABAP BADI FILTER DEPENDENT PART TWO and it may be more convenient if you to go through it before proceeding to this concept.

If you want to use a filter-dependent Business Add-In, you will need an implementation for each relevant filter value. Multiple filter values may use the same implementation, however.

When implementing a filter-dependent Business Add-In, proceed as follows:

1. Create an implementation by referring to the corresponding Business Add-In definition.

2. Enter a characteristic filter value for the implementation, or choose F4 and select a value from the list of possible entries displayed. In principle, it is possible to define multiple characteristic filter values for each implementation.

3. Use the Class Editor to fill the interface method.

In the string conversion example, you would make the following entries for each country:
BRD:
translate parameter to upper case.
Ireland:
translate parameter to lower case.
Italy:
translate ...

4. Repeat steps 1-3 for each implementation that you create.

5. Activate your implementations.

Now, whenever you execute the report program described above, different country-specific implementations are executed.

You can specify generic filter values for the implementation of a Business Add-In, which means that you can use the special character "*". You can use the asterisk to represent any part of a filter value. A generic filter value can be replaced by different values which may be found in the
database.

You can show and hide short texts for filter values by double-clicking the corresponding column.

As far as extendible filter types are concerned, it is also possible to edit short texts.

Extendible Filter Types

If you flag a filter type as being extendible, it is also possible to create implementations for filter values that did not exist so far. When you assign the extendible attribute to a filter type, the Implementation menu option in the BAdI Builder is replaced by Filter value. If you choose Filter value ® Create and enter a filter value that did not yet exist (you do not need to specify the name of the implementation), the system takes you to the transaction for implementing Business Add- Ins. You can also use transaction SE19, as usual.

The assignment of the extendible attribute is subject to the following restrictions:

The domain to which the extendible filter type refers must have the following properties:

1· The domain is linked to a cross-client value table. This value table has exactly one key field which has the data element of the filter type as its field type.

2· The domain has a text table with two key fields. A key field has the filter type as its field type, and a key field is a language field. To mark a field as a text field, a field must exist in this table that contains the string 'TEXT' or 'TXT as a partial string. In the Dictionary, the text table must be assigned to the value table.

3· The delivery class of both tables must be "E" or "S".

All filter values that are created in the context of an extendible filter-dependent Business Add-In must not yet occur in the value table and are added to the value table when the data is saved.

Analogously, the values are removed from the value table when the implementation or the entire Business Add-In is deleted. The same applies to the text table.

Special Characteristics of Country-Specific Business Add-Ins

The standard system contains a Business Add-In which provides an interface for integrating additional postal checks of the address data through external tools. This Business Add-In is called Address-Check.

This example uses the data element INTCA (ISO code of the country). Since SAP recommends complying with the international ISO standard for country-specific queries, you should use the data element INTCA also for Business Add-Ins. The ISO code of a country key would be, for example, US instead of USA, or DE instead of BRD.

Before the Business Add-In is called from within the application program, you must determine the ISO code of the country by submitting a SELECT statement against table T005 (field INTCA).

Then you can pass the filter value as exporting parameter.
15.5

You can go through entire BADI COURSE HERE.


MySAP CRM business intelligence at work
CRM data administration in mysap and business intelligence

SAP ABAP Business Add-Ins Filter Dependent part two

This post is in continuation with SAP ABAP BUSINESS ADD INS WITH FILTER DEPENDENT and it is highly advisable to go through it first.

The filter value is declared using parameter flt_val and is preset in the list of parameters.

Calling a Filter-Dependent Business Add-In from an Application Program

The filter value is passed to the method as export parameter.

Report businessaddin.

class cl_exithandler definition load.

data flt type usa_land.

data exit type ref to if_ex_businessaddin.

data word(15) type c value 'Business Add-in'.

start-of-selection.

perform formatlist.

call method cl_exithandler=>get_instance

changing instance = exit.

write:/'Please click here'.

at line-selection.

new-page.

write:/ 'Original word: ',word.

call method exit->method

exporting

flt_val = flt.

Changing

parameter = word.

write:/ 'Changed word: ',word.

The subroutine formatlist looks like this:

form formatlist.

write:/'USA -> Conversion to upper case'.

flt = 'USA'.

hide flt.

write :/'Ireland -> Conversion to lower case'.

flt = 'Ireland'

hide flt.

write :/'Italy -> Conversion to...'

flt = 'Italy'.

hide flt.

endform.


In the next post i will be discussing the implementation of the BADI.

SAP CRM Business Transactions
 SAP CRM marketing Management Campaign
SAP CRM Internet sales Features

SAP ABAP Business Add-Ins Filter Dependent

The basics of this concept are discussed as BADI IMPLEMENTATION CONCEPTS and you can go through this before proceeding for this.

Business Add-Ins may be implemented depending on a specific filter value. If the standard allows for an enhancement for, for example, country-specific versions, it is likely that various partners will want to implement this enhancement Distinct implementations can then be created and activated according to country.

Enter a filter type when defining your enhancement (a country or industry sector, for example). All methods created in the enhancement's interface have filter value 'FLT_VAL' as their import parameter. The application program provides the filter value to the enhancement method. The method then selects the active implementation for that value.

A description follows of how a filter-dependent Business Add-In works in the context of the string conversion example. In the following example, different implementations will be called using different filter values.

To define a filter-dependent Business Add-In, first create a normal Business Add-In and select the Filter checkbox.

Enter the data element you want as a filter type or select a filter type using the possible entries help. A filter type can be a data element or a structure. A data element must fulfill the following criteria:

1 · The data element's domain may contain a maximum of 30 characters and must be of type Character.

2 · The data element must 1). either have a search help with a search help parameter of the same type as the data element and this parameter must serve as both the import and export parameter or 2). the element's domain must have fixed domain values or a value table containing a column with the same type as the data element.

If need be, you can create such data elements yourself.

If you want to call the implementation of a Business Add-In depending not only on one filter value but on various values, you can enter the name of a structure into the Filter type field. The
structure can consist of several data elements that fulfull the above conditions for data elements.

Now create an interface with a method. Be aware that for each method you create in the interface of a filter-dependent enhancement, the appropriate filter value must be defined as the import parameter so that the application program can provide the filter value to the enhancement method. The method then selects the active implementation for that value.

This discussion will be continued in further posts.

You can access entire BADI COMPLETE COURSE here.

The previous post of the blog deals with SAP SMART FORMS CONCEPT in detail.

CRM Sales Cycle Management

ABAP BADI IMPLEMENTATION part two

Earlier i covered BADI IMPLEMENTATION and this is in continuation with that.Here we are going to learn BADI implementation using Formula Bar.You can use the Formula Builder to implement methods for Business Add-Ins without writing a single line of ABAP code. The methods are implemented by means of so called formulas.

This type of implementation does not require you to have programming knowledge. However, the functions it offers are more restricted than if you implement a method by writing ABAP code. If the
range of functions provided by the Formula Builder is not sufficient, you can change the implementation type of the method at any time.

A formula can consist of the following steps:

1 · Condition

You define a Boolean formula expression whose result can be true or false. This formula expression is a logical condition based on the importing and changing parameters of the method. Depending on whether the condition is true or false, the system triggers different steps. If you do not specify a dependent step for one of these two possibilities, the system continues with the next superior step.

2 · Substitution

The system replaces the value of a specific parameter with another value which you define as a constant value or by means of a ma thematic formula. Substitution is only possible if the method contains changing, exporting or returning parameters.

3 · Message

The system issues a message. All messages issued are collected in a log table. You define the message variables as constant values or by means of ma thematic formulas. The system can only issue a message if you created a log table during method definition.

4 · Exception

The system exits the method. No further steps are executed, and the application program continues in accordance with the exception defined. You can additionally display a message whose variables you define as constant values or by means of ma thematic formulas. An exception can only be triggered if the method contains exceptions.

A formula editor is available which you can use to enter formula expressions. After starting the formula editor, you can display information on how to use it by choosing the pushbutton next to the status display (traffic light).

Activities:

To implement a method as a formula, choose the Formula implementation type on the Interface tab.

Double-clicking the method name takes to to the Formula Builder: BadI Implementation screen.

You can change the implementation type of the method on the Interface tab. You can implement a method both using a formula and using ABAP code. At the runtime of the application program, the system executes the implementation type currently chosen.

You create the necessary steps in the left section of the screen. To do this, choose (Create) and then select the appropriate step type from the dropdown list. Using the other icons available or the context menu (which you can call by clicking the right mouse button), you then determine the arrangement and the descriptions of the steps. You can also copy steps to use them as templates for other steps, or you can delete individual steps.

To specify the parameters for the individual steps, double-click the corresponding entry in the left section of the screen. You then enter the data required in the right section of the screen.

Formulas are transported automatically.

Here you can go through the entire list of BADI related topics with in depth analysis.

The previous post is regarding SAP BW architecture and it will be helpful for a abap programmer to expand his base.


MySAP CRM System architecture and design
MySAP CRM architecture and E procurement introduction

ABAP BADI IMPLEMENTATION

This can be taken like a continuation post for ABAP BADI DEFINITION.

A list of the Business Add-Ins present in your system can be found either in the IMG or in the component hierarchy. The enhancements' names and corresponding documentation should help you decide which add-in you want to create an implementation for. During implementation creation, a class for implementing the enhancement's interface is also created. Implementations are discrete transport objects and lie within the namespace of the person or organization implementing them.

In order to create an implementation for the string conversion example, the add-in (in this case,the interface's method) needs to be filled with logic that converts the string. This logic will be run through every time the add-in is called from the application program.

To create an implementation, proceed as follows:

1. Choose ABAP Workbench ® Utilities ® Business Add-Ins (transaction SE19) from the SAP menu or double-click on the corresponding activity in the Implementation Guide.

2. Enter a name for the implementation and choose Create.

3. Enter the name of the add-in you want to create an implementation for in the dialog box that appears.

4. Enter a short text describing your implementation on the following screen.

5. Choose the Interface tab.

6. Choose ABAP Code as the implementation type.

Besides ABAP Code, there is also the Formula option. If you choose Formula, the content of a method is determined using the Formula Builder. For more information on this, see Implementing Methods Using the Formula Builder.

7. Navigate to the Class Builder by double-clicking the method. You must first enter a package before the Class Builder is displayed.

8. Insert the desired source code for the implementation between the method if_ex_businessaddin~method. and endmethod. statements automatically provided to you by the system.

Enter the statement translate parameter to upper case. for the string conversion example.

9. Save your entries and return to the Change Implementation screen.

10. Choose Activate. You may now use this implementation when the application program is executed.

Numerous implementations may exist for a Business Add-In that cannot be used on a multiple basis. However, only one implementation can be active for these kinds of Business Add-Ins at any one time.

What is also important is that you must declare the instance generation of the implementing class (Attributes tab) as public and not as private or even abstract. If you do this, the system will return short dumps at runtime.

If you are interested in abap dictionary try this list of complete series of abap dictionary.

Mobile Scenarios in SAP CRM 
Connecting Mobile Clients to SAP CRM
Administering Sites for Mobile Users in CRM
CRM Middle ware for Mobile Replication

BADI COMPLETE SERIES

Learn the most advanced technique of enhancements of sap abap i.e BADI here in a systematic manner with series of lessons as shown here.


IMPORTANCE OF BADI IN SAP ABAP

COMPARISON OF ENHANCEMENTS IN ABAP

BADI DEFINITION WITH SCREEN SHOTS

BADI IMPELEMTATION

BADI IMPLEMENTATION PART TWO

MENU ENHANCEMENTS USING SAP BADI

SCREEN ENHANCEMENTS USING SAP BADI

IMPLEMENTATION OF SCREEN ENHANCEMENTS USING BADI


BADI IMPLEMENTATION WITH FORMULA BAR

FILTER DEPENDENT BADI IMPLEMENTATION PART ONE

FILTER DEPENDENT BADI IMPLEMENTATION PART TWO

SAP ABAP FILTER DEPENDENT BADI IMPLEMENTATION

BADI AND OTHER ENHANCEMENTS COMPARISON

SAP ABAP BADI PART ONE

ABAP BADI PART TWO

ABAP BADI PART THREE

ABAP BADI PART FOUR

BADI PART FIVE

ABAP BADI PART SIX CALLING BADI AND ITS USES

BADI INTRODUCTION

RELATED POST

ABAP 51 Days Complete Course
ABAP Dictionary
OOPS in ABAP
BDC
SAP Scripts
SAP Scripts Controls
SAP Smart Forms
Real Time ABAP Programming Reports
SAP Interview Questions
Syntax for ABAP Programming
ABAP Interface Programming
Financial and Controlling Sample Reports 

SAP ABAP BADI DEFINATION

Define an interface for the enhancement in the SAP menu under Tools ® ABAP Workbench ® Utilities ® Business Add-Ins (transaction SE18) and call this interface at the appropriate point in their application program. Customers can then select the add-in and implement it according to their needs.

Example:

You want to be able to convert strings in your application program. You also want users to determine how their strings are converted themselves. As the application developer, you define an enhancement consisting of an interface with a method. A changing parameter is used to transfer strings.

To create an add-in like this, proceed as follows:

1. Choose Tools ® ABAP Workbench ® Utilities ® Business Add-Ins (transaction SE18)
from the SAP menu.

2. Enter a name for your Business Add-In containing a maximum of 20 characters.

3. Choose Create.

4. On the subsequent screen, enter a short description for your Business Add-In.

The option SAP internal is used when a developer at SAP provides a business add-in with implementations. If this flag is set, customers cannot create and use their own implementations for this business add-in. The possible entries help does not display business add-ins carrying this flag.

If this enhancement is going to be used multiple times or if you want its implementation to depend on a specific filter value, select the appropriate check box in the category Type.

This example only deals with basic enhancements, therefore neither of these check boxes should be selected.

5. Choose the Interface tab.

The name of the interface, which is generated automatically, now appears. At this time, you can change the name of the interface if you so desire.



7. Confirm that you want to save the entries you have made. Assign your add-in to a package.

8. Use the Class Builder to assign a method to the interface.



9. Now define a parameter with the following attributes:

10. Save and activate your changes. Use the push button Back to navigate back to Business Add-In definition.

If you do not activate your attributes in the Class Builder, the system will not allow you to proceed with Business Add-In definition.

A table control now appears on the definition screen containing the method you have assigned to the interface.

Whenever you assign a method to an interface, the corresponding executing class is generated. The code generated cannot be altered in the initial expansion phase.

11. Save your entries and use the Def.-Docu. push button to create a description for your new Business Add-In. Be aware that this documentation is of great importance in helping end users understand the purpose of your add-in.

Changes made to the interface and changes made to the Business-Add-In definition are always incompatible!

If implementations already exist for a Business-Add-In definition, they are invalidated if you make changes to the interface. This means that their syntax is no longer correct. No statements can be given on the runtime behavior. Try to absolutely avoid making changes to the interface or the Business-Add-In definition after the transport has taken place.

If changes to the interface are inevitable, clean up the method includes for all implementing classes, that is, all classes for which Business-Add-In implementations are used. To do this, in the Class Builder (using transaction SE19, tab Interface, field Name of implementing class) choose Utilities ® Clean up ® Method includes.

Default and Sample Code

In the BAdI Builder, you can choose the Goto menu entry to create, display, change and delete default or sample code.The default implementation is only executed if no other active implementation is available. This applies also to filter-dependent Business Add-Ins.When you create default or sample code, do not forget to save your entries to ensure that the link between the class and the implementation can be established.

Calling Add-Ins from Application Programs

When you define a Business Add-In, enhancement management generates a class that implements your interface. Application developers use factory methods to create instances of these adapter classes in their application programs and call the corresponding method if necessary.

The adapter class methods generated by add-in management decide if multiple active implementations should be called. If necessary, these implementations are subsequently executed. The application program itself simply calls the adapter class methods; it does not know which implementations are actually being called.

RELATED POST



How Customer Relationship management makes company Leader
CRM Uses and how to get best results with CRM
CRM software solutions and mysap advantage

Comparison of Enhancement Techniques in sap abap

Due to the necessity of adjusting R/3 to meet the specific needs of a variety of customers, several different enhancement techniques were developed in the past. A short description of each of the various enhancement techniques follows.

Business Transaction Events (Open FI)

The Open FI enhancement technique was developed in the Financial Accounting component.

Open FI is based upon the following principles:

Application developers must define their interface in a function module, an assignment table is read in the accompanying (generated) code, and the customer modules assigned are called dynamically.This technique differentiates between enhancements that are only allowed to have one implementation and enhancements that can call multiple implementations in any sequence desired. Both industry-specific and country-specific enhancements may be defined.

The concepts behind the Business Add-Ins enhancement technique and Open FI are basically the same. However, the two enhancement techniques do differ from each other in the following points:

Open FI can only be used to make program enhancements, that is, you can only enhance source code using Open FI. You cannot enhance user interface elements with Open FI like you can with Business Add-Ins.

Open FI assumes that enhancement will only take place on three levels (SAP - partners - customers), whereas with Business Add-Ins you can create and implement enhancements in as many software layers as you like.Open FI uses function modules for program enhancements. With Business Add-Ins, ABAP Objects is used to enhance programs.

Enhancements in Transactions SMOD/CMOD

Making enhancements using the transactions SMOD/CMOD has the following disadvantages:

1. This enhancement technique assumes a two-tiered system infrastructure (SAP –customers).
2.The naming conventions in effect do not tolerate name extension.

Conclusion:

None of the techniques mentioned above can easily be extended to fulfill the requirements of a system infrastructure containing country versions, industry solutions, partners, and customers. Business Add-Ins should be considered generalized Business Transaction Events that can be used to  bundle program, menu and screen enhancements into a single add-in. Business Add-Ins can be created and employed in each of the various software levels.

RELATED POST

SAP ABAP BADI IMPORTANCE
MySAP CRM System architecture and design
MySAP CRM architecture and E procurement introduction
MySAP CRM E procurement

SAP ABAP BADI Importance

Business Add-Ins are a new SAP enhancement technique based on ABAP Objects. They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery.Since specific industries often require special functions, SAP allows you to predefine these points in your software.

As with customer exits two different views are available:

1·In the definition view, an application programmer predefines exit points in a Source that allow specific industry sectors, partners, and customers to attach additional software to standard SAP source code without having to modify the original object.

2·In the implementation view, the users of Business Add-Ins can customize the logic they need or use a standard logic if one is available.

In contrast to customer exits, Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions), but instead allow for a multi-level system landscape (SAP, partner, and customer solutions, as well as country versions, industry solutions, and the like).Definitions and implementations of Business Add-Ins can be created at each level within such a system infrastructure.

SAP guarantees the upward compatibility of all Business Add-In interfaces. Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. You do not have to register Business Add-Ins in SSCR.

The Business Add-In enhancement technique differentiates between enhancements that can only be implemented once and enhancements that can be used actively by any number of customers at the same time. In addition, Business Add-Ins can be defined according to filter values. This allows you to control add-in implementation and make it dependent on specific criteria (on a specific Country value, for example).

All ABAP sources, screens, GUIs, and table interfaces created using this Enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard. A single Business Add-In contains all of the interfaces necessary to implement a specific task.

The actual program code is enhanced using ABAP Objects.

RELATED POST

BADI INTRODUCTION
MySAP CRM System architecture and design
CRM data administration in mysap and business intelligence

SAP ABAP BADI INTRODUCTION

Traditional way of doing code modifications – Exits.In three tier Architecture exits are implemented as explained below.

PRESENTATION :

Field Exits
Screen Exits
Menu Exits

APPLICATION:

Programs -> Program exits -> call customer function -> Include

DATABASE

Table -> SE11 -> Goto -> Append Structure
With BAdIs you can make changes only at the Application Layer.

The traditional way of doing code modifications was via User exits.

As per SAP’s 3 Tier Architecture, at the Presentation layer you had Field Exits, Screen Exits and Menu Exits. At the Application layer you had Program exits, at the Database layer you could Append structures to the existing SAP structures.

Business Add-Ins are a new SAP enhancement technique based on ABAP Objects.

They can be inserted into the SAP system based on specific user requirements.

Business Add-Ins should be considered generalized Business Transaction Events that can be used to bundle program, menu and screen enhancements into a single add-in.

In order to enhance a program a Business Add-In must first be defined and

Subsequently two classes are automatically generated :

An interface with ‘IF_EX_’ inserted between the first and second characters of the BAdI name

An adapter class with ‘CL_EX_’ inserted between the first and second characters of the BAdI name.

The Application developer creates an interface for this Add-In.

Enhancement management generates an adapter class for implementing the interface.

This opens a path for custom implementations to be created by partners or customers.

By instantiating the adapter class in the application program, its corresponding methods can be used.

In Business Add-Ins, all the components of an enhancement option are grouped together.

They are

1. Program Enhancements: Functional enhancement of the program are defined in the form of interface methods and can be used with or without Menu Enhancements or Screen enhancements.

2. Menu Enhancements: Function codes can be entered for a BAdI for the corresponding menu entries in the user interface definition.

3. Screen Enhancements: Subscreen areas can be entered for a Business Add-In.

Screen enhancements can be implemented for these in the form of subscreen screens.

Each Business Add-In has :

1. at least one Business Add-In definition
2. a Business Add-In interface
3. a Business Add-In class that implements the interface


RELATED POST

SAP ABAP SYNTAX FOR FORM PART TWO
BADI COMPLETE OVER VIEW
MySAP CRM business intelligence at work
CRM data administration in mysap and business intelligence

Calling a BADI and uses

Calling Badi in the Application

  1. When we define BAdi, enhancement management generates a class that implements the interface. The application developer uses a factory method to create an instance of adapter class in the application program and calls corresponding method. The adapter class method generated by the enhancement management decide by checking the entries in the table whether one or several active implementations need to be called. If required, the implementations are subsequently executed. The application program ensures only the adapter class method is called. The application program doesn’t know which implementations are called.
  2. Call the string conversion Business Add-in, the program calling the Business Add-in. Following is the ABAP source code

REPORT ZMPTEST_BADI.
* Declaring the handler
class: cl_exithandler definition load.
* Interface Reference
data: badi_interface type ref to ZIF_EX_BUSINESSADDIN.
* String
data: w_str(15) type c value 'baddi test'.
*************************************************
****Start of Selection Event.....................
************************************************
start-of-selection.
call method cl_exithandler=>get_instance
changing
instance = badi_interface.
write: / 'Please click here'.
*************************************************
****At line-selection Event.....................
************************************************
at line-selection.
write: / 'original word', w_str.
if not badi_interface is initial.
call method badi_interface->conversion
changing parameter = w_str.
endif.
write: / 'Converted word', w_str.

Filter dependent Badi

  1. Business Add-in definition level (for example a country, industry sector) we can have filter dependent option. If an enhancement for country specific versions then it is likely that different partners can implement this enhancement. The individual countries can create and activate their own implementation.
  2. In the enhancement definition, all the methods created in the enhancement’s interface need to have filter value as their importing parameter. The application program provides the filter values for the implementation method.
  3. Filter dependent BAdi is called using one filter value only, it is possible to check active implementation for the filter value using the function module SXC_EXIT_CHECK_ACTIVE.

Multiple use Badi

  1. There are multiple use and single use Business Add-ins. This option can be choose at Business Add-in definition.
  2. The distinction is base on the procedure or event character of an enhancement. In the first case the program waits for the enhancement to return a return code. Typical example is benefit calculation in HR depending on the implementation, alternative calculations can be executed. In case of multiple use add-ins, an event that may be interest to other components in program flow. Any number of components could use this event as a hook to hang their own additional actions on to.
  3. There is no sequence control for multiple-use implementations of BAdi’s. Sequence control is technically impossible, at the time of the definition the interface does not know which implementations parameters will be change the implementations.
  4. The concept of multiple use of the Business Add-in is that has been implemented once already can be implemented again by right of the software chain.

Difference between different enhancement technique with BADI

  1. Difference between Business Transaction Events and BADI’s.
  1. The concept of the BADI is similar to Business Transaction Events (Open FI). BTE’s was developed specific to Financial Accounting module. But were as BADI’s was developed in generalised to all modules.
  2. BTE’s can only be used to make the program enhancements. You cannot enhance user interface with Open FI, but you can with Business Add-ins.
  3. Open FI assumes that enhancement can only take place on three levels i.e. SAP- partners – customers, but in case of BAdi’s you can create and implement enhancements in as many software layers as you like.
  4. Function modules are used for program enhancements in Open FI. With BAdi’s, ABAP Objects is used to enhance programs.
  1. Difference between customer exits and BAdi’s.
  1. Customer exits assume a two-tiered system infrastructure (SAP - Customers). Where as in case of BAdi’s you can created and implement enhancements in as many software layers as you like.
  2. BAdi’s are considered as generalized BTE’s that can be used to bundle program, menu and screen enhancements into a single add-in. BAdi’s can be created and employed in each of the various software levels.

Advantages of BADI’s

  1. This enhancement technique has the advantage of being based on a multi-level system landscape (SAP, country versions, IS solutions, partner, customer and so on).
  2. We can create definitions and implementations of business add-ins at any level of the system landscape.TRE
  1. Following are the Tables which are relevant to BAdi’s
SOME IMPORTENT BADI'S
  1. SXS_ATTRT - BAdi Definition list
  2. V_EXT_ACT - Active implementations of an exit
  3. V_EXT_ IMP - Implementation class for an interface+filter
  4. V_EXT_M - BAdi’s with filters
  1. Transaction related to BAdi’s
  1. SE18 - Business Add-in builder
  2. SE19 – Implementation of Badi
  3. SE24 – Class/Interface Builder