Вы находитесь на странице: 1из 5

SAP : Using USER EXIT For FI

SUBSTITUTION
Substitutions can be used for validating data at the time of entry in SAP system. This wiki can
be used for creating custom user exits so that one can set his validations & conditions. User
exits are user defined FORM routines that are used to calculate/replace values with in a
substitution .I have shown demo for FI but same steps with some minor modifications can be
used for other areas too.
What are substitutions?
Whenever a data is entered in a system, validations are invoked to check its integrity .Once
validations are done, one can substitute the entered value with some other value. This gives
you the opportunity of having the system validate values that are to be substituted. A
substitution value can be numeric or a string. The system first performs some validations and
then substitutions.
Transactions used for substitutions are :
GGB1
: Substitutions maintenance.

OBBH : Activation of FI substitutions.
Substitutions can be performed using three ways:
1.Constant values.
2.Field -Field assignment.
3.User exits.

Creating user exits for substitutions
Link to this Page Link Tiny Link Wiki Markup Close Move Page Cre
Set Page Location Move OK Cancel Click to select the Search
Recently Viewed There were no re Known Location The specified pag Browse Error reading the
You could try relo HTTP Status You must make a Failed to retrieve There were no pa Showing <b>{0}<
Move failed. Ther You cannot move Creating user exi Validations and S ERPFI
ERP Financials You cannot move Page Ordering Back Reorder Move
Unknown user or Page Restrictions Editing restricted Cancel Close Save
51687

Page restrictions apply
Attachments:3
Added by Rajneesh, last edited by Rajneesh on Mar 09, 2009 (view change)
view

Substitutions can be used for validating data at the time of entry in SAP system. This wiki can be used for creating custom
user exits so that one can set his validations & conditions. User exits are user defined FORM routines that are used to
calculate/replace values with in a substitution .I have shown demo for FI but same steps with some minor modifications can
be used for other areas too.
What are substitutions?
Whenever a data is entered in a system, validations are invoked to check its integrity .Once validations are done, one can
substitute the entered value with some other value. This gives you the opportunity of having the system validate values that
are to be substituted. A substitution value can be numeric or a string. The system first performs some validations and then
substitutions.
Transactions used for substitutions are :
GGB1
: Substitutions maintenance.

OBBH : Activation of FI substitutions.
Substitutions can be performed using three ways:
1.Constant values.
2.Field -Field assignment.
3.User exits.
In this wiki I have shown substitutions implemented using custom user exits.
Steps for creating user exits for substitutions.
The exits used for substitutions are stored in a Include program.RGGBS000 is a standard include given by SAP for user
exits for substitutions. So for creating custom user exits, one has to copy this include to a 'Z' (Custom namespace) program.
Step1 : Create a copy of include RGGBS000 ,let say ZTEST000.The length of the name you choose should not exceed 8
characters.
Step2 : Define your user exit in the FORM routine GET_EXIT_TITLES with the correct exit type (EXITS-PARAM).
exits-name = 'U111'.
exits-param = c_exit_param_none.
exits-title = text-100. "Give any suitable text for your exit
APPEND exits.
Include the EXIT NAME , PARAM and TITLE in the form GET_EXIT_TITLES .This form GET_EXIT_TITLES contains name
and titles of all available standard exits. Every new exit need to be added to this from. One has to specify a parameter type
to enable the code generation program to determine correctly how to generate the user exit call ,i.e. How many and what
kind of paramter(s) are used in the user exit. The following parameter types exist:
TYPE Description
-------------------------------------------------------------------------------------------------------
C_EXIT_PARAM_NONE Use no parameter except B_RESULT . If you do not want to substitute a field, use
this parameter in the substitution .
C_EXIT_PARAM_FIELD Use one field as param. Exactly one field is substituted.
C_EXIT_PARAM_CLASS Use a type as parameter.
Step3: Create a FORM for your exit which will define its functionality.
In form GET_EXIT_TITLES we have define our EXIT-NAME as 'U111'. So wee need to create a FORM with name U111
which will define the functionalityof our user exit. Here I am taking a simple example of populating the Item Text (BSEG-
SGTXT).
*---------------------------------------------------------------------*
* FORM U111 *
*---------------------------------------------------------------------*
* Populate Item Text (BSEG-SGTXT)
*---------------------------------------------------------------------*
FORM U111.
DATA: wl_awkey TYPE bkpf-awkey.
CONSTANTS: c_asterisk TYPE c VALUE '*',
c_hypen TYPE c VALUE '-'.
CLEAR wl_awkey.
*-- Removing leading zeros
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = bkpf-awkey
IMPORTING
output = wl_awkey.
*-- Set the item text
CONCATENATE c_asterisk bseg-zuonr c_hypen wl_awkey INTO bseg-sgtxt.
ENDFORM. "U111
You need to be cautious when writing code for your user exit. No dialog boxes, warning messages, information or error
messages must be issued in an exit. Do not use any ABAP commands that cause you to leave the exit directly, for example
LEAVE TO SCREEN. In the includes of the substitution exits, you must not use the commands MODIFY, INSERT or
DELETE in the internally used structures such as BSEG or BKPF. These structures are interpreted internally as database
tables because they are defined by a TABLES statement. As a result, the system writes, deletes or changes database
records if you use the commands mentioned above. This can cause serious inconsistencies and problems in the document
processing. If you want to change field contents in the exit type C_EXIT_PARAM_CLASS, you should make the changes in
the internal table BOOL_DATA (for example BOLL_DATA-BSEG).
Step 4:Run transaction GCX2 to update IMG to use your new program instead of Standard SAP program for
substitution exits.
Alternatively you can use SPRO for updating IMG. Run SPRO- Financial Accounting (New) - Special Purpose Ledger -
Basic Settings - User Exits - Maintain Client Specific User Exits.
Update the program name RGGBR000 with your new program ZTEST000 for application area GBLS. Now you can use this
user exit for substitutions.








