14_userexits

59
© 2004 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Modification & Enhancements Presented by : M Suresh Kumar

Upload: shinerulz

Post on 03-Oct-2015

218 views

Category:

Documents


0 download

DESCRIPTION

User exit

TRANSCRIPT

  • AgendaIntroductionUser ExitsCustomer ExitsFinding ExitsProcedure to implement enhancementDemoQ&A

    HP Confidential Modification & Enhancements

  • Introduction-Enhancements and Modifications

    HP Confidential Modification & Enhancements

  • Modifications: These are changes to SAP objects that have been made in customer systems. Modifications are: executed with the help of user exits (these are subroutines reserved for customers that have been inserted in objects in the SAP namespace) 'hard-coded' at various points within SAP Repository objects.Enhancements: The standard SAP programs call objects that have been changed by customers. The changesin ABAP programs (function module exits)on GUI interfaces (menu exits)on screens by inserting a subscreen in an area specified by SAP (screen exits)on screens by processing customer code that refers to a specific field on the screen (field exits)in ABAP Dictionary tables or structures (table enhancements)Customer Development: These programs are developed by customers that can call SAP Repository objects. Programs are developed that call Function Modules.

    HP Confidential Modification & Enhancements

  • User Exits

    HP Confidential Modification & Enhancements

  • User exits allow us to add our own functionality to SAP standard program without modifying it . These are implemented in the form of subroutines and hence are also known as FORM EXITs. The user exits are generally collected in includes and attached to the standard program by the SAP.User exits are a type of system enhancement that were originally developed for Sales and Distribution Module (SD). The original purpose of user exits was to allow the user to avoid modification adjustment.These subroutines which are called are already implemented in the SAP standard program

    HP Confidential Modification & Enhancements

  • SAP creates special include in either a module pool or a function group. These includes contain one or more subroutines routines that satisfy the naming conventionThe use of user exits are technically called as modifications

    HP Confidential Modification & Enhancements

  • HP Confidential Modification & Enhancements

  • HP Confidential Modification & Enhancements

  • Customer ExitsOverviewField ExitsTable ExitsFunction Module ExitsMenu ExitsScreen Exits

    HP Confidential Modification & Enhancements

  • Customer Exits: Overview

    HP Confidential Modification & Enhancements

  • You can enhance programs in the following areas:in ABAP programs (function module exits)on GUI interfaces (menu exits)in screen flow logic- by inserting a subscreen in an area specified by SAP (screen exits)SAP provides you with the following functions for enhancing your system:the ABAP statement CALL CUSTOMER-FUNCTIONspecial function codes for your interfacethe statement CALL CUSTOMER-SUBSCREEN in screen flow logic.All program exits, menu exits, and screen exits must be programmed in advance by an SAP application programmer.

    HP Confidential Modification & Enhancements

  • Implementing Customer Exits

    HP Confidential Modification & Enhancements

  • Field Exits: SAP and the Customer

    HP Confidential Modification & Enhancements

  • You create field exits simply by storing function modules for specific data elements in your system.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.Field exit function modules adhere to the following naming convention:prefix:FIELD_EXIT_name:_suffix (optional):0 to 9, A to Z

    HP Confidential Modification & Enhancements

  • The function module interface contains the import parameter INPUT and the export parameter OUTPUT. You must assign a value to the OUTPUT field in a function module's source code in order to transport its field contents back to the SAP screen.The following ABAP statements are not allowed in field exit function modules:BREAK-POINTCALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMITCOMMIT WORK, ROLLBACK WORKCOMMUNICATION RECEIVEEXIT FROM STEP-LOOPMESSAGE I, MESSAGE Wexternal PERFORMWhen you debug a screen that is referenced by a field exit, the field exit code is ignored by the debugger. As with any normal function module, you can, however, debug the field exit code in the Function Builder's test environment just.

    HP Confidential Modification & Enhancements

  • Table Exits

    HP Confidential Modification & Enhancements

  • Append structures allow you to add fields to a table without actually having to modify the table itself.Append structures may only be assigned to a single table. A table may, however, have several append structures attached to it. You can use append structures in ABAP programs just as you would any other structure.

    HP Confidential Modification & Enhancements

  • Table enhancements using append structures do not have to be planned by SAP developers.CI_includes allow you to use the same structure in multiple tables. Table enhancements using CI_includes do, however, have to be planned by SAP developers.

    HP Confidential Modification & Enhancements

  • Text EnhancementsSAP application programmers either use existing data elements or define new ones, then they document them and assign keywords.Customers can add their own custom documentation as text enhancements for these data elements, or they can create new documentation entirely.

    HP Confidential Modification & Enhancements

  • Function Module Exits

    HP Confidential Modification & Enhancements

  • These are used to add own functionality through ABAP code . These start from the word EXIT_programname_NNN ending in a 3 digit number. No access code is required to implement any tupe of exit including function exits. Each Function Module exit contains an include where the custom source code is written.The system processes your ABAP code for the first time whenever the enhancement project (of which your function module is a component) is activated as a whole. Function module exits have no effect prior to enhancement project activation.

    HP Confidential Modification & Enhancements

  • Calling and Creating Function Modules

    HP Confidential Modification & Enhancements

  • ABAP statement CALL CUSTOMER-FUNCTION 'nnn' to call function modules (where 'nnn' is a three-digit number). This statement is coded in the SAP standard program

    These function modules are always belong to function groups whose names begin with X (X function groups).

    The following naming convention applies to these function modules:prefix: EXITname of the program that calls the function modulesuffix: three-digit number

    The three parts of the name are separated by two underscores.

    The CALL CUSTOMER-FUNCTION statement is not executed until the corresponding enhancement project is activated. Multiple calls of the same function module are all activated at the same time.

    HP Confidential Modification & Enhancements

  • Menu Exits

    HP Confidential Modification & Enhancements

  • Menu exits allow you to add your own functions to menu options. SAP application programmers reserve certain menu entries in your GUI interface for this. This allows you to define a text for the reserved menu entry and add your own logic, usually in the form of a related function module exit.

    Once you activate menu exits, they become visible in the application. Whenever this menu option is chosen, the system processes either a function provided by SAP application programmers or your own function that you have implemented in a function module exit.

    HP Confidential Modification & Enhancements

  • Menu Exit Requirements

    HP Confidential Modification & Enhancements

  • In order for you to be able to implement menu exits, SAP application programmers must equip the GUI interface of your application program with function codes that begin with a plus sign ('+').

    These function codes are inactive at first and do not appear on the interface of the program. They only become visible in the program after you have activated them.

    HP Confidential Modification & Enhancements

  • Menu and Function Module Exits

    HP Confidential Modification & Enhancements

  • Customers can implement menu exits based on reserved function codes. SAP application programmers define these function codes, assign them to menus, and often provide them with a corresponding function module exit.

    Menu exits and function module exits are both part of the same SAP enhancement.

    No pushbuttons may be assigned to additional function codes.

    HP Confidential Modification & Enhancements

  • Screen Exits

    HP Confidential Modification & Enhancements

  • Screen exits allow you to layout reserved sections of a main screen (subscreen areas). You can either display additional information in these areas or input data.

    HP Confidential Modification & Enhancements

  • Subscreens in the R/3 System

    HP Confidential Modification & Enhancements

  • Subscreens are rectangular areas on your screen that are reserved for displaying additional screens at runtime. Each subscreen area can be filled with a different screen (of type subscreen) at runtime.

    HP Confidential Modification & Enhancements

  • Calling Subscreens

    HP Confidential Modification & Enhancements

  • Caution: Function codes are only processed in the main screen's flow logic!You are not allowed enter a name for a subscreen's command field!You are not allowed to define GUI statuses for subscreens!No value for next screen may be entered in a subscreen's flow control!

    HP Confidential Modification & Enhancements

  • SAP applications programmers can reserve multiple subscreen areas on a screen.

    Subscreens are called from the flow control of a main screen using the statement CALL CUSTOMER-SUBSCREEN. You are not allowed to enter the name of a subscreen area in quotation marks, but you must enter the name of the function group that the called screen belongs to in single quotes. You can keep the screen number a variable by using fields; the number must, however, always contain four digits.

    Screen exit calls are inactive at first, and are skipped when a screen is processed.

    Only after a corresponding subscreen has been created in an enhancement project, and this project has been activated, will the system process the screen exit.

    HP Confidential Modification & Enhancements

  • Calling Customer Subscreens

    HP Confidential Modification & Enhancements

  • Whenever the statement CALL CUSTOMER-SUBSCREEN INCLUDING occurs at PBO in the flow control of a screen, a subscreen is included in the subscreen area defined by SAP application programmers. At this point, all modules called during the PBO event of the subscreen are also processed.

    The PAI event of a subscreen is processed when the calling screen calls the subscreen during its PAI event using the statement CALL CUSTOMER-SUBSCREEN .

    HP Confidential Modification & Enhancements

  • Customer Enhancement Projects

    HP Confidential Modification & Enhancements

  • SAP application programmers create SAP enhancements in transaction SMOD using function module exits, menu exits, and screen exits. Customers are given a catalog containing an overview of existing SAP enhancements. They can then combine the SAP enhancements they want into an enhancement project using transaction CMOD.

    HP Confidential Modification & Enhancements

  • SAP enhancements are made up of component parts. These components include function module exits, menu exits, and screen exits. A specific component may be used only once in a single SAP enhancement (this guarantees the uniqueness of SAP enhancements).Customer enhancement projects consist of SAP enhancements. Each individual SAP enhancement may be used only once in a single customer enhancement program (this guarantees the uniqueness of a customer project).

    HP Confidential Modification & Enhancements

  • Finding Enhancements

    Let us find the exits related to Transaction MIROEnter the package name of the program in Tcode SMODLook for source code Customer-Function in the relevant program

    These are the few ways of finding the exits.

    HP Confidential Modification & Enhancements

  • Tcode - SMOD

    HP Confidential Modification & Enhancements

  • Place your cursor on Enhancement input field and press F4.

    HP Confidential Modification & Enhancements

  • Click on Information System and enter package name and press Enter. To find the package name execute Tcode MIRO, choose menu System->Status. Double click on the program(screen) name.This will take you to ABAP Editor screen. Choose menu Goto->Attributes and you will find the package

    HP Confidential Modification & Enhancements

  • HP Confidential Modification & Enhancements

  • This displays all the exits available for package MRM

    HP Confidential Modification & Enhancements

  • Choose one of the exit,select Components radiobutton and click display

    HP Confidential Modification & Enhancements

  • Here you can see all the Exits related to enhancement

    HP Confidential Modification & Enhancements

  • Creating Enhancement ProjectsExecute TCode CMOD

    HP Confidential Modification & Enhancements

  • HP Confidential Modification & Enhancements

  • HP Confidential Modification & Enhancements

  • HP Confidential Modification & Enhancements

  • First, use the project management function to choose the SAP enhancements that you want and create an enhancement project.

    Next, edit your individual components using the project management function and document the entire enhancement project.

    Finally, activate the enhancement project (this activates all of the project's component parts).

    HP Confidential Modification & Enhancements

  • Activation of an enhancement project affects all of its components. After successful activation, the project has the status active.During activation, all programs, screens, and menus containing components that belong to the project are regenerated (programs at the time they are executed). After activation, you can see the enhancements in your application functions. The Deactivate function allows you to reset an enhancement project's status to inactive.

    HP Confidential Modification & Enhancements

  • DEMO

    HP Confidential Modification & Enhancements

  • Q&A

    HP Confidential Modification & Enhancements

  • Thank You

    HP Confidential Modification & Enhancements