因為想要在建立訂單時判斷銷售人員是否已離職
所以必須用到User Exit ,也就是enhancement
在網路上找到一些不錯的資訊

 

Enhancement Description
USEREXIT_CHANGE_SALES_ORDER In the standard SAP R/3 System, the quantity and confirmed date of the sales document schedule line is changed automatically if a purchase requisition is allocated, and it or the sales document is changed (for example, quantity, date).
USEREXIT_CHECK_VBAK This user exit can be used to carry out additional checks (e.g. for completion) in the document header. The system could, for example, check whether certain shipping conditions are allowed for a particular customer group.
USEREXIT_CHECK_VBAP This user exit can be used to carry out additional checks (e.g. for completion) at item level.
USEREXIT_CHECK_VBEP This user exit can be use to carry out additional checks (e.g. for completion) on the schedule line.
USEREXIT_CHECK_VBKD The user exit can be used to carry out additional checks (e.g. for completion) on the business data in the order.
USEREXIT_CHECK_VBSN You can use this user exit to carry out additional checks (e.g. for completion) on the serial number.
USEREXIT_CHECK_XVBAP_FOR_DELET In this user exit, you can enter additional data for deletion of an item. If the criteria are met, the item is not deleted (unlike in the standard system).
USEREXIT_CHECK_XVBEP_FOR_DELET In this user exit, you can enter additional data for deletion of a schedule line. If the criteria are met, the schedule line is not deleted (unlike in the standard system).
USEREXIT_CHECK_XVBSN_FOR_DELET In this user exit, you can enter additional criteria for deletion of the serial number. If the criteria are met, the serial number is not deleted (unlike in the standard system).
USEREXIT_COBL_RECEIVE_VBAK Option to assign values from the document header to the new fields.
USEREXIT_COBL_RECEIVE_VBAP Option to supply values from the item to the new fields.
USEREXIT_COBL_SEND_HEADER A changed field can be copied from the structure to the header (see source text MV45AFZB)
USEREXIT_COBL_SEND_ITEM A changed field can be copied from the structure into the item. You could use the user exit to display a certain field in the account assignment block (see also MV45AFZB).
USEREXIT_CUST_MATERIAL_READ You can use this user exit to set another customer number in the customer material info record (e.g. with a customer hierarchy)
USEREXIT_DELETE_DOCUMENT This user exit can be used for deleting data which was stored in a separate table during sales document creation, for example, if the sales document is deleted.
USEREXIT_FIELD_MODIFICATION This user exit can be used to modify the attributes of the screen fields.
USEREXIT_FILL_VBAP_FROM_HVBAP You can use this user exit to fill additional fields in the sub-item with data from the main item.
USEREXIT_MOVE_FIELD_TO_COBL Option to include new fields in structure COBL.
USEREXIT_MOVE_FIELD_TO_KOMKH You can use this user exit to include new fields for batch determination (document header).
USEREXIT_MOVE_FIELD_TO_KOMPH You can use this user exit to include new fields for batch determination (document item).
USEREXIT_MOVE_FIELD_TO_ME_REQ "With this user exit you can include additional fields for the following fields:
• EBAN (purchase requisition)
• EBKN (purchase requisition-account assignment)
• USEREXIT_GET_FIELD_FROM_SDCOM"
USEREXIT_MOVE_FIELD_TO_TVCOM_H You can use this user exit to influence text determination for header texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
USEREXIT_MOVE_FIELD_TO_TVCOM_I You can use this user exit to influence text determination for item texts. For example, you can include new fields for text determination or fill fields that already exist with a new value.
USEREXIT_MOVE_FIELD_TO_VBAK Use this user exit to assign values to new fields at sales document header level.
USEREXIT_MOVE_FIELD_TO_VBAKKOM Option to include additional fields in structure VBAKKOM (communiction fields for maintaining the sales document header)
USEREXIT_MOVE_FIELD_TO_VBAP Use this user exit to assign values to new fields at sales document item level
USEREXIT_MOVE_FIELD_TO_VBAPKOM Option to include additional fields in structure VBAPKOM (communication fields for maintaining a sales item)
USEREXIT_MOVE_FIELD_TO_VBEP Use this user exit to assign values to new fields at the level of the sales document schedule lines
USEREXIT_MOVE_FIELD_TO_VBEPKOM Option to include additional fields in structure VBEPKOM (communication fields for maintaining a sales document schedule line)
USEREXIT_MOVE_FIELD_TO_VBKD Use this user exit to assign values to new fields for business data of the sales document
USEREXIT_MOVE_FIELD_TO_VBSN You can use this user exit to include fields in structure VBSN (scheduling agreement-related change status).
USEREXIT_MOVE_WORKAREA_TO_SDWA You can use this user exit to format additional work areas for the variant configuration. You will find notes on the user exit in MV45AFZB.
USEREXIT_NEW_PRICING_VBAP Option for entry of preconditions for carrying out pricing again (e.g. changes made to a certain item field could be used as the precondition for pricing to be carried out again). Further information in MV45AFZB.
USEREXIT_NEW_PRICING_VBKD Option for entry of preconditions for carrying out pricing again (e.g. changes to the customer group or price group could be set as the preconditions for the system to carry out pricing again). Further information in MV45AFZB.
USEREXIT_NUMBER_RANGE user exit to define the number ranges for internal document number assignment depending on the required fields
USEREXIT_PRICING_PREPARE_TKOMK Use this user exit if you want to include and assign a value to an additional header field in the communication structure KOMK taken as a basis for pricing.
USEREXIT_PRICING_PREPARE_TKOMP Use this user exit if you want to include or assign a value to an additional item field in the communication structure KOMP taken as a basis for pricing.
USEREXIT_READ_DOCUMENT "You use this user exit if further additional tables are to be read when importing TA01 or TA02.
The user exit is called up at the end of the FORM routine BELEG_LESEN."
USEREXIT_SAVE_DOCUMENT Use this user exit to fill user-specific statistics update tables.
USEREXIT_SAVE_DOCUMENT_PREPARE Use this user exit to make certain changes or checks immediately before saving a document.
USEREXIT_SET_STATUS_VBUK In this user exit you can you can store a specification for the reserve fields in VBUK (header status).
USEREXIT_SET_STATUS_VBUP In this user exit you can you can store a specification for the reserve fields for VBUP (item status).
USEREXIT_SOURCE_DETERMINATION You can use this user exit to determine which plant will be used for the delivery
USEREXIT_STATUS_VBUK_INVOICE You can use this user exit to influence billing status at header level.
SDAPO001 Activating Sourcing Subitem Quantity Propagation
SDTRM001 Reschedule schedule lines without a new ATP check
V45A0001 Determine alternative materials for product selection
V45A0002 Predefine sold-to party in sales document
V45A0003 Collector for customer function modulpool MV45A
V45A0003 Collector for customer function modulpool MV45A
V45A0004 Copy packing proposal
V45E0001 Update the purchase order from the sales order
V45E0002 Data transfer in procurement elements (PRreq., assembly)
V45L0001 SD component supplier processing (customer enhancements)
V45L0001 SD component supplier processing (customer enhancements)
V45L0001 SD component supplier processing (customer enhancements)
V45L0001 SD component supplier processing (customer enhancements)
V45L0001 SD component supplier processing (customer enhancements)
V45L0001 SD component supplier processing (customer enhancements)
V45L0001 SD component supplier processing (customer enhancements)
V45P0001 SD customer function for cross-company code sales
V45S0001 Update sales document from configuration
V45S0003 MRP-relevance for incomplete configuration
V45S0003 MRP-relevance for incomplete configuration
V45S0004 Effectivity type in sales order
V45W0001 SD Service Management: Forward Contract Data to Item
V46H0001 SD Customer functions for resource-related billing
V46H0001 SD Customer functions for resource-related billing
V60F0001 SD Billing plan (customer enhancement) diff. to billing plan
SDVFX001 User exit header line in delivery to accounting
SDVFX002 User exit for A/R line (transfer to accounting)
SDVFX003 User exit: Cash clearing (transfer to accounting)
SDVFX004 User exit: G/L line (transfer to accounting)
SDVFX005 User exit: Reserves (transfer to accounting)
SDVFX006 User exit: Tax line (transfer to accounting)
SDVFX007 User exit: Billing plan during transfer to Accounting
SDVFX008 User exit: Processing of transfer structures SD-FI
SDVFX009 Billing doc. processing KIDONO (payment reference number)
SDVFX010 User exit item table for the customer lines
SDVFX011 Userexit for the komkcv- and kompcv-structures
V05I0001 User exits for billing index
V05I0001 User exits for billing index
V05I0001 User exits for billing index
V05I0001 User exits for billing index
V05N0001 User Exits for Printing Billing Docs. using POR Procedure
V05N0001 User Exits for Printing Billing Docs. using POR Procedure
V05N0001 User Exits for Printing Billing Docs. using POR Procedure
V60A0001 Customer functions in the billing document
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V60P0001 Data provision for additional fields for display in lists
V61A0001 Customer enhancement: Pricing
V02V0001 Sales area determination for stock transport order
V02V0002 User exit for storage location determination
V02V0003 User exit for gate + matl staging area determination (headr)
V02V0004 User Exit for Staging Area Determination (Item)
V50PSTAT Delivery: Item Status Calculation
V50Q0001 Delivery Monitor: User Exits for Filling Display Fields
V50Q0001 Delivery Monitor: User Exits for Filling Display Fields
V50R0001 Collective processing for delivery creation
V50R0002 Collective processing for delivery creation
V50R0004 Calculation of Stock for POs for Shipping Due Date List
V50S0001 User Exits for Delivery Processing
V50S0001 User Exits for Delivery Processing
V53C0001 Rough workload calculation in time per item
V53C0002 W&S: RWE enhancement - shipping material type/time slot
V53W0001 User exits for creating picking waves
V53W0001 User exits for creating picking waves
V53W0001 User exits for creating picking waves
VMDE0001 Shipping Interface: Error Handling - Inbound IDoc
VMDE0002 Shipping Interface: Message PICKSD (Picking, Outbound)
VMDE0003 Shipping Interface: Message SDPICK (Picking, Inbound)
VMDE0004 Shipping Interface: Message SDPACK (Packing, Inbound)
SDQUX001 User exit: SD product allocation processing, extended checks
SDQUX002 SD product allocation processing, change schedule line
SDQUX003 User-Exit : SD Product allocation, extended checks (ATP)
SDQUX004 Product Allocations: Change the Product Allocation Steps
SDQUX005 Product Allocations: Adjust product allocation quantities
SDVAX001 Determine Billing Plan Type
V09A0001 Reference/duplicate decision making manual address
V09A0002 Partner type KU EXIT for NO_KNVV

 

