- SAP ABAP - Web Dynpro
- SAP ABAP - Business Add-Ins
- SAP ABAP - User Exits
- SAP ABAP - Customer Exits
- SAP ABAP - SAPscripts
- SAP ABAP - Smart Forms
- SAP ABAP - Dialog Programming
- SAP ABAP - Report Programming
- SAP ABAP - Object Events
- SAP ABAP - Interfaces
- SAP ABAP - Encapsulation
- SAP ABAP - Polymorphism
- SAP ABAP - Inheritance
- SAP ABAP - Classes
- SAP ABAP - Objects
- SAP ABAP - Object Orientation
- SAP ABAP - Deleting Internal Tables
- SAP ABAP - Reading Internal Tables
- SAP ABAP - Copying Internal Tables
- ABAP - Populating Internal Tables
- SAP ABAP - Creating Internal Tables
- SAP ABAP - Internal Tables
- SAP ABAP - Native SQL Overview
- SAP ABAP - Open SQL Overview
- SAP ABAP - Include Programs
- SAP ABAP - Function Modules
- SAP ABAP - Macros
- SAP ABAP - Subroutines
- SAP ABAP - Modularization
- SAP ABAP - Lock Objects
- SAP ABAP - Search Help
- SAP ABAP - Views
- SAP ABAP - Structures
- SAP ABAP - Tables
- SAP ABAP - Data Elements
- SAP ABAP - Domains
- SAP ABAP - Dictionary
- SAP ABAP - Exception Handling
- SAP ABAP - Formatting Data
- SAP ABAP - Date & Time
- SAP ABAP - Strings
- SAP ABAP - Decisions
- SAP ABAP - Loop Control
- SAP ABAP - Operators
- SAP ABAP - Constants & Literals
- SAP ABAP - Variables
- SAP ABAP - Data Types
- SAP ABAP - Basic Syntax
- SAP ABAP - Screen Navigation
- SAP ABAP - Environment
- SAP ABAP - Overview
- SAP ABAP - Home
SAP ABAP Useful Resources
- SAP ABAP - Discussion
- SAP ABAP - Useful Resources
- SAP ABAP - Quick Guide
- SAP ABAP - Questions Answers
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
SAP ABAP - User Exits
User exits are used in an extraction if the standard SAP extractors do not provide the expected data or the required functionapty, for instance in authorizations or time checks. User exits are commonly used in Sales and Distribution (SD) modules. There are many exits provided by SAP in the areas of sales, transportation, shipping and bilpng. A user exit is designed to make some changes when standard SAP is not capable of fulfilpng all the requirements.
To be able to access what exits are available in each area of sales, go to IMG using this path: IMG → Sales and Distribution → System Modifications → User Exits. The documentation for each exit in the areas of SD is explained thoroughly.
For instance, if you want to find user exits in Sales Document Processing (contract, quotation or sales order), follow the path mentioned above and continue to expand the node User Exits in Sales → User Exits. Cpck on icon documentation to see all user exits available in Sales Document Processing.
S.No. | User Exit & Description |
---|---|
1 | USEREXIT_FIELD_MODIFICATION Used to modify screen attributes. |
2 | USEREXIT_SAVE_DOCUMENT Helps in performing operations when the user hits Save. |
3 | USEREXIT_SAVE_DOCUMENT_PREPARE Very useful to check input fields, put any value in the field or show a popup to users and to confirm the document. |
4 | USEREXIT_MOVE_FIELD_TO_VBAK Used when user header changes are moved to header work area. |
5 | USEREXIT_MOVE_FIELD_TO_VBAP Used when user item changes are moved to SAP item work area. |
A User Exit serves the same purpose as Customer Exits but they are available only for the SD module. The exit is implemented as a call to a Function Module. User Exits are modifications to SAP standard programs.
Example
REPORT ZUSEREXIT1. TABLES: TSTC, TSTCT, TADIR, TRDIR, TFDIR, ENLFDIR, MODSAPT, MODACT. DATA: JTAB LIKE TADIR OCCURS 0 WITH HEADER LINE, field1(30), 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. DESCRIBE TABLE JTAB. SKIP. FORMAT COLOR COL_TOTAL INTENSIFIED ON. WRITE:/ No of Exits: , SY-TFILL. ELSE. FORMAT COLOR COL_NEGATIVE INTENSIFIED ON. WRITE:/(95) User Exit doesn’t exist . ENDIF. ELSE. FORMAT COLOR COL_NEGATIVE INTENSIFIED ON. WRITE:/(95) Transaction Code Does Not Exist . ENDIF. AT LINE-SELECTION. GET CURSOR FIELD field1. CHECK field1(4) EQ JTAB . SET PARAMETER ID MON FIELD sy-psel+1(10). CALL TRANSACTION SMOD AND SKIP FIRST SCREEN.
While processing, enter the transaction code ‘ME01’ and press F8 (Execute) button. The above code produces the following output −
Advertisements