From Temp.

doc : Exits

what are user exits and customer exits ?
what is the difference between user exits and customer exits Customer exits are provided to the customer in the form of Function Module which holds the include in the customer namespace. The user can add his/her own source code in it. This is technically an enhancement. E.g. for customer exits are Function module exits, Menu Exits, Screen Exits, Field Exits.

Customer exits are implemented in Z-includes and are ENHANCEMENTS to the system. You are not writing the code directly in the function module, but in the include that is implemented in the function module.

User exists are empty subroutines that the SAP Developers have provided for you that u can fill with your own source code. This is technically a modification since the object in the SAP name space is modified. Eg : Include MV45AFZZ which have different forms which are called during the sales order creation/change. User-exits were firstly intended to be developed for the SD module. You make your coding in includes in SAP namespace (e.g MV*). That's why, user exits are MODIFICATIONS to the system. In includes for user exits there are empty subroutines ( generally with the name convention "userexit_...") and you code using global variables of the main program.

User exits are predefined includes provided by SAP with some subroutines that start with "userexit-" you can put your code in these subroutines so that they are executed.

The naming standard of function modules for function module exits is: EXIT_<program name><3 digit suffix> The call to a function module exit is implemented as: CALL CUSTOMER.-FUNCTION <3 digit suffix>

9341636402 how to search for user exits and customer exits ?

How to implement user exits and customer exits ?

How to implement Field exits , Screen Exits and Menu Exits ?

because it will commits internally, no need to mention explicitly

User-Exits can be found in no. of ways: 1 way: To find user exits in SD module , go to object navigator(SE80) and select development class from the list and enter VMOD in it. All of the user exits in SD are contained in the development class VMOD. Press enter and you will find all the includes which contain user exits in SD for different functions like PRICING, ORDER PROCESSING etc. Select the user exit according to the requirement and read the comment inserted in it and start coding. FIELD EXITS The field exits are managed, created, activated through program RSMODPRF. The field exit is associated with a data element existing in ABAP dictionary and hence to the screen field using that data element. The format of field exit is : FIELD_EXIT_dataelement_A-Z or 0-9 ± OUTDATED ! To find a Exit. Go to Transaction -- Find The Package SMOD -->f4-->Use the Package here to Find the Exits In the Package. Else if you Want to search by Application Area wise , There is one more tab to find the Exits in the Respective Application Area. Implementing the Exit-- CMOD --Create Projects--Assign your Component . Now Run ur Transaction to Check if it Triggers. That¶s it..

1. Type the transaction : system->status-> <PROG. NAME> 2 open SE37 , type EXIT*<PROG NAME>* and press F4 to get the list of function exits available. 3. Open CMOD utilities->SAP enhancements EDIT->All selections 4.type the function module name obtained in step 2, in fields 'component name' in 'additional selections' block. and execute. 5. The displayed list contains the enhancements names for the transaction You were looking for. 6. Create a project in CMOD and the code in default include->activate. http://www.erpgenie.com/sap/abap/code/abap26.htm which gives the list of exits for a tcode

If you need to find any exits for particular transaction, you go to that Tcode and go to --> system --> status. Then there you double click on the tcode, after that you will be finding the package name. Make a note of that particular package. Then, Go to SMOD --> click F4, then you will be shown a pop up, click on Information system, after that you give the package there. Then you will be shown the list of all the exits for that particular transaction.

in order to find out the user exits for any tcode, 1. get the developement class of the tcode from SE93. 2. Now goto transaction SMOD and press F4, 3. give in the Deve class in the dev class and Press ENTER or set break-point in FM MODX_FUNCTION_ACTIVE_CHECK VIA se37, when we run the TCode, check the contents of the field 'l_funcname'

Finding of Exits : 1. On which screen u want to know whether there is an exit or not... go to that screen / tcode and in the

menu path System --> Status .. get the Program Name .. 2. Double click on the Program Name (which goes into the program ....) and 3. Click on the "Search/Find" button in the standard toolbar and find for the keyword "CALL CUSTOMERFUNCTION".. If there are any results then u will come to know that there are exit provisions for that tcode 4. get the Function module name and go to SE84 (repository information browser) Click on Enhancments node --> Customer Exits --> Enhancements and give the Function module name in the Selection screen called "Component name" (which u can see by expanding the selection criteria ... then if u press F8 (execute) u can see the list of Exits .... from which u can select the Exit u want (either from then description / from the input and o/p parameters u can get that )

One simple way is to navigate to the program of the TCODE (Goto System->status). In the program you search for CALL CUSTOMER or CL_EXIT_HANDLER and also you can search for exit . This will give you an initial idea if at all there is any exit in the program

Is their any procedure to find exits for a particular screen Some people use a small "specific abap". ( search the forum for 'Z_FIND_USEREXIT' ). Otherwise Use the Matchcode in Smod. How to find out exits are already implemented to a particular tcode. Check MODACT Table in the project put Z* and Execute u will get all the projects and exits that are implemented

Go to tcode --> system --> status ... U get the program name .. then goto GOTO --> Attributes --> get the package name .. Now go to transaction SE80 --> Repository Information System --> Enhancements --> Customer Exits -> Enhancements --> now give the package name in the selection screen ...... and execute ... u'll get all the user exits name .....

Execute this code. IT will give u all the exits. report zuserexit no standard page heading. tables : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir. tables : tstct.

data : jtab like tadir occurs 0 with header line. data : field1(30). data : v_devclass like tadir-devclass. parameters : p_tcode like tstc-tcode obligatory.
select single * from tstc where tcode eq p_tcode. if sy-subrc eq 0. select single * from tadir where pgmid = 'R3TR' and object = 'PROG' and obj_name = tstc-pgmna. move : tadir-devclass to v_devclass. if sy-subrc ne 0. select single * from trdir where name = tstc-pgmna. if trdir-subc eq 'F'. select single * from tfdir where pname = tstc-pgmna. select single * from enlfdir where funcname = tfdir-funcname. select single * from tadir where pgmid = 'R3TR' and object = 'FUGR' and obj_name eq enlfdir-area. move : tadir-devclass to v_devclass. endif. endif. select * from tadir into table jtab where pgmid = 'R3TR' and object = 'SMOD' and devclass = v_devclass. select single * from tstct where sprsl eq sy-langu and tcode eq p_tcode. format color col_positive intensified off. write:/(19) 'Transaction Code - ', 20(20) p_tcode, 45(50) tstct-ttext. skip. if not jtab[] is initial. write:/(95) sy-uline. format color col_heading intensified on. write:/1 sy-vline, 2 'Exit Name', 21 sy-vline , 22 'Description', 95 sy-vline. write:/(95) sy-uline. loop at jtab. select single * from modsapt where sprsl = sy-langu and name = jtab-obj_name. format color col_normal intensified off. write:/1 sy-vline, 2 jtab-obj_name hotspot on, 21 sy-vline , 22 modsapt-modtext, 95 sy-vline. endloop. write:/(95) sy-uline.

set parameter id 'MON' field sy-lisel+1(10). check field1(4) eq 'JTAB'. endif. at line-selection.g MV*). else. SAP creates customer exits for specific programs. format color col_negative intensified on. Instead. the customer exits act as hooks. write:/ 'No of Exits:' . User-exits were firstly intended to be developed for the SD module. screens. else. TC CMOD the exits are: EXIT_SAPLRSAP_001 for transactional data EXIT_SAPLRSAP_002 for master data EXIT_SAPLRSAP_003 for texts EXIT_SAPLRSAP_004 for hierarchies . get cursor field field1. endif. "The R/3 enhancement concept allows you to add your own functionality to SAP¶s standard business applications without having to modify the original applications. These exits do not contain any functionality. and menus within standard R/3 applications. You make your coding in includes in SAP namespace (e. skip. user exits are MODIFICATIONS to the system." Customer exits are implemented in Z-includes and are ENHANCEMENTS to the system. format color col_total intensified on. sy-tfill.describe table jtab. 2) Customer exit --tc SMOD. You can hang your own add-on functionality onto these hooks. format color col_negative intensified on. That's why. write:/(95) 'Transaction Code Does Not Exist'. write:/(95) 'No User Exit exists'. call transaction 'SMOD' and skip first screen.

