Sie sind auf Seite 1von 38

SAP Application Enhancements

Topics
Overview How to create enhancements Function Module exits Menu exits Screen exits BADI
2

SAP Application Enhancement


Allows customers to enhance application functions. Preplanned by SAP & consist of several components. Application Enhancements are inactive when delivered.They can be completed & activated by customers as needed.
3

SAP Application Enhancement


Characteristics
Each enhancement gives set of preplanned precisely defined functions. Interface between SAP & Customer function is clearly defined.

SAP Application Enhancement


Advantages
No need to adjust enhancement during upgrade No need of indepth knowledge on implementing SAP.

SAP Application Enhancement


Types (Component Parts)
Function Module exits. Menu exits. Screen exits.

SAP Application Enhancements


Transaction Codes
SMOD CMOD

Function Module Exits


Implement additional logic in function modules The source code is written in the function module We can also create screen,text elements & includes for the function group

Function Module Exits


Have effect only when the enhancement project is active. The statement Include has to be changed.The include name begins with ZX

Function Module Exits


Calling function module exits
CALL CUSTOMER-FUNCTION nnn PERFORM USEREXIT_XXXX

10

Function Module Exits


How to see if program has function module exit.
In the program search for call customerfunction. Check the development class using GOTOAttributes from menu.Then search in SMOD using the development class.

11

Menu Exits
Attach functions to menu options in SAP. Adds text to the menu entry.. Becomes visible in the SAP menu when we activate the exit. When this menu is chosen SAP executes standard code or custom code.

12

Menu Exits
Requirements
The GUI interface should have function codes with plus sign (+) Function codes appear in GUI only on activation. Function codes do not appear on screen.

13

Screen Exits
Makes use of reserved sections of main screen Use
Displays additional information Users can also input data in this section.

The necessary input/output fields have to be defined on the customer screen


14

Screen Exit
Screen Exits are inactive at first & skipped when screen is processed. For processing screen exit
Create subscreen in enhancement project Activate the project

15

Screen Exit
Transporting Data to Subscreen
Global data of calling program is not known to function grp containing subscreen. Function module exits are used CALL CUSTOMER-FUNCTION 001 EXPORTING I_var = gi_field Gi_field (Global data)
16

Screen Exit
Transporting data from subscreens
Transports data from subscreen to global data Function module exits are used CALL CUSTOMER-FUNCTION 001 IMPORTING I_var = gi_field Gi_field (Global data)
17

Screen Exit
Steps
Create subscreen Create PBO/PAI modules Do not change the interfaces in the calling function grp that the subscreen & function module exit belong Do not add function modules to the calling function group
18

BADI
Object Oriented

BADI
Advantages
Reusable Implemented using OOPs

Until 4.0 function groups & modules were nearest to OOPs. However the differentiation factor was instance management (Global Data)
20

BADI Working
How BADI works
Enhancements are possible by SAP application programs Requires 1 interface & 1 adapter class that implements this interface Interface is implemented by the user

21

BADI Components
BADI contains components of enhancement Following components are contained in BADI
Program enhancements Menu enhancements

Currently screen enhancements are not supported.


22

BADI Components
Following components get created when we define BADI
Interface Generated Class (Adapter) which implements the interface

23

BADI Components
Interface
Has definition of its own No implementation of its own Implemented by classes

24

BADI Components
Adapter Class performs following functions:
Filtering (Ensures only relevent implementations are called) Control (Calls the active implementation)

25

BADI : Calling Programs


1. Declare reference variable referring the BADI interface:
Data: exit_ref TYPE REF TO IF_EX_<badi>

2. Create Object reference.

26

BADI : Calling Programs


CALL METHOD cl_exithandler=>get_instance CHANGING instance = exit_ref

3. Use this object reference to call required methods available with enhancement
27

BADI: Calling Programs


CALL METHOD exit_ref method exporting <I_variables> importing <E_variables>

28

BADI :Defn & Implmn


BADI Definition (SE18) BADI Implementation (SE19) Name of implementing class
Y or Z CL_ (Class) IM_ (Implementation) Name of implementation
29

BADI Definition
Naming
<BADI> <ZBADI> /Namespace/<BADI>

30

Interface
Naming
IF_EX_<BADI> ZIF_EX_<BADI> /namespace/IF_EX_<BADI>

31

Adapter Class
Naming
CL_EX_<BADI> ZCL_EX_<BADI> /namespace/CL_EX_<BADI>

32

BADI Implementation
Naming
<IMPL> <ZIMPL> /namespace/<impl>

There can be only 1 active implementation Activation/Deactivation possible only in original system.Has to be transported
33

BADI Reusability
Define the BADI once Tick the checkbox multiple use/ Reusable Define multiple implementations. Note :- We cannot define the sequence in which the implementations will be processed.

34

BADI Implementation
1 BADI defn can have multiple BADI implementations even though the multiple use box is not ticked. Here there will be only 1 active implementation.

35

BADI Filters
BADI can be filter dependant Specify filter type in form of Data Element When enhancement called pass the filter value.

36

Questions

37

Thank You

38

Das könnte Ihnen auch gefallen