SAP User ExitS and Enhancement

USEREXIT

UserExits 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 userexits are generally collected in includes and attached to the standard program by the SAP.

All Userexits start with the word USEREXIT_...

FORM USEREXIT_..

z..

ENDFORM.

The problem lies in finding the correct userexit and how to find it if one exists for the purpose. Once the correct userexit is found the necessary.

customer code is inserted in the customer include starting with the z..in the form routine.

E.g. USEREXIT_SAVE_DOCUMENT_PREPARE

Certain application like SD still provide this form of enhancement using userexit but this practice is no longer being followed for newer extensions.

instead they are using EXITs which come bundeled in enhancement packages . Neverthiless existing USEREXITS will be supported by SAP an all the newer versions of SAP.

HOW TO FIND USEREXITS


1) To find userexits in SD module , goto object navigator(SE80) and select development class(should be package) from the list and enter VMOD in it. All of the userexits in SD are contained in the development class VMOD. Press enter and you will find all the includes which contain userexits in SD for different functions like PRICING, ORDER PROCESSING etc. Select the userexit according to the requirement and read the comment inserted in it and start coding .

Some examples of userexits in SD(SALES & DISTRIBUTION ) are:

1)ADDING OF NEW FIELDS IN PRICING

In Pricing in SD the fields on the basis of which pricing is done are derived from the FIELD CATALOG which is a structure KOMG .This structure is used to transfer transaction data to the pricing procedure in SD and is also known as communication structure.This structure KOMG consists of two tables KOMK for Header related fields and KOMP for item related fields.