. it can be changed and if you want to de-activate it. * Once a customer exit has been implemented in an SAP system.com/thread. a customer exit can have a maximum of one implementation ?? >>> Yes.sap. comment the source code you had added. that implementation can be changed. but it cannot be deactivated any more ?? >>> Yes. it will result in sy-subrc not equal to '0'.implemented a component. * Once a customer exit has been implemented in an SAP system.++ i simply tried out this..sdn.jspa?messageID=10094639#10094639 . but it cannot be deactivated any more Yes. generally developers use these terms without this distinction. it can be changed and if you want to de-activate it. thats true.jspa?messageID=9949467#9949467 http://forums. comment the source code you had added.so deactivation is possible isn't it.within one SAP system.no necessary to go for commenting instead of deactivation?? http://forums.sdn.changed it. the program offering this customer exit will dump (terminate abnormally) at runtime ? >>> The program will not result in Dump.com/thread.and still i could deactivate my enhancement project.But. * If a customer exit is not implemented. someone may mean a "customer exit" when (s)he says "user exit" or vice-versa.. So. that implementation can be changed.sap. * since customer exits are cross clients. If Customer exit is not implemented.

country versions. To unify enhancements of the SAP Standard you can migrate customer exits to business add-ins. IS solutions. Among others. You can create definitions and implementations of business add-ins at any level of the system landscape. partner.SAP.com Customer Exits Important Note: As of Release 4.6A SAP provides a new enhancement technique. this enhancement technique has the advantage of being based on a multi-level system landscape (SAP. and so on) instead of a twolevel landscape (SAP. customer. the Business AddIns. customer) as with the customer exits. .From Help.

customer objects¶ names ensure that they will not be affected by any changes or new additions to the standard software package. They do not affect software updates. you should take advantage of the exits available in standard applications. When it comes time to upgrade a to a new software release. in order to preserve the functionality of the enhancement. Instead. Enhancements to the SAP Standard with Customer Exits Types of Exits Locating Applications that Have Exits Creating an Add-On Project Activating and Deactivating a Project Transporting Add-On Projects Creating Customer-Specific Menus Creating Customer-Specific Subscreens Creating Customer-Specific Function Modules Enhancements to the SAP Standard with Customer Exits The enhancement concept allows you to add your own functionality to SAP¶s standard business applications without having to modify the original applications. SAP creates customer exits for specific programs. These exits do not contain any functionality. you do not alter the source code of standard SAP programs in any way. The code and screens you create are encapsulated as separate objects. . start migration in transaction SPAU via a button. the customer exits act as hooks. If you want to enhance the functionality of your SAP System. you can still use the technique described below to add your own functionality to standard applications. When you add new functionality to your SAP System using SAP¶s exits.6A. After the upgrade. You find find more information about locating applications with pre-defined exits in Locating Applications that have Exits. Add-ons attached to exits have the advantage that: They do not affect standard SAP source code. You can hang your own add-on functionality onto these hooks. When you add new functionality to your SAP System using SAP¶s exits. There are two main reasons why you should use exits rather than modifying SAP software yourself. These customer objects are linked to standard applications. and menus within standard applications. screens. If no migration was executed for customer exits created prior to Release 4. Customer exits are not available for all programs and screens found in the SAP System. the enhancement projects of the customer that belong to the customer exits must be migrated to implementations of business add-ins. You can only use customer exits if they already exist in the SAP System. your objects (called customer objects) must adhere to strict naming conventions.If you used transaction SMOD to migrate customer exits. but exist separately from SAP¶s standard software package.

If you do not know the name of a specific enhancement package. SAP creates screen exits by placing special subscreen areas on a standard screen and calling a customer subscreen from the standard screen¶s flow logic. you can search for enhancements by development class. From Release 4. Choose Utilities pEnhancements pProject management from the ABAP Workbench menu. SAP creates menu exits by defining special menu items in the Menu Painter. Menu Exits Menu exits add items to the pulldown menus in standard SAP applications. Screen Exits Screen exits add fields to screens in applications. To list all enhancements in the entire system. choose the Execute function without specifying any selection criteria. These special entries have function codes that begin with ³+´ (a plus sign). For this reason. Locating Applications that Have Exits You can only take advantage of exits if SAP has added them to one of its standard applications. These calls have the following syntax: CALL CUSTOMERFUNCTION µ001¶. Each of these exits acts as hooks where you can attach or ³hang´ your own add-ons. When you add a new menu item to a standard pulldown menu. choose Utilities p SAP enhancements to call a selection screen that lets you look for the exits available in standard applications.5A. Function Module Exits Function module exits add functions to applications. SAP application developers create function module exits by writing calls to customer functions into the source code of standard programs. . you can change field texts on screens and add data element documentation using the Modification Assistant. You specify the menu item¶s text when activating the item in an add-on project. You can use these menu items to call up your own screens or to trigger entire add-on applications.Types of Exits There are several different types of customer exits. Each SAP enhancement can contain many individual exits. you need to know how to locate the exits available in the SAP System. Function module exits play a role in both menu and screen exits. Function module exits also control the data flow between standard programs and screen exit fields. you use a function module exit to define the actions that should take place once your menu is activated. SAP organizes its exits in packages are called SAP enhancements. From here.

4. The system offers a selection screen that allows you to narrow down your search. You can also display a list of each enhancement¶s different exit types. You can access the application hierarchy by choosing ABAP Workbench p Overview p Application hierarchy The SAP Application Hierarchy lists all of the standard SAP applications and their component parts. The system will retrieve all the enhancements assigned the category you marked in the Application Hierarchy. You can use the hierarchy with the Repository Information System to locate exits available for specific applications or programs./desel. Choose Execute. The system marks the application area. Choose either Enhancements or Projects for specific customer exit by double-clicking. Choose Repository Infosys. To locate the exits associated with Materials Management. sub-tree. One enhancement package. select the enhancement and choose the Display icon. You can leave the fields on this screen empty. for example. .The system displays a list of all enhancement packages. might contain several menu exits and function module exits. proceed as follows: 1. Expand the Environment sub-tree in the Repository Information System. From within this list. To display the individual exits that each enhancement package contains. 5. The system lets you search for any objects assigned to a particular application. and a single screen exit. 3. you can display the documentation for each enhancement. Place the cursor on the Materials Management branch of the Application Hierarchy tree and choose Sel. You can also double-click on any enhancement in the list to go to the transaction that SAP uses to manage its enhancements. Expand the Exit Techniques sub-tree. for example. 2. Searching in the Application Hierarchy You can also use the Application Hierarchy to search for exits that are available for a particular application area.

Give your project a name that indicates the type of functions it contains and that shows which transactions are affected. all of the addons created within this project are activated as well. If you are working on enhancements that deal with different applications. 2. appear in standard applications. The system then prompts you to assign a change request. you need to decide which application. 3. or if the enhancements are not logically related. choose Utilities p Enhancements p Project management. you can include all of these enhancements in the same project. you need to create an add-on project. To create an add-on project from within the ABAP Workbench menu. such as menu items or screen fields. There are two factors you need to keep in mind when you create an add-on project. Choose Create. After you have specified the name of your new project. proceed as follows: 1.Creating an Add-On Project To take advantage of the exits available in standard applications. For example. as well as the add-ons that you develop to attach to these exits (like menu entries or function modules). 4. For this reason. if you are planning to use several enhancements that deal with Materials Management modules. This assignment allows you to transport the project and its components into a productive system once you have completed it. you can include an SAP enhancement package and the customer exits it contains in one project only. Choose Save. You should choose enhancement packages that logically belong together. First. It may be useful to agree upon a company-wide naming convention for enhancement projects. It is not possible to activate exits individually. application component. The same SAP enhancement may not appear in two separate customer projects. When you activate a project. . Enter the names of these SAP enhancements in the spaces provided. Before you begin defining a project. The add-on project also allows you to hang add-on functionality onto the exit hooks contained with SAP enhancements. or specific standard transaction you would like to add your own functionality to. 5. Second. you must activate your add-on project. Specify which SAP enhancement packages you want to include in your project by choosing SAP enhancements. Describe the nature of the project by providing a short descriptive text. you should include these enhancements in separate projects. This project lets you organize the enhancement packages and exits you want to use. you should ensure that the exits you include in your project contain functions that can be activated simultaneously. Managing an Add-On Project An add-on project contains a series of exits. in order to make your add-ons.

