1. Brief Introduction to enhancements
1.1SmodIncluding specific enhancements, whileCmodIs an enhancement that includes a set of smod codes.
1.2 user exits (function module exits) is provided by SAP. Its naming rules are as follows:
Exit _ <program name> <3 digit suffix>
Example:
The program corresponding to the SD va01 transaction is sapmv45a. You will find the following code in the Program (using the call customer-function string:
Call customer-function '003'
Exporting
Xvbak = vbak
Xvbuk = vbuk
Xkomk = tkomk
Importing
Lvf_subrc = lvf_subrc
Tables
Xvbfa = xvbfa
Xvbap = xvbap
Xvbup = xvbup.
The name of the exit callfunction module is exit_sapmv45a_003.
2. Try smod to create an SAP enhancement first.
2.1 select an enhancement, such as sdvfx001. click Modify to go to the SAP Enhancement Maintenance screen;
2.2 click the "component" button to go to the component maintenance screen;
2.3 move the cursor to "function module name" and enter the module name, for example, exit_saplv60b_001;
2.4 select the "code modification" button to enter the function module;
2.5 double-click the contained unit of the function module to enter the contained unit, add the custom code, and activate and save the code;
3. Use cmod to create an enhancement project
3.1 enter a custom project name and click "CREATE ";
3.2. Go to the enhancement project and select "configuration enhancement" To Go To The enhancement configuration screen;
3.3 enter an enhancement name, for example, sdvfx001
3.4 save and exit;
4. Use cmod to activate the enhanced project.
How to find
* Determine whether an enhanced definition exists (smod)
Select single name from modsapa into mod0-name
Where name = 'ppco0002 '.
If sy-subrc = 0.
Endif.
Select single * From tadir into ps_tadir_db
Where pgmid = 'r3tr'
And object = 'smod'
And obj_name = 'ppco0002 '.
* Determine whether the definition of the corresponding enhancement project exists (cmod)
Select single name from modattr into mod0-name
Where name = 'ppco0002 '..
* Extract the enhanced definition component (you can use this extension to enhance the definition)
Select * From modsap
Where name = 'ppco0002 '.
* Determine whether the enhancement is transplanted to Badi for implementation.
* Enhancement & has already been migrated in business add-in Definition
Select single migrated badi_def into (migrated, exit_name)
From modsapa where name = modname.
If sy-subrc = 0 and migrated = seex_true.
Message s621 with modname exit_name.
Check Mode ne 'cham '.
Endif.
Modtyp type:
E: function exit
S: Screen
T: Table
C: Gui code
SAP enhancements exist in the modsap table
* For more information about the enhancement components, see mod_sap_member_text.
* Obtain information about the exit function module.
Select single * From tftit
Where "spras" = '1' and "funcname" = 'exit _ saplcore_001'
If sy-subrc = 0.
Endif.
* Functions worth learning
Mod_kun_activate (reports will be operated)
Related connections:
Http://blog.csdn.net/compassbutton/archive/2007/03/19/1533453.aspx
Http://blog.csdn.net/CompassButton/archive/2005/02/05/281437.aspx