Vous êtes sur la page 1sur 4

FUNCTION EXIT: Processing/checking before saving

SAPMF02D/EXIT_SAPMF02D_001: Customer master Data


SAPMF02K/EXIT_SAPMF02K_001: Vendor master Data
* User exit to ensure that all US customers have a group key
* entered on the customer master.
*
if i_kna1-land1 = 'US' and
i_kna1-brsch = ' '.
message e001(F2).
endif.

FIELD EXIT: MEINS (Base unit of measure)

Field exits:
To write your own field documentation, proceed as follows:
1. Call the Project management transaction by choosing Utilities Enhancements
Project management from the ABAP Workbench menu.
2. Choose Text enhancements Data elements New DE cust. docu.
The system displays a dialog box.
3. Specify the data elements name.
If you want to see a list of all the screens where this data element appears, choose Ref.
to screen before proceeding to the next step. The reference list shows you how many
standard R/3 screens your new documentation will affect.
4. Choose Change from the application toolbar.
5. On the next screen, ensure that the checkbox labelled Make available SAP
documentation in the form of an INCL is activated.
6. Choose Create.
7. Write your own documentation.
8. Save your changes.
*----------------------------------------------------------------------------------------------Steps:
Create a module pool program (ZENH1).
Create a screen (100).Enter fields for ZDEPT table.
Create a transaction code ZENH1.
*----------------------------------------------------------------------------------------------SCREEN EXIT:
Create a function group with name XZFG97
Activate the program SAPLXZFG97.
Create a subscreen (200) with program as SAPLXZFG97.
In SMOD, enter as follows:

Create an enhancement. Click components.


Add the following details:
Mpool
Name
ZENH1

Screen
No
0100

Subscreen
Area
SUB1

Include or
Subscreen
Function group No
SAPLXZFG97
0200

Text

Note:
While creating screen exit,
Screen numbers should be 4 digits.
Specify the TABLES ZEMP in the module pool program for the fields that are to be
displayed in the subscreen.
Check the screen type for subscreen.
CALL CUSTOMER-SUBSCREEN <SubscreenArea> including <SubScrPrg>
<SubScrName>.
*----------------------------------------------------------------------------------------------MENU EXIT:
1. Add the new menu item in Menu painter.
Technical name = +<3 digit>
Ex: +001
2. In the module pool program,
CASE SY-UCOMM.
WHEN +001.
CALL CUSTOMER-FUNCTION 001.
ENDCASE.
*----------------------------------------------------------------------------------------------FUNCTION EXIT:
3. Create a function group with any name (ZFG91).
Create a function module with the following name:
EXIT_<MpoolName>_001
Write the below code in the include program.
MESSAGE ID 'ZMSG' TYPE 'I' NUMBER '100'.
-Message for enhancement( menu exit)

Let the naming of module pool be n characters


Ex: n = 4.
*----------------------------------------------------------------------------------------------SMOD:
4. Create an enhancement (SMOD).
Add the function name (EXIT_<MpoolName>_001).
Add the module pool name and menu item (+001)

Do the syntax check to identify any errors.


5. Create a project with any name ZENH1 using CMOD transaction
Assign the enhancement component (ENH1).
Click components to specify the exits to be used.
Activate each compnent.
Activate the project.
6. Execute the project for the checking results.
7. Below is a screenshot that can be used for reference.

CUA code in extensions


GUI code, which you can activate, begins with + followed by 3 other characters defined by the user.
Example: +LST.

Naming convention for screen enhancements :


Message no. ENHANCEMENT 123
Adhere to the following naming conventions with screen enhancements:
Prefix: Name of the calling screen
(Program name and 4 digit screen number)
Infix: Name of the area
Suffix: Name of the screen that belongs to the subscreen
(Program name and 4 digit screen number,
your screen must belong to a function group X... ,
that is, your program name has to begin with SAPLX...)
Example:
Flow logic for program SAPxxyyy, screen 200 (PBO):
(...)
CALL CUSTOMER-SUBSCREEN TEST INCLUDING 'SAPLXxyz' '0100'
(...)
Entry as enhancement component:
SAPxxyyy0200_TEST_SAPLXxyz0100
If your screen number is entered dynamically in the flow logic, enter 0000 as your screen number.

*----------------------------------------------------------------------------------------------

Function exit
The naming convention for function exits is as follows:

Prefix: EXIT_

Infix: Module pool name

Suffix: 3 digits

Example:

If the module pool SAPMS38M contains the command CALL CUSTOMER-FUNCTION '001', it branches to
the function module EXIT_SAPMS38M_001 when you activate the enhancement component.

Vous aimerez peut-être aussi