you can begin adding your own functions to the exits offered in the enhancements. Activating a project turns on all your add-ons. You cannot activate individual add-ons separately. Choose Activate project. return to the main screen of the Project Management transaction and choose Enhancement components The system displays all of the exits included in the enhancements assigned to your project. To display the individual components of the SAP enhancements. To deactivate an add-on project. When you activate your project. The system confirms that the project was deactivated. You can now call up any standard SAP transaction that contains an exit you used in your add-on project. Call the Project management transaction. You also need to activate your project after you have transported it from a development system into a productive system. To activate an add-on project. the system turns on all add-ons that the project contains. The newly added add-on function(s) should appear. Activating and Deactivating a Project After you have attached add-on functionality to the exits in your project. 2. The system displays a message confirming that the project was activated. . proceed as follows: 1. you need to activate the project. you must first deactivate the project that contains that add-on. 2. you can make changes to the project¶s add-ons or build new functions and attach them to other exits in the project. Call the Project management transaction. If you need to make changes to any of your add-ons. Deactivating a project turns off all of that project¶s add-ons. Once the project is turned off.Once you have identified the SAP enhancements you want to include in your project. proceed as follows: 1. Choose Deactivate.

From the main screen of the Project management transaction.Transporting Add-on Projects To take advantage of exits in the SAP System. 2. you must assign the project to a change task. If your project is spread out over more than one change task.. Your add-on project also encompasses all add-on functions you create and attach to the exit "hooks". 1. It also displays two input fields where you can specify a language and the text you want your menu item to have. you should assign these tasks to the same change request. The system displays technical information about the menu entry. You also need to assign all of your add-on components (include programs. 1. you must create an add-on project. you must include the SAP enhancement package that contains the menu exit you want to use in your project. subscreens. To take advantage of a menu exit. Select Enhancement components and choose Change. proceed as follows: 1. release your change tasks. Choose Edit component. The system will export your add-on project and coordinate its import into a either a consolidation system or productive system. Creating Customer-Specific Menus Menu exits allow you to add your own functions to the pulldown menus in standard transactions. When you first create an add-on project. . 3. Once you have completed your project. Then. release the change request that contains all the change tasks for your project.. As a final step. 2. 3. The system lists all customer exits contained in the enhancements included in your project. . Check to make sure that your add-on project is active in this system. Place the cursor on the menu exit you want to add your own function to. you first need to create a project as described in the section Creating an add-on project. and menu texts) a change task number. This project contains at least one SAP enhancement package and all of the user exits assigned to this package.

4. your menu item will appear. The system lists all customer exits contained in the enhancements included in your project. Then. 5. To attach your menu entry to its corresponding function.4. 2. 1. . Create your subscreen using the Screen Painter. The system then transfers you to the Screen Painter. you must include the SAP enhancement that contains the screen exit you want to use in your project. Your special menu function will not appear in the pulldown menu of the corresponding standard transaction until you activate your enhancement project. Use the development class that contains all of the objects created for this specific enhancement project. . The system prompts you to enter a development class for your subscreen. Enter the name of your menu function (such as Special order method) in the field New text. you need to create a function module for the function module exit associated with your menu text.. To take advantage of customer-specific subscreens. 3. From the main screen of the Project management transaction. but it will not call a corresponding function. 5. proceed as follows: 2. Place the cursor on the screen exit you want to create your own subscreen for. you first need to create projects as described in the section Creating an add-on project. Creating Customer-Specific Subscreens Screen exits allow you to add your own fields to specified screens in standard transactions. After you carry out these steps. Choose Save text. 4. Creating Customer-Specific Function Modules tells you more about how to use function module exits. Specifying a menu text and activating your project are not the only steps you need to take to make your own menu item work. This function module exit is part of the same SAP enhancement that contains the menu exit you used.. Choose Edit component. Select Enhancement components and choose Change.

The function module exits in these PBO and PAI modules are only activated if you create actual modules for each exit. the fields defined in your subscreen will appear in the standard transaction.5. Using Predefined Screen Data When you use a screen exit. SAP creates special flow logic modules when defining screen exits. Once you activate your enhancement project. SAP creates a special Process Before Output module (PBO module) with a function module exit. you need to be aware of how your subscreen and the fields it contains relate to the data on the standard screen. Creating Customer-Specific Function Modules Function module exits allow you to implement your own functions and processing logic in standard SAP programs. refer to the section Creating customer-specific function modules. 6. Add modules to the screen flow logic as needed. you can only transfer values to and from your subscreen if they correspond to the parameters determined in the existing function module exit interface. You can use this function module exit to transfer specific field values from the SAP program to your customer subscreen. then double-click on the module name and the system automatically creates the module in the corresponding function module program. proceed as follows: . Then. the fields you use in your subscreen are not known to the SAP program in which they appear. SAP also includes a Process After Input (PAI) module that has a function module exit for transferring values back from your subscreen to the SAP program. you first need to create a project as described in the section Creating an Add-on Project. To take advantage of a function module exit. For more information on how to create customer-specific function modules. To compensate for this problem. you must include the SAP enhancement that contains the function module exit you want to use in your project. The global data defined in the standard SAP program is not known to the program that controls your customer subscreen. From the main screen of the Project management transaction. As a result. Generate your screen and choose Back (the green arrow) to return to the Project management transaction. The import and export parameters for the PBO and PAI function module exits are predefined by SAP. In the same way. Enter the name of the module in the flow logic editor.

6. When defining function module calls in its standard program. Select Enhancement components and choose Change. 4. You can only transfer values to and from your include program if these values are included in the function module¶s predefined interface. 3. proceed as follows: . You can copy this sample code into your include program.. 2. The system asks you if you want to create the include program. The system displays the exit¶s corresponding function module. 7. Choose Edit component. you need to be aware of how your function module fits into the program logic of the standard program that calls it.. 2. If the customer function call includes import and export parameters. You can fill this module with functions you want by calling the include program (called ZXnnnU01) contained within the module and inserting your own source code into it. The system lists all the customer exits contained within the enhancements included in your project. Using Predefined Interface Parameters When you use a function module exit. Call the function module¶s include program by double-clicking on it. You can not make changes to the general framework or to the interface of a function module exit¶s function module. Return to the Project management transaction.. . be aware of the restrictions set by the function module exit¶s interface. 5. Create and save a customer include program as described in steps 1 .. Save your include program. Using Sample Code Provided by SAP SAP sometimes supplies sample coding for the function module exits it provides. 1. SAP specifies exactly what data can be transferred to and from the standard program.3. . which has been prepared by an SAP application developer.6 of the section on Creating Customer-specific Function Modules. Both the function module and the include program lie within the namespace reserved for customers. 3. You are only allowed to use the special include program it contains to add your own programming logic. the customer function module will itself have the same predefined interface. To use sample code. Confirm that you want to create the include program. Enter your function¶s source code in the editor. 1. Place the cursor on the function module exit you want to use. When you create the source code for your include program. Display the exits in your project and place the cursor on the function modules exit you created an include program for.

If sample code exits.. . 3. the system appends the sample to your code. Since the routine does not yet exist. Enter the name of the field or internal table you want to define in the editor. since no data definition exists for it yet. Global data is required if.. the system asks if you wish to create it. Use this include to store all of the data definitions for your function module exit(s). Confirm that you want to create a new subroutine. The system automatically creates an include called ZXnnnZZZ. where nnn stands for the other characters in the function group. Double-click on the field or table name. where nnn stands for the other characters in the function group. You may call these routines from within your customer include program. 2. 1. Choose Edit p Use SAP source code. Double-click on the subroutine¶s name. 1. You are free to alter the sample code as needed. where nnn stands for the other characters in the function group. These predefined subroutines are stored in an include called LXnnnF00. for example. 3. use forward navigation in the ABAP Workbench and proceed as follows: Proceed as follows to create new subroutines: 5. The system automatically creates a new include called ZXnnnTOP. Take advantage of the ABAP Workbench¶s navigational features when creating global data definitions: 4. the system copies this code to your include program. 2. Open the editor and write the keyword PERFORM. followed by the name of your subroutine. SAP provides subroutines with a function module exit. All global data defined by SAP is stored in an include called LXnnnTOP.4. . Creating Subroutines SAP may include pre-programmed subroutines in certain function module exits. You can define your own global data in any function module exit. This include should contain all subroutines used in your customer function modules. Declaring Global Data SAP often supplies function module exits with predefined global data. The system asks you if you want to define the object. Confirm that you want to create a new data definition. .. To create new subroutines. You can also create your own subroutines.. If you have already written your own code in the include program.

