SAP substitution
http://hi.baidu.com/jgzh3/item/13b3b91f3952d5f964eabf1b
之前记得看过,后来就忘记了。介绍这篇还不错,转下
http://help.sap.com/saphelp_erp60_sp/helpdata/en/5b/d2316743c611d182b30000e829fbfe/content.htm substitution exit:
http://help.sap.com/saphelp_erp60_sp/helpdata/en/5b/d231a843c611d182b30000e829fbfe/content.htm
TCODE: 0B28/GGBO; TABLE:T80D ; Program:RGGBR000/RGGBS000
===========Substitution user exits Details==================
Userexits are user-defined FORM routines that are used to calculate and/or replacevalues within a validation, substitution, or rule.
Userexits have the following format:
· U (for a user-defined user exit)or S (for a standard userexit)
· The user exit number (threedigits)
For example, U123 is a user exit.
Youcan configure the form pool name of the user exits and must store it in thetable for client-dependent user exits (T80D) in Customizing. Table T80D contains theform pool names for the user exits used in validations, substitutions, andrules. Each validation/substitution form pool is client-dependent. (For moreinformation, refer to the Maintain Client-DependentUser Exits activity in the Implementation Guide (IMG) for Special Purpose Ledger.)
Example form pools RGGBS000 and RGGBR000 for client000 are shipped with the SAP system. You must copy these form pools andconfigure them in T80D. The new form pool name should conform to thecustomer’s naming convention (beginning with the letter Z) so that is not overwritten whenthe next SAP upgrade is installed (for example, ZGGBR000).
Example FORM routine for substitution exit 001(U001).
TABLES:COBL.
FORM U001. COBL-KOSTL = COBL-BUKRS.
ENDFORM.
Tables and structures should not be declared in theFORM routines so that the contents can be used together with the callingtransaction.
SAPexits are FORM routines that have been programmed by SAP. The name of the formpool for SAP exits is SAPFGBEB.
If you still store your rules in table T890(interpreted rules), you cannot use user exits in your rule definition. It isrecommended that you use report program RGUGBR10 to convert interpreted rulesinto generated rules so that you can use the Customizing function for maintainingrules. For more information, see Using the Rule ManagerReports.
Thefollowing table shows the types of user exits that can be used in validations,substitutions, and rules.
User exit type
Description
Application
Example 1
Noparameters are defined for the user exit.
Rules,validations, and substitutions (prerequisite)
Seeform pool RGGBR000, parameter type C_EXIT_PARAM_NONE 2
Sameas user exit type 1, except one parameter (the field to be substituted) isdefined in the user exit. For example, you can create a substitution routinethat analyzes the cost center irrespective of the field used.
Substitution
Seeform pool RGGBS000, parameter type C_EXIT_PARAM_FIELD 3
Alldata is passed as one parameter; this exit type can only be used in matrixvalidations and substitutions.
Rules, validations, and substitutions(prerequisite)
Seeform pool RGGBR000, parameter type C_EXIT_PARAM_CLASS
Validations and rules use exit numbers 1 and 3 fromthe above table.
Substitutions use all of the exit numbers from theabove table.
Forsubstitutions, you can also create user exits that accept a field as oneparameter and then return the changed value in this parameter. This allows youto create a user exit that can be used independently of the field and tablename. This type of user exit cannot be used as an entry in the Exit only field in the list of values to be substituted; youcan only use this exit type in conjunction with a field name. An example ofthis user exit type is in form pool RGGBS000.
If you want to define a parameter for your user exitthat is different from the result of a validation (B_RESULT), you must make anentry for your user exit in the FORM routine GET_EXIT_TITLES in the form poolyou defined. It is recommended that you copy the SAP example form poolRGGBR000 for validation exits or RGGBS000 for substitution exits. Theseexample form pools already contain entries in the FORM routine GET_EXIT_TITLESfor the examples delivered by SAP.
===============STEPS===============
1) first I add new form in SE38 > ZGGBR000
form u904 using b_result. b_result = b_true. endform. "U904
2) then I addnew lines to form get_exit_titles
exits-name = 'U904'. exits-param = c_exit_param_class. exits-title = 'TEST'. append exits.
3) then I make active ZGGBR0000
4) then I use RGUGBR00 for rebuilding validation structures
5) and exam that ZGGBR000 exists in GCX2
----
REF: http://forums.sdn.sap.com/thread.jspa?threadID=1585474
when a user exit doesn´t appear in ob28 user exit list: change c_exit_param_class to c_exit_param_none and it appears