How to use custom user exit for a substitution?
Go to transaction GGB1.Here you can create\change a substitution . I am not going in detail for creating a
substitution .Specify the user exit(Highlighted area in red) for a field that is to be substituted buy your exit .


Also you can see the list of all the user exit on pressing F4 on the highlighted area in red. If your user exit is in active state,
then it will be visible there. Once you have done the changes ,Save it. Now your user exit will be invoked automatically for
that field.
Useful SAP FI Related Transaction Codes

Organizational Structure
1. Define Company code OX02 / Copy Company Code EC012. Define / Edit Chart of Accounts OB13 / Copy
Chart of Accounts OBY73. Assign Company Code to Chart Of Accounts OB624. Maintain Fiscal Year Variant
OB295. Assign Company Code to Fiscal Year Variant OB376. Define Posting Period Variant - OBBO7. Open
and Close Posting Period OB528. Assign Posting Period Variant to Company Code - OBBP9. Define Document
Number Ranges FBN110. Define Document Types OBA711. Define Posting Keys OB4112. Define Field
Status Variant OBC413. Assign Company Code to Field Status Variant OBC514. Screen Variants for document
Entry OB7115. Define Tolerance group for Employees OBA416. Assign User Tolerance Group OB5717.
Define Business Area OX0318. Company Code Global Parameters OBY619. Define Countries OY0120.
Define Parallel currencies OB22
Customer Creation and Payments
1. Define Vendor Account Groups OBD32. Define Number Ranges for Vendor Accounts XKN13. Assign
Number Ranges to Vendor Account Groups OBAS4. Create Recon Account FS005. Define Customer/Vendor
Tolerance Group OBA36. Define Payment Terms OBB87. Create Vendor FK018. Post Invoice FB60, Doc
KR, number range 199. Make incoming payments (full, partial or residual payments) F- 53, Doc KZ, number
range15
Automatic Payment
10. House Bank Configuration FI12.Enter Company code and select House Bank tab. Click on the Create bank to
create a new house bank Enter Bank Country and bank key details and click Bank Accounts.Enter the Bank Account
num and the Bank GL account.11. Payment Program Configuration FBZPAll Company Codes Enter Sending
and Paying Company Code, outgoing payment with cashdiscount from.Paying Company Code Enter Minimum
amount of Incoming and outgoing payment and Formfor the Payment advice.Payment methods by country Select
Check will be created, Allowed for personal payments,Street P.O. box or P.O. box pst code (bank details for Wire
transfer) and RFFOUS_C

Вам также может понравиться