The system creates the modules. At the same time. Write the command CALL SCREEN xxx in the editor.. Enter the modules¶ names in the Flow Logic Editor. the system creates include programs that adhere to SAP¶s naming standards. . The system asks if you want to create the screen and then branches to the Screen Painter. you should not use the keywords FORM and ENDFORM in this include. Double-click on each name. Calling Your Own Screens You can call your own screens from within a customer function module. These documentation exits differ from the other exits described in this document in several ways: SAP application developers do not need to prepare special exits for data elements. To create PBO and PAI modules.. Creating Customer-specific Documentation SAP¶s enhancement concept allows you to create your own keywords and online help documentation for all data elements stored in the Repository. you might want to call a screen that lets users carry out certain processes not available in a standard transaction.. Proceed as follows: 6. .The central include program (called ZXnnnU01) contains the commands FUNCTION and ENDFUNCTION. Double-click on the screen number. proceed as follows: 7. 2. 2. You can customize the texts of all standard data elements in your SAP System. Use Workbench navigation to create any other program objects (like events) that you want to include in your function module. 1. where xxx stands for the screen number. For example. Therefore. Use forward navigation in the ABAP Workbench to create your own screens and their flow logic.. 1. .

¶ you might want to identify the field as µCorporate ID. The system displays a dialog box. identifies the first part of a customer¶s international company number. To create your own keyword and short text documentation.1 Company number 1 You might want to change these keywords to reflect your company¶s own terminology. 3. Any changes you make to a keyword with the enhancement concept will not appear in standard screens that do not retain a direct reference to the modifed data element. Instead of µCompany number 1. The system uses keywords on screens to identify entry fields. If SAP deliberately modifies a keyword on a standard screen. You can identify such screen-specific modifications by looking in the Screen Painter. for example. Your own keyword will not appear. If an µx¶ appears. This brief text appears whenever a user calls up online help for that field with F1.. choose Ref. Data elements can have up to three keywords of varying lengths. If you want to see a list of all the screens where this data element appears.. proceed as follows: . Creating Your Own Keywords and Short Texts You can use the enhancement concept to create your own keywords for data elements stored in the ABAP Dictionary.You do not need to create an enhancement project to create your own documentation for data elements. Choose Change from the application toolbar. to screen before proceeding to the next step. your new texts will appear in all SAP screens where any field directly refers to the data element your altered. direct reference to the original data element is dissolved. Choose Text enhancements p Key words p Change. The standard keywords for this data element in the ABAP Dictionary are: Company no. Display the field¶s screen attributes and examine the field Modific. 4. no. Enter the Project management transaction by choosing Utilities p Enhancements p Project management from the ABAP Workbench menu 2. The enhancement concept also allows you to alter a data element¶s short description (short text). . Enter the name of data element. The data element BBBNR. The reference list shows you how many standard screens your new documentation will affect. the SAP developer modified the data element¶s key word. 1 Comp. Your own documentation texts are not affected when you activate and deactivate enhancement projects.¶ If you change the keywords using the enhancement concept. 1.

4. Choose Text enhancements p Key words p Restore SAP version. Choose Create. This program goes through all data elements in your SAP System and restores the standard texts where required. The standard documentation for the data element BBBNR reads: µHere. If you want to list all the data elements in your system that you have created customer-specific key words for. 6. Call the Project management transaction by choosing Utilities p Enhancements p Project management from the ABAP Workbench menu. 6. You can enhance this documentation with additional information that your users may need. Choose Change from the application toolbar.. To write your own field documentation. The system displays this documentation whenever a user chooses F1 to get more information about a screen field. 5. 2. You can restore the standard texts from the main screen of the Project management transaction. 1. 3. you enter the first 7 digits of the international location number¶. The reference list shows you how many standard screens your new documentation will affect. proceed as follows: .. to screen before proceeding to the next step. Edit the data element¶s keywords and short text. ensure that the checkbox labelled Make available SAP documentation in the form of an INCL is activated. . Creating Your Own Online Documentation The enhancement concept allows you to create your own online documentation for all data elements in the ABAP Dictionary. choose Ref. Restoring SAP and Customer Versions At some point you may want to restore all standard SAP keywords and short texts for data elements that you may have altered. The system displays a dialog box. Specify the SAP release from which the texts are to be restored. Save your changes. On the next screen. The restoration function is carried out by a special program that runs in the background. If you want to see a list of all the screens where this data element appears. Choose Text enhancements p Data elements p New DE cust. return to the main screen of the Project management transaction and choose Text enhancements p Key words p Display. The system displays all altered data elements and shows which changes were made. docu.5. Specify the data element¶s name.