The fields which are not in either of the two tables KOMK and KOMP cannot be used in pricing .Sometimes a need arises when the pricing is to be based on some other criteria which is not present in the form of fields in either of the two tables.


This problem can be solved by using USEREXITS which are provided for pricing in SD.

Pricing takes place both when the SALES ORDER ( Transaction VA01) is created as well as when INVOICING ( Transaction VF01) is done.Hence SAP provides 2 userexits ,one for sales order processing which is

USEREXIT_PRICING_PREPARE_TKOMP or

USEREXIT_PRICING_PREPARE_TKOMK

Depending upon which table (KOMK or KOMP) the new fields were inserted we use either of the above two userexits.These userexits are found in include MV45AFZZ of the standard SAP sales order creation program SAPMV45A.

In the case of userexit which will be called when invoicing is done ,these are provided in the include RY60AFZZ which is in the standard SAPprogram SAPMV45A. The name of the userexits are same. i.e

USEREXIT_PRICING_PREPARE_TKOMP or

USEREXIT_PRICING_PREPARE_TKOMK

These userexits are used for passing the data from the communication structure to the pricing procedure, for this we have to fill the newely created field in the communication structure KOMG for this we fill the code in the above userexit using the MOVE statement after the data that has to be passed is taken from the database table by using the SELECT statement. The actual structure which is visible in these userexits and which is to be filled for that particular field is TKOMP or TKOMK.

