"Transfer from http://blog.csdn.net/zhongguomao/article/details/6712580"
Choose the table vbap or VBAK (depending on header or item)
Click on button "Append structures".
It'll propose you the standard name for the table zavbap or Zavbak
Add fields with prefix ZZ
Trans SE51 maintain user exit screens in program sapmv45a
8459 User Exit Item level
8309 User Exit Header level
You can then design your own layout. and define your flow logic
PBO Modules Mv45aozz
PAI Modules Mv45aizz
Data Definitions Mv45atzz
Subroutines in Mv45afzz
User Exits in Sales Document processing
This IMG step describes additional installation-specific processing in sales Document processing. In particular, the required includes and user exits is described.
Involved program components
System Modifications for sales Document processing affect different areas. Depending on the modification, your make the changes in the program components provided:
? Mv45atzz
For entering metadata for sales Document processing. User-specific metadata must start with "ZZ".
? Mv45aozz
For entering additional installation-specific modules for sales Document processing which is called up by the screen and Run under PBO (Process before output) prior to output of the screen. The modules must start with "ZZ".
? Mv45aizz
For entering additional installation-specific modules for sales Document processing. These is called up by the screens and run under PAI (Process after Input) through data input (for example, data validation). The modules must start with "ZZ".
? Mv45afzz and MV45EFZ1
For entering Installation-specific FORM routines and for using the user exits, which may is required and can be used if necess ary. These program components is called up by the modules in Mv45aozz or Mv45aizz.
User exits in the program Mv45afzz
The user exits which you can use for modifications in Sales Document processing is listed below.
? Userexit_delete_document
This user exit can is used for deleting data which is stored in a separate table during sales document creation, for exam PLE, if the sales document is deleted.
For example, if a additional table is filled with the name of the person in charge (Ernam) during order entry, this data Can also is deleted after the sales order has been deleted.
The user exit is called to the end of the FORM routine Beleg_loeschen shortly before the routine Beleg_sichern.
? Userexit_field_modification
This user exit can is used to modify the attributes of the.
To does this, the screens fields is allocated to so-called modification groups 1-4 and can be edited together during a mod Ification in ABAP. If A field has no field name, it cannot is allocated to a group.|
The usage of the field groups (Modification group 1-4) is as follows:
? Modification group 1:automatic modification with transaction mfaw
? Modification group 2:it contains ' LOO ' for step loops fields
? Modification group 3:for modifications which depend on check tables or on other fixed information
? Modification group 4:is not used
The FORM routine is called-for-every field of a screen. If you require changes to being made, you must make them in this user exit.
This FORM routine are called up by the module Feldauswahl.
See the screens Painter Manual for further information on structuring the interface.
? Userexit_move_field_to_vbak
Use the This user exit to assign values to new in the sales document header level. It is described in the section "Transfer of the customer master fields into the sales document".
The user exit is called to the end of the FORM routine Vbak_fuellen.
? Userexit_move_field_to_vbap
Use the This user exit to assign values to new fields at the sales document item level. It is a described in the sections "Copy Customer Master fields into the sales document".
The user exit is called to the end of the FORM routine Vbap_fuellen.
? Userexit_move_field_to_vbep
Use this user exit to assign values to new fields at the level of the sales document schedule lines.
The user exit is called to the end of the FORM routine Vbep_fuellen.
? Userexit_move_field_to_vbkd
Use the-user exit to assign values to new fields for business data of the sales document. It is a described in the sections "Copy Customer Master Fields into sales document".
The user exit is called to the end of the FORM routine Vbkd_fuellen.
? Userexit_number_range
Use this user exit to define the number ranges for internal document number assignment depending on the required fields. For example, if you want to define the number range depending on the sales organization (vkorg) or in the selling company (Vkbur), use this user exit.
The user exit is called the FORM routine Beleg_sichern.
? 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 KOM P taken as a basis for pricing.
? Userexit_read_document
You use the This user exit if further additional tables is to is read when importing TA01 or TA02.
The user exit is called to the end of the FORM routine Beleg_lesen.
? Userexit_save_document
Use the This user exit to fill user-specific statistics update tables.
The user exit is called to the FORM routine beleg-sichern before the COMMIT command.
Note
If a standard field is changed, the field R185d-dataloss are set to X. The system queries this indicator at the beginning of the safety routine. This is what this indicator must also was set during the maintenance of user-specific tables that was also to be saved.
? Userexit_save_document_prepare
Use the This user exit to make certain changes or checks immediately before saving a document. It is the last possibility for changing or checking a document before posting.
The user exit is carried off at the beginning of the FORM routine Beleg_sichern.
User exits in the program Mv45afza
? Userexit_move_field_to_komkd
Use this user exit to include or assign values to additional header fields in the communication structure KOMKD taken as a Basis for the material determination. This was described in detail in the section "New fields for material determination".
? Userexit_move_field_to_kompd
Use this user exit to include or assign values to additional item fields in the communication structure KOMPD taken as a B ASIS for the material determination. This was described in detail in the section "New fields for material determination".
? userexit_move_field_to_komkg
Use this user exit to include or assign values to additional fields in the communication structure komkg taken as a basis For material determination and material listing. This was described in detail in the section "New Fields for Listing/exclusion".
? Userexit_move_field_to_kompg
Use this user exit to include or assign values to additional fields in the communication structure kompg taken as a basis For material determination and material Listung. This was described in detail in the section "New Fields for Listing/exclusion".
? Userexit_refresh_document
With this user exit, you can reset certain customer-specific fields as soon as processing of a sales document is finished And before the following document is edited.
For example, if the credits limit of the Sold-to party was read during document processing, in each case it must be reset AG Ain before processing the next document so, the credit limit isn't used for the Sold-to party of the following Docume Nt.
The user exit is executed when a document was saved if you leave the processing of a document with F3 or F15.
The user exit is called to the end of the FORM routine Beleg_initialisieren.
Mv45aozz Sales Order Enhancement points