industry solutions.7. You can create definitions and implementations of Business Add-Ins at any level of the system landscape. Write your own documentation. In the implementation view. . SAP allows you to predefine these points in your software. and customers to attach additional coding to standard SAP source code without having to modify the original object. As with y customer exits. y In contrast to customer exits. two different views are available: In the definition view. customer. Since specific industries often require special functions. Business Add-Ins Business add-ins are enhancements to the standard version of the system. partner. 8. and so on). They can be inserted into the SAP System to accommodate user requirements too specific to be included in the standard delivery. Save your changes. an application programmer defines exit points in a source that allow specific industry sectors. partners. countryspecific versions. but instead allow for a multi-level system landscape (SAP. the users of Business Add-Ins can customize the logic they need or use a standard solution if one is available. Business Add-Ins no longer assume a two-level infrastructure (SAP and customer solutions).

This allows you to differentiate between Add-In implementations using the filter Country or other criteria. we recommend reading the section ABAP Objects. refer to the following sections: Architecture of the Enhancement Technique Compare with Existing Techniques Definition of a Business Add-In Calling an Add-In in the Application Program Implementing a Business Add-In Filter-Dependent Business Add-Ins Multiple Use Business Add-Ins Menu Enhancements Screen Enhancements Procedure for Importing Business Add-Ins . Release upgrades do not affect enhancement calls from within the standard software nor do they affect the validity of call interfaces. In addition. All ABAP sources. In order to better understand the enhancement technique behind the Business Add. and table interfaces created using this enhancement technique are defined in a manner that allows customers to include their own enhancements in the standard. 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. GUIs. A single Business Add-In contains all of the interfaces necessary to implement a specific task. screens. You do not have to register Business Add-Ins in SSCR. For more information. The actual program code is enhanced using ABAP Objects. Business Add-Ins can be defined according to filter values.SAP guarantees the upward compatibility of all Business Add-In interfaces.

the adapter class ensures that only certain implementations will be executed. and so on. The developer then creates an instance of the adapter class in the application program and calls the corresponding method at the appropriate time. The generated class (Add-In adapter) has the following tasks: y Control The adapter class calls the active implementations. partner. From this.  y Filtering If a Business Add-In is to be executed only under certain conditions.Architecture of the Enhancement Technique In order to enhance a program. For each Business Add-In you have one interface and an adapter class that implements this. enhancement management creates an adapter class that implements the interface and thus provides the interface for implementation by the customer. . you must first define a Business Add-In. The application developer creates an interface for the add-in. The interface is implemented by the user.

The following sections contain examples of program. the two enhancement techniques do differ from each other in the following points:  Open FI can only be used to make program enhancements. several different enhancement techniques were developed in the past. an assignment table is read in the accompanying (generated) code. Business Add-In implementations are created in the respective implementation namespace. that is. whereas with Business Add-Ins you can create and implement enhancements in as many software layers as you like. Customers can find the enhancements in their system in the Implementation Guide (IMG) and in the component hierarchy.partners . A Comparison of Different Enhancement Techniques Due to the necessity of adjusting the SAP System to meet the specific needs of a variety of customers.This concept ensures mutlple use. The customer must implement the methods and the enhancements. a Business Add-In contains an interface and other additional components such as function codes for menu enhancements. The concepts behind the Business Add-Ins enhancement technique and Open FI are basically the same. and generated classes are all located in the appropriate application development namespace. Open FI assumes that enhancement will only take place on three levels (SAP . Any Business Add-In that has been implemented once already can be implemented again by those groups listed to the right of the software chain shown in the above graphic. The enhancement's active components are then called at runtime. interface. This technique differentiates between enhancements that are only allowed to have one implementation and enhancements that can call multiple implementations in any sequence desired. The enhancement. Business Transaction Events (Open FI) The Open FI enhancement technique was developed in the Financial Accounting component. However. In some cases.customers). menu. and afterwards activate the implementation of the enhancement. Both industry-specific and country-specific enhancements may be defined. and screen enhancements. he or she first creates an implementation. Open FI is based upon the following principles: Application developers must define their interface in a function module. Normally. you can only enhance source code using Open FI.  . A short description of each of the various enhancement techniques follows. If a customer wishes to use a Business Add-In. Business Add-Ins also include enhancements for screens. and the customer modules assigned are called dynamically. You cannot enhance user interface elements with Open FI like you can with Business Add-Ins.

A changing parameter is used to pass on the string. . partners. With Business Add-Ins. We would like to explain the procedures using an application program as an example..  Defining a Business Add-In Use An application developer who wishes to have a Business Add-In in a particular program defines the interface for an enhancement in the Business Add-In Builder. Conclusion: None of the techniques mentioned above can easily be extended to fulfill the requirements of a system infrastructure containing country versions. and customers. 2. Enhancements in Transactions SMOD/CMOD Making enhancements using the transactions SMOD/CMOD has the following disadvantages:  This enhancement technique assumes a two-tiered system infrastructure (SAP ± customers). Procedure 1. Business Add-Ins can be created and employed in each of the various software levels. The application developer defines an enhancement. menu and screen enhancements into a single add-in.. choose Tools p ABAP Workbench p Utilities p Business Add-Ins (transaction SE18). ABAP Objects is used to enhance programs. From the SAP menu. It consists of an interface with a method.  The naming conventions in effect do not tolerate name extension.Open FI uses function modules for program enhancements. Customers can then select the add-in and implement it according to their needs. Business Add-Ins should be considered generalized Business Transaction Events that can be used to bundle program. In the following step. 1. 2. 1. There is a string conversion in the program. industry solutions. he or she programs the interface call in the application program at the appropriate place. Enter a name with a maximum of 20 characters for the Business Add-In. . You want the add-in users to determine themselves how their strings are to be converted.

we are dealing with a simple enhancement. Option: Within SAP Meaning: If the customer selects this option for an Add-In. The implementation of a Business Add-In is dependent on a particular filter value. In the input help. Double-click the interface name field. 4. 5. he or she has no option for creating his or her own implementations for this Business Add-In or for using them. On the following screen. 8. 6. For more information. and under the Subscreens tab you can create Screen Enhancements. refer to the section Definition of a Business Add-In in the Enterprise Core. 7. refer to the section Multiple-Use Business Add-Ins. In this example. For more information. 3. enter a short text as the description for the Business AddIn. 8. 6. Choose Create. For more information on the checkbox Within SAP. you can create Menu Enhancements. Use the Class Builder to assign a method to the interface.3. 7. Under the FCodes tab. The Business Add-In can be set for multiple use. 5. Multiple Use Filter-Dependent None of the above options is selected. Choose the Interface tab. . Business Add-Ins with this flag are not displayed. Confirm that you want to save the entries you have made. refer to the section Multiple-Use Business Add-Ins. The system branches to the Class Builder. Assign a package to the Business Add-In. The interface name is generated automatically and can be changed here. 4.

Choose Goto p Default Coding / Sample Coding if you wish to create default coding and/ or sample coding for the Business Add-In. 10. Use the pushbutton Back to navigate back to the Business Add-In definition. the corresponding executing class is generated. 9.. do not forget to save your entries. Save and activate your entries. 11. A table control now appears on the definition screen for the Business Add-In.. read the section Documentation of a Business Add-In. 2. the connection between the class and the implementation is set up. This applies also to filter-dependent Business Add-Ins. Now define a parameter with the following attributes: 10. It displays the method you have created for the interface. Save your entries and use the Documentation pushbutton to create a description for your new Business Add-In. The default implementation is executed only if no other active implementation is available.9. When you maintain the interface methods. . You can now continue with the definition of the Business Add-In by executing activation in the Class Builder. In this way. For more information. When you create default or sample coding. Remember that this documentation is very important for users to be able to understand the purpose behind the Add-In. See also: Changes to Business Add-In Definitions . 11. The generated code cannot be altered in the initial expansion phase.

Double click to navigate to the Class Builder. these can be rendered syntactically incorrect by changes made to the interface. . or creating a method. Whenever methods are deleted. If interface changes refer to parameters. call up transaction SE19 and choose the tab Interface. remember that creating parameters is possible without any problem. this clean-up is automatically executed after the import phase. choose the field Name of Implementing Class. If an interface change of the type mentioned above reaches a system by means of system transport or delivery. Changing parameter types or deleting parameters can cause syntax errors or possibly also termination at runtime. this will have the effect that the corresponding includes are also deleted in the implementing classes. clean up the method includes in the current development system for all classes that are used for the BAdI implementations. renaming. In the BAdi Builder. Choose Utilities p Clean Up p Method Includes. If changes to the interface are unavoidable and they pertain to deleting.Changes to BadI Definitions You are allowed to change: y The filter type  y The definition of multiple use  y The internal flag selection If implementations already exist for a BadI definition. Renaming is also the same as deleting. Afterwards.

you would program the call of the Business Add-In into your ABAP source code as follows: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 Report businessaddin. enhancement management generates a class that implements your interface. "String to change start-of-selection. these implementations are subsequently executed.word. Example: Having created a string conversion Business Add-In.Calling a Business Add-In in the Application Program When you define a Business Add-In. write:/ 'Original word: '. The application developer uses a factory method to create an instance of this adapter class in the application program and calls the corresponding method. "Interface reference data word(15) type c value 'Business Add-in'.word. The adapter class method generated by add-in management decides whether one or several active implementations should be called. endif. class cl_exithandler definition load. If necessary. if not exit is initial. "Method "Add-In call . "Declaration data exit type ref to if_ex_businessaddin. write:/ 'Original word: '. The application program does not know which implementations are called. The application program ensures only that the adapter class method is called. call method exit->method changing parameter = word. at line-selection. call method cl_exithandler=>get_instance "Factory method call exporting exit name =¶BUSINESSADDIN¶ null instance accepted =¶X¶ changing instance = exit. if necessary. write:/'Please click here'.

no instance is created if there are no active implementations for this BAdI definition. Within the adapter class interface. Using this parameter implies that the method calls of this BAdI may only be called under the condition that this instance is not NULL. If you switch the method type in the interface from the static method . In no case should you discard the instance as soon as it is generated or repeatedly run the initialization process in a loop. the application developer creates an adapter class instance using the factory method. you should specify additional parameters for the call in the method GET_INSTANCE of the class CL_EXITHANDLER.In order to be able to call static methods. Use data to create it and type it to the interface. This is why the class « definition load statement is necessary for the factory class. is necessary in this case. even if no active implementations exist. The instance methods are then called at the time specified. The query if not <badi instance> is initial. To improve performance during creation of the instances. you should not do without initialization altogether. Also. repeated initialization makes the buffer useless and dramatically reduces performance. the INSTANCE parameter has the value NULL. However. if the definition of the Business-Add-In is filter-dependent. During initialization (line 6). you would lose the benefit of performance improvement through the Business-Add-Ins and the possibility of multiple use. NULL_INSTANCE_ACCEPTED: Whenever the value X is assigned to this parameter. you can call Business-Add-In methods without having to expect considerable performance restrictions. required database accesses are buffered locally. Notes on Usage The instance generated through the factory method should be declared as globally as possible or generally be passed as a parameter to ensure that the initialization process must be run as rarely as possible ± just once would be best. Even if you could call static methods of the implementing class of the Business-Add-In implementation without an instance. In this case. Due to the local buffering. However. a single instance is sufficient. A variable for object reference is also necessary when calling the method. so that each access is executed once only. EXIT_NAME: The name of the BAdI definition is assigned to this parameter. you must declare the corresponding class in ABAP Objects.

Implementing a Business Add-In A list of the Business Add-Ins available in your system can be found either in the SAP Reference Implementation Guide (IMG) or in the component hierarchy. Using a BAdI implementation. 2. In the SAP menu. To create an implementation. 1. choose ABAP Workbench p Utilities p Business Add-Ins (transaction SE19) or double-click the corresponding activity in the Implementation Guide (IMG).to the instance method at any time in the future. The implementation is a separate transport object and lies within the namespace of the person or organization implementing it. This would be suitable in cases where you can see in advance which functions are required by the customer. BAdI definitions are included in the IMG so that the customer/partner can create suitable. as required. . you can no longer use default code that is provided. BAdI implementations . the customer/partner can simply switch the delivered implementations on or off. you can create an implementation. 7. The icon serves as a switch for activating and deactivating the implementation. company-specific implementations.can be provided. many code adjustments are required. You need to program the interface method in such a way that. In the SAP Reference IMG.. Starting from the name and the documentation of the enhancement.. choose Execute in front of the name of the BAdI implementation. Enter a name for the implementation and then click the Create pushbutton. In addition. During the implementation. proceed as follows: 8. In the SAP Reference IMG. the system creates a class that implements the enhancement¶s interface.in addition to BAdI definitions . the string is actually converted in the way the add-in user wants it. when the add-in is called from the application program. 6. . you are to create an implementation for the string conversion. For the example given here.

3. Several implementations may exist for a Business Add-In that is not used on a multiple basis. or even abstract. If you do this. 10. Choose Activate. only one implementation can be active at any one time. 11. 5. You must first enter a package before the Class Builder is displayed. 8. 9. Navigate to the Class Builder by double-clicking the method. refer to the section Implementing Methods Using the Formula Builder. the content of a method is determined using the Formula Builder. 14. 9. For more information on this. Save your entries and return to the Change Implementation screen. you could enter the statement translate parameter to upper case. If you choose Formula. However. the system will return short dumps at runtime.8. 12. In our particular example. 15. statements that already exist. Insert the desired source code for the implementation between the method if_ex_businessaddin~method. 6. 7. and endmethod. there is also the Formula option. protected. 4. Choose the Interface tab. Enter a short text describing your implementation on the following screen. . You may now use this implementation when the application program is executed. What is also important is that you must declare the instance generation of the implementing class (Attributes tab) as public and not as private. 10. Choose ABAP Code as the implementation type. In addition to ABAP Code. Enter the name of the add-in for which you want to create an implementation for in the dialog box that appears. 13.

Program the call for the Business Add-In from the application program: . 2. the execution of a static method ensures that an implementation is called. Define a Business Add-In that does not have multiple use.See also: Calling Implementations Through Filter Mechanisms Call Sequence for Implementations Using Filter Mechanisms The call sequence for implementations for a Business Add-In can be specified as a filter type using a data element with fixed values or a value table. In the default code of the Business Add-In. 17. Assign the data element to this Business Add-In as a filter type or a structure. 18. 3. Create a data element with fixed values or a value table. Assign a static method with the following content to the default code of the Business Add-In: 16. 4. Proceed as follows: 1.

the implementation with the filter value Industry Solution is executed. . If there is no customer implementation. the functions it offers are more restricted than if you implement a method by writing ABAP code. the customer¶s implementation is executed first. value 4). value 3) is run. If you do not specify a dependent step for one of these two possibilities. Features A formula can consist of the following steps: y Condition You define a Boolean formula expression whose result can be true or false. If this implementation is not available in active form. This type of implementation does not require you to have programming knowledge. In the case of example described here. Here. Depending on whether the condition is true or false.The parameter flt_val is passed during the static method call with the highest fixed value (in this case. Implementing Methods Using the Formula Builder Use You can use the Formula Builder to implement methods for Business Add-Ins without writing a single line of ABAP code. However. This formula expression is a logical condition based on the importing and changing parameters of the method. the system triggers different steps. the implementation with the next smaller value (in this case. this is the partner¶s implementation. you can change the implementation type of the method at any time. and so on. If the range of functions provided by the Formula Builder is not sufficient. The methods are implemented by means of socalled formulas. the system continues with the next superior step.

For information on this topic. A formula editor is available which you can use to enter formula expressions. choose and then select the appropriate step type from the dropdown list. Activities You implement the method using the BAdI Builder. and the application program continues in accordance with the exception defined. You can change the implementation type of the method on the Interface tab. you can display information on how to use it by choosing the pushbutton next to the status display (traffic light). To do this. y Exception The system exits the method. Substitution is only possible if the method contains changing.y 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 mathematic formula. you then determine the arrangement and the descriptions of the steps. You can implement a method both using a formula and using ABAP code. You create the necessary steps in the left section of the screen. exporting or returning parameters. All messages issued are collected in a log table. You can also copy steps to use them as templates for other steps. To specify the parameters for the individual steps. . An exception can only be triggered if the method contains exceptions. Double-clicking the method name takes to to the Formula Builder: BadI Implementation screen. Formulas are transported automatically. or you can delete individual steps. No further steps are executed. The system can only issue a message if you created a log table during method definition. y Message The system issues a message. You define the message variables as constant values or by means of mathematic formulas. You then enter the data required in the right section of the screen. Using the other icons available or the context menu (which you can call by clicking the right mouse button). At the runtime of the application program. the system executes the implementation type currently chosen. After starting the formula editor. To implement a method as a formula. double-click the corresponding entry in the left section of the screen. choose the Formula implementation type on the Interface tab. see Implementing Business Add-Ins. You can additionally display a message whose variables you define as constant values or by means of mathematic formulas.

Filter-Dependent Business Add-Ins Business Add-Ins may be implemented on the basis of a filter value. it is likely that different partners will want to implement this enhancement. Enter a filter type when defining your enhancement (a country or industry sector. The application program provides the filter value for the enhancement method. Defining a Filter-Dependent BAdI Calling the BAdI from the Application Program Implementing a Filter-Dependent BAdI Extendable Filter Types Special Aspects of Country-Specific BAdIs Calling Implementations Through Filter Mechanisms . for example). All methods created in the enhancement's interface have filter value FLT_VAL as their importing parameter. A description of how a filter-dependent Business Add-In works in the context of the string conversion example follows. If an enhancement for country-specific versions is provided for in the standard version. The individual countries can create and activate their own implementation. The method then selects the active implementation for that value. Different implementations are called using different filter values.

Defining a Filter-Dependent Business Add-In To define a filter-dependent Business Add-In. an internal parameter. If necessary. Now create an interface with methods. and this parameter must serve as both the import and export parameter. you can enter the name of a structure in the FilterType field. the filter value must be defined as the importing parameter so that the application program can provide the filter value to the enhancement method. or the domain has fixed domain values or a value table containing a column with the same type as the data element. This also applies to structures. The structure can consist of several data elements that fulfill the above conditions for data elements. Remember that for each method you create in the interface of a filter-dependent enhancement. first create the definition of the Business Add-In and select the Filter-dependent checkbox. The method then selects the active implementation for that value. you can create such a data element yourself. for example: a country. The structure must not be longer than 80 characters. You can use different elements as filter types. a material. A data element must fulfill the following criteria: y y The data element's domain may contain a maximum of 30 characters and must be of type Character. and so on. Either the data element has a search help with a search help parameter of the same type as the data element. A filter type can be a data element or a structure. If you want to call the implementation of a Business Add-In to depend not only on a filter value but on various values. . The filter value is always declared using the parameter flt_val and is predefined in the list of parameters. an object type. Enter the data element you want as a filter type or select a filter type using the input help.

data exit type ref to if_ex_businessaddin. perform formatlist. write:/ 'Original word: '. . call method exit->method exporting flt_val = flt. data wort(15) type c value 'Business Add-in'. -> Conversion to lower case'. class cl_exithandler definition load. Report businessaddin. write:/ 'Original word: '.word. at line-selection. write:/'Please click here'.Calling a Business Add-In from the Application Program As previously discussed. The subroutine formatlist looks like this: form formatlist. write :/'Ireland flt = 'Ireland' -> Conversion to upper case'. start-of-selection.word. write:/'USA flt = 'USA'. hide flt. new-page. The filter value is passed to the method as an export parameter. data flt type de_land. call method cl_exithandler=>get_instance changing instance = exit. Changing parameter = word. the application developer creates an instance of the generated class in the application program and calls the corresponding method at the appropriate time.

. 19. Use the Class Editor to fill the interface method.' If a filter-dependent BAdI is called using one filter value only. hide flt.. write :/'Italy flt = 'Italy'. proceed as follows: 9. endform. Create an implementation by referring to the corresponding Business Add-In definition. If this is not the case. it is possible to establish whether or not there is an active implementation for this filter value using the function module SXC_EXIT_CHECK_ACTIVE. it is no longer necessary to create an instance or to call methods. or choose F4 and select a value from the list of possible entries displayed. 22.... Enter a characteristic filter value for the implementation. you would make the following entries for each country: Germany: translate parameter to upper case. To implement a filter-dependent BAdI. however. In the string conversion example. . you will need an implementation for each filter value that is relevant for you. Ireland: translate parameter to lower case. 4.. 3.hide flt.. Implementing a Filter-Dependent Business Add-In If you want to use a filter-dependent Business Add-In. Italy: translate . -> Conversion to. Multiple filter values may use the same implementation. it is possible to define multiplecharacteristic filter values for each implementation. In principle. 2. 21. 20. 1. Repeat steps 1-3 for each implementation that you create.

23. the field must exist in this table that contains the string TEXT or TXT as a partial string. Activate your implementations. different country-specific implementations are executed.  y The delivery class of both tables must be E or G. You can use the asterisk symbol to represent any part of a filter value. When you assign the Extendable attribute to a filter type. Whenever you execute the program described above. In the Dictionary. You can enter a short text for each filter type. 5. This value table has exactly one key field that has the data element of the filter type as its field type. it is also possible to edit short texts. To mark a field as a text field. the . As far as extendable filter types are concerned. They are added to the value table when the data is saved. y The domain has a text table with two key fields. You can specify generic filter values for the implementation of a BAdI. You can also use transaction SE19. the system takes you to the transaction for implementing Business Add-Ins. as usual. and a key field is a language field. it is also possible to create implementations for filter values that did not exist so far. If you choose Filter Value p Create and enter a filter value that did not yet exist (you do not need to specify the name of the implementation). All filter values that are created in the context of an extendable filter-dependent Business Add-In must not yet appear in the value table. Note that the assignment of the Extendable attribute is subject to the following restrictions: The domain to which the extendable filter type refers must have the following properties:   y The domain is linked to a cross-client value table. You can display and hide short texts for filter values by double-clicking the corresponding column. the text table must be assigned to the value table. the Implementation menu option in the BAdI Builder is replaced by Filter Value. A key field has the filter type as its field type. Extendable Filter Types If you flag a filter type as being Extendable. Similarly. A generic filter value can be replaced by different values that may be found in the database.

This Business Add-In is called Address Check. . US instead of USA. The same applies to the text table. for example.values are removed from the value table when the implementation or the entire Business Add-In is deleted. The ISO code of a country key would be. Before the Business Add-In is called from within the application program. This example uses the data element INTCA (ISO code of the country). Special Aspects of Country-Specific Business Add-Ins The standard system contains a Business Add-In that provides an interface for integrating additional postal checks of the address data through external tools. Then you can pass the filter value as an exporting parameter. you must determine the ISO code of the country by submitting a SELECT statement to table T005 (field INTCA). you should use the data element INTCA also for Business Add-Ins. Since SAP recommends complying with the international ISO standard for country-specific queries.

the program waits for the enhancement to return something.Multiple-Use Business Add-Ins You can differentiate between single-use and multiple use Business Add-Ins. With multiple use add-ins. To create a multiple-use Business Add-In. using changing parameters can cause problems. The distinction is based on the procedure or event character of an enhancement. . Define an add-in and select the Multiple Use checkbox from the Administration tab.. Since this point in time can be useful for different purposes. 2. 24. since at the time of the definition the interface does not know which implementations there will be and which parameters will be changed by implementations. 1. Calling your enhancement in the application program: . an event that may be of interest to other components is processed in program flow. you can also use changing parameters for multiple-use Business Add-Ins. Depending on the implementation. usually a return code. the system should allow you to use an add-in after saving). 25. Sequence control is technically impossible. In addition to importing parameters. proceed as follows: 10. A typical example could be a benefit calculation in HR. you can create an enhancement here that can be used by multiple subscribers. There is no guarantee that implementations will not overwrite the results of previous implementations. alternative calculations can be executed. There is no sequence control for multiple-use implementations of BadIs. Example: In a particular application.. In the first case. you want to be able to continue processing indexes after another component has saved data (in other words. It is not possible to have a decision as to which implementation should be executed before which other (future) implementation. Any number of components could use this event as a ³hook´ to hang their own additional actions on to. Therefore. Define an interface with the method OBJECT_SAVED'and the importing parameter OBJECTNAME.

For the caller it is irrelevant whether (and how many) subscribers use the event as a starting point for further actions. just like in the enhancement technique SMOD/CMOD.>. The application developer reserves specific function codes for customers when defining a Business Add-In and assigns them in the Menu Painter in the appropriate menu lists. and then programming the method used to determine what action is performed when the menu enhancement is called... These function codes are assigned to an enhancement. choosing a text for the menu option. endform.program event. « data exit_obj type ref to if_ex_event. « update « call method exit_obj->object_saved exporting objectname = obj_name. Customers can take advantage of menu enhancements by creating a new implementation. Menu Enhancements Menu enhancements with function codes are provided for in the user interfaces. These function codes must adhere to the form /namensraum/+<. . form save_object using obj_name type c. The active implementations are called in the adapter method. Only when there is an active implementation of the assignment do they appear in the menu. The application developer must also ensure that these menu options are queried in the application program and that the corresponding add-in method is also called. « call method cl_exithandler =>get_instance changing instance = exit.

2. eine Implementierung an und wählen Sie den Registerindex Fcodes 30. You can also double-click the first input field.Menu enhancements can only be used for single-use add-ins (not multiple-use add-ins) that are not filter-dependent. . Choose the FCodes tab.. 1. All data adopted from your Business Add-In's definition is displayed here. 27. Create an implementation and choose the FCodes tab. Currently. 28. menu enhancements can only be created in conjunction with program enhancements (interfaces). you can call the menu lists by choosing Goto p Object Lists p Menu Lists. and a description. when 'SAP'. 3. You can make entries for the implementation on the right. 1. the function code. proceed as follows: 11. proceed as follows: 12. 29. The following dialog box appears: . Enter the name of your program. Create the definition of an add-in and define its interface. («) when '+CUS' call method « Implementing a Menu Enhancement To create the implementation of a menu enhancement. To create a menu enhancement. If you have accessed the Menu Painter directly during add-in definition. Enter the function code in the appropriate menu list.. Call the Menu Painter or double-click on the program name or function code to navigate to user interface maintenance in the Menu Painter. Calling a Menu Enhancement from the Application Program The application program should look like this: («) case fcode. 4. 26.

the instance is saved in a public static read-only attribute DYNPRO_INSTANCE of the BAdI class. the name of an icon. With the old enhancement technique based on customer exits. Screen enhancements are not supported. you can also create screen enhancements for Business AddIns. 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. These tasks are now performed by a user function group or a module pool if you implement a screen enhancement using BAdIs. the parameter is then read on the user side. This attribute is generated. The actions that you want the system to perform after the pushbutton is chosen must be programmed in the appropriate method. X function groups were used for data retention and data processing purposes. The name of the function group lies in the namespace of the implementing person/user. either manually or using a default source code that has been provided for this purpose. and a short description. The instance of the implementing class is only used for data transport.Here you may enter a text for your function code. Using the method GET_INSTANCE_FOR_SUBSCREEN. Menu enhancements only become visible after the implementation has been activated and the application program that calls the Business Add-In has been executed. The 'X' that was necessary at the beginning of a function group in case of customer exits is now no longer required and therefore eliminated. Screen Enhancements Besides program and menu enhancements. however. For this purpose. for Business Add-Ins designed for multiple use. A public static method SET_INSTANCE_FOR_SUBSCREEN sets the attribute on the application side to the parameter passed. . Different subscreen states can be represented by different instances. a text for the icon.

the user enters the airline carrier. . the flight number. First. the classes and the user function group or module pool are illustrated below by means of an example.The relationships shown between the calling program. and the fight date. The required data is then displayed. Example: Flight data is to be displayed in a transaction.

If the customer creates an implementation.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. Also read the following sections: Defining Screen Enhancements Implementing Screen Enhancements . the system displays additional fields.

3. This attribute is used for passing data. 33. see Defining Business Add-Ins. Create an instance attribute in the interface. These methods are called from within the program of the application at PBO or PAI (see below). Parameter: FLIGHT FLIGHT Type: IMPORTING EXPORTING Reference type: SFLIGHT SFLIGHT 2. Method: PUT_DATA_TO_SCREEN GET_DATA_FROM_SCREEN 32.. 1. You could create the methods with the following parameters for the example we have used. 31. Write the code for the call of the screen enhancement in the program of the application: Top Include: .. 13. The methods PUT_DATA_TO_SCREEN and GET_DATA_FROM_SCREEN are required for data transport.Defining Screen Enhancements Implementing Screen Enhancements Defining Screen Enhancements For general information on how to define Business Add-Ins. Create the following methods. .

Zeitpunkt PAI: . CALL METHOD cl_exithandler=>set_instance_for_subscreens EXPORTING instance = exit. dynpro = sy-dynnr. CLEAR: sflight. The factory method is used to create an instance of the adapter class. CALL METHOD exit->put_data_to_screen EXPORTING flight = sflight EXCEPTIONS reserved = 01. program = sy-repid. 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.DATA: program Type program. Time PBO: MODULE initialize OUTPUT. 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. ENDIF. dynpro Type dynnr. ok_code. exit type ref to if_ex_badi_screen The variable for the object reference is created using data and typed to the interface. IF exit IS INITIAL. ENDMODULE. ENDMODULE. CALL METHOD cl_exithandler=>get_instance CHANGING instance = exit. MODULE data_for_subscreen OUTPUT.

WHEN 'BACK'. and enter the calling program. PERFORM save_flights. This code is automatically copied when you create an implementation and can be added to if required. and assign the name 'SUB' to it. For more information on how to create subscreens. In the BAdI Builder. These methods are implemented by the user. ENDCASE. 34. . you are strongly recommended to provide sample code for the methods PUT_DATA_TO_SCREEN and GET_DATA_FROM_SCREEN. 5. endmethod. method IF_EX_BADI_SCREEN~GET_DATA_FROM_SCREEN . CALL METHOD exit->get_data_from_screen IMPORTING flight = sflight EXCEPTIONS reserved = 01. The data to be displayed is assigned in the methods PUT_DATA_TO_SCREEN and GET_DATA_FROM_SCREEN using the interface attribute FLIGHT. WHEN 'SAVE'. the sample code would look like this: method IF_EX_BADI_SCREEN~PUT_DATA_TO_SCREEN . The user of the BAdI definition should not be responsible for the data transport.MODULE user_command_0200 INPUT. SET SCREEN 100. and the subscreen area. flight = me->if_ex_badi_screen~flight. WHEN '+EXT'. In this case. CASE save_ok. 4. the screen number. endmethod. me->if_ex_badi_screen~flight = flight. see Subscreens. In the Screen Painter. 35. create a subscreen area on the screen of the calling program. 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. When you define a screen enhancement. The method PUT_DATA_TO_SCREEN called at PBO time as well as the method GET_DATA_FROM_SCREEN called at PAI time are used to transport the data to be displayed. choose the Subscreens tab.

TABLES sflview. 2. The program could have the following contents.. . IF exit IS INITIAL. refer to the section Implementing Business Add-Ins. 36. .See also: Implementing Screen Enhancements Implementing Screen Enhancements For general information on how to implement Business Add-Ins.. CALL METHOD cl_exithandler=>get_instance_for_subscreens CHANGING instance = exit EXCEPTIONS OTHERS = 6. Arrange the required fields on the screen. At PBO time: MODULE status_0100 OUTPUT. for example: Topinclude: DATA: exit TYPE REF TO if_ex_badi_screen.. 37. Write the program for the screen by creating either a module pool or a function group. Create a screen of the Subscreen type. CALL METHOD exit->get_data_from_screen IMPORTING .. The user of the screen enhancement should perform the following steps: 14. flight TYPE sflight. ENDIF. 1.

. 16. Sorting BAdI Implementations Use The sequence for execution of BAdI implementations can be controlled for BAdIs used on a multiple basis by a sort mechanism. . the method PUT_DATA_TO_SCREEN is called at PAI. ENDMODULE. Choose the Interfaces tab. Procedure 15. 4. . ENDMODULE.. 3. In the BAdI Builder (SE18). 39. en . 38. .flight = flight EXCEPTIONS reserved = 1 OTHERS = 2.. add any lines necessary to the sample code. At PAI time: If data has been changed. IF sy-subrc <> 0. SELECT SINGLE * FROM sflview WHERE carrid = flight-carrid AND connid = flight-connid AND fldate = flight-fldate... MODULE user_command_0100 INPUT. Enter the name of the called program and of the subscreen. If required. CALL METHOD exit->put_data_to_screen EXPORTING flight = flight EXCEPTIONS reserved = 1 OTHERS = 2.. Choose the Subscreens tab. . choose Utilities p Sort. ..

a text field with the name Sort Value and an input field. The screen contains. 40. you need to enter the name of the implementation that will be created in the following step. 3. The IF_EX_BADI_LAYER interface contains the following methods: . 4. 42. The implementations are executed in accordance with the specified sequence. Choose the Subscreens tab of the BAdI implementation and enter the called program and the screen number. In this case. for example. Create an implementation for the BAdI definition BADI_LAYER contained in the delivered product. Create a screen (in a function group or a module pool). Choose the Interface tab. 2. 41. Choose Special Sort if sorting is to take place using non-numeric sort values.Choose Standard Sort if sorting is to take place using numeric sort values. Proceed as follows if you require special sorting: 1. Enter a BAdI definition as filter value in the Properties tab (the name will be used as a dummy value to begin with). The numeric values are entered in the displayed field Layer Value when you create the implementations and stored in a table. 43.

The user can maintain any fields as required and sort them according to any specified criteria at runtime. 5.In addition to methods for data transmission of the sort value and for changing the BAdI implementation. for example. the interface also contains a sort method that sorts a table of values in any specified order. 44. inputs for the Sort Value field when you create implementations. A standard table is passed to this method as a changing parameter. Program the method SORT_DATA. This table contains. Here is an example of simple sorting of numeric values: . it does not contain any implementation names. The table contains values only.

Program the call for implementations from the application program. 46. 7. 6. . The IF_EX_BADI_LAYER interface contains a parameter-free method called TEST for test purposes.45. Program the methods for data transmission in the following form (see also Screen Enhancements).

in numeric sequence). Possible collisions include: Case 1 Multiple active implementations exist for Business Add-Ins that have not been . choose Utilities p Sort and finally No Sort.). The edit field that was displayed using a subscreen during the execution of a BAdI implementation now disappears.The implementations are executed (for example. partners. on the other hand. Sorting of BAdI implementations can be switched on again at any time. Switching off or making a change. etc. Switching Off Sort Function To switch off the sort for the execution of BAdI implementations. The implementations will now run in an arbitrary sequence in this case. Business Add-Ins: Import Procedure Conflicts can occur at release upgrade or when transporting a Business Add-In within a system infrastructure containing multiple levels (country versions. counts as a modification. industry solutions. The BAdI definition is not changed. This does not count as a modification to the standard version.

corresponding error messages and warnings are created in the transport log at import. Choose Utilities p Adjustment p Multiple assigned interfaces or Multiple function codes assigned. 2. Choose Utilities p Adjustment p Multiple active implementations (in transaction SE18). A red traffic light indicates that multiple active implementations exist for that add-in. Their long texts provide you with information on how to proceed. Identical function codes were assigned during Business Add-In definition. . To delete a function code or change an interface name. 2. if add-in is filterdependent). Both of these menu options display an overview. Identical interfaces were assigned during Business Add-In definition. 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. Whenever such collisions occur. 1.Case 2 Case 3 designed for multiple use (for the same filter value. A list appears displaying your Business Add-Ins. 1. If the collision described in case 1 occurs in your system. call the ABAP Workbench and use the appropriate pushbutton to call the tool you need. 2. the Add-Ins in question are marked with a red traffic light. A new transport may be necessary. proceed as follows: 1. The people responsible for those add-in definitions where identical interfaces and function codes occur must now decide how to proceed.

Sign up to vote on this title
UsefulNot useful