| Home • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us | ||||||||||||||||||||||||||
Document Categories:
What's New?
Contribute?Sample SpecsWhat's Hot? |
User exit to display Vendor name in Payment run in FIBy Shashikant Chandratre
1.
Document Objective
Business Requirement: When Automatic Payment Program is run (T.Code F110),
the Text fields in both the Line Items of the Clearing Document Generated should
display the Vendor Name. We need to create a new Substitution Rule to populate
the field BSEG-SGTXT automatically with the vendor name (LFA1-NAME1) for journal
entries created during the execution of transaction F110.
·
Transaction code F110 (BKPF-TCODE = F110) and ·
Document Type equal to ‘KZ’ (BKPF-BLART=’KZ’) Create
a user exit to move the vendor name (LFA1-NAME1) to both line items. Substitutions can be used for validating data
at the time of entry in SAP system. This document 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 ( F110-Payment run ) but
same steps with some minor modifications can be used for other areas too. Here
our requirement is when the Automatic Payment Program is run (T.Code F110), the
Text fields in both the Line Items of the Clearing Document Generated should
display the Vendor Name. The
field name is BSEG-SGTXT where the Vendor Name is to be displayed. 2.
Document Details
This Document contains two parts:
1.
Creation user exist and Coding: 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 ZRGGBS000.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 =
'U903'. 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 Here we are using
C_EXIT_PARAM_FIELD Step3:
Create a FORM for your exit which will define its functionality. In form
GET_EXIT_TITLES we have define our EXIT-NAME as 'U903'. So we need to
create a FORM with name U903 which will define the functionality of our user
exit. Here In our example we are
populating the Item Text (BSEG-SGTXT). *---------------------------------------------------* * FORM U903 * *---------------------------------------------------* * Populate Item Text (BSEG-SGTXT) *---------------------------------------------------* FORM U903 changing p_sgtxt type bseg-sgtxt. data: l_name type lfa1-name1. select single name1 into l_name from lfa1 where lifnr = bseg-lifnr. if sy-subrc = 0. move l_name to p_sgtxt. EXPORT p_sgtxt to MEMORY id 'Z00_FI_TXT'. clear: l_name. else. import p_sgtxt from MEMORY id 'Z00_FI_TXT'. endif. endform. "U903
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. Step
4: Run transaction GCX2 to update IMG to use your new program instead of
Standard SAP program for substitution exits. Update the program
name RGGBR000 with your new program ZRGGBS000 for application area GBLS. Now you
can use this user exit for substitutions. Save it will ask for
customization request. 2.
Customization Substitution settings: Here we are creating user exit using substitution
method. Step I. Go to transaction OBBH
Enter the company code for which substitution rules is applied e.g. here
we have entered the Company code as SV10. Select call up point 2 as this requirement is for line item. Below is the Details to select callup point.
|
|||||||||||||||||||||||||
|
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM Home • Contribute • About Us • Privacy • Terms Of Use • Disclaimer • Safe • Companies: Advertise on SAPTechnical.COM | Post Job • Contact Us ©2006-2007 SAPTechnical.COM. All rights reserved. All
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG. Graphic Design by Round the Bend Wizards |
||||||||||||||||||||||||||