Before the coding for these userexits is done ,it is necessary to create a new field in either of the two tables KOMK or KOMP .For this purpose includes are provided in each of them .

To create the field in header data(KOMK) the include provided is KOMKAZ and to create the field in item data(KOMP) the include provided is KOMPAZ.

One possible example for the need of creating new fields can be e.g. Frieght to be based upon transportation zone ,for this no field is available in field catalog and hence it can be created in KOMK and then above userexits can be used to fill the transportation data to it.

2)The other method of finding userexit is to find the word USEREXIT in the associated program of the transaction for which we want to determine userexit using SE38.

3)The other method of finding userexits is to find the include in case of SD/MM applications where the userexits are located ,this can be found in the SAP reference IMG generally in the subfolder under SYSTEM MODIFICATION.

Some other examples of userexits in SD are:
USEREXIT_NUMBER_RANGE


This userexit is used to assign a different internal document number to the
sales order(VA01) when it is created depending on some criteria like a different SALES ORGANIZAION(VKORG) .
USEREXIT_SAVE_DOCUMENT_PREPARE


This userexit is used to insert the ABAP code which will be called when the document (sales order VA01) is just about to be saved.This userexit is used generally for custom checks on different fields , to display some information before the order will be saved or for making changes to certain fields before the sales order will be saved.
Exits & Enhancements


There are mainly six types of EXITs in sap which have been collected in the form of enhancement packages and attached to standard code in SAP.


These are different from USEREXIT in the way that they are implemented in the form of FUNCTIONs while in USEREXITS we use form routines for their implementation. These are also sometimes known as function exits .


These start from the word EXIT_ followed by the program name and then followed by a three digit number.
e.g. EXIT_SAPMV45A_002


This exit is found in SD in enhancement V45A0002.

1)MENU EXITS

2)FUNCTION EXITS

3)TABLE EXITS

4)SCREEN EXITS

5)KEYWORD EXITS

6)FIELD EXITS

We use SAP transactions CMOD and SMOD to manage exits. Before implementing an exit , it is required to create the project by using CMOD.

Selecting the enhancement e.g. V45A0002 and selecting the component (one which fulfills our need) i.e the exit which will be implemented in SMOD and after coding has been done the project has to be activated.An exit can be coded only once.

FUNCTION EXITS

These are used to add 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.

The function exits are called from the standard SAP program in the form of ABAP statement CALL
CUSTOMER-FUNCTION 'NNN'.

This is in contrast to USEREXITs where PERFORM statement is used to call the required userexit.

To implement the FUNCTION EXITs first of all the project is created and a suitable enhancement package is selected and from its compnents the function exit to be implemented is selected and on double clicking it the exit code will appear in ABAP EDITOR(se38) where a Z include will be found and the customer code should be entered in this include.

E.g.

ADDING A DEFAULT SOLD-TO-PARTY in Sales Order Creation

To show a default sold-to-party in this field when the user creates a sales order (VA01) we can use a function exit. This function exit is located in enhancement no V45A0002 . Before we can choose the exit we have to create a project in CMOD after that enter V45A0002 in the enhancement field and click on the components . In the components you will see the exit EXIT_SAPMV45A_002 . This exit is used for our purpose.

Double clicking on this exit will takes us to function builder (SE37) . This function exit has one exporting parameters and two importing parameters, we are interested in exporting parameter which is E_KUNNR of type KNA1-KUNNR i.e if we move the desired customer name to this structure(E_KUNNR) it will be shown in the field as the default value when we create the sales order.

This function also contains a customer include ZXVVA04 . This include will be used to write our custom code .

Double clicking on this include and it will prompt us that this include does not exists do you want to create this object ,select yes and the include will be created .In this include we can write our own code that will fill the field E_KUNNR.
e.g. E_KUNNR = 301.

Activate the include and Activate the project. Now when ever the SALES ORDER will be created , sold-to-party field will come up with a predefined customer .

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

If a particular screen and program name is not specified than the field exit will effect all the screens containing that data element.

The function module associated with field exit shows two parameters.

INPUT and OUTPUT. Input parameter contains the data passed to the field exit when the field exit was invoked by the R/3 , We can write our own code to change the output parameter depending upon our requirements.

Before the field exit can have any effect the system profile parameter.

ABAP/FIELDEXIT in all the application servers should be set to YES.

 

 

 

 

 

 

arrow
arrow
    全站熱搜

    skylit 發表在 痞客邦 留言(0) 人氣()