cancel
Showing results for 
Search instead for 
Did you mean: 

User Exits

Former Member
0 Kudos

Hi all

Can somebody tell me what are the user exits in Pricing Procedure and how do we find it. I tried in SMOD but could not get as I am making some mistakes either in package name or table entries. If somebody gives the correct steps it will be helpful.

Regards

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member227476
Active Contributor
0 Kudos

give me your id i will send the document on userexit

Former Member
0 Kudos

hr.sap@rediffmail.com

Regards

Former Member
0 Kudos

Hi .,

sent mail,Reward if helpfull

Thanks & Regards

Narayana

former_member227476
Active Contributor
0 Kudos

USER EXIT (SAP Enhancement)

User exit is a functionality provided by SAP to add custom validation or enhancements to existing SAP transaction. Every module pool has customer function FORM in PBO and PAI. This form is basically a function that has an INCLUDE object, for e.g. INCLUDE ZXPADU01. User can include enhancements or source code, which will be triggered during execution of this transaction.

For e.g. all HR info type program (module pool) starts with the name MPnnnnnn. So infotype 0001 module pool name will be MP000000. Search for string 'customer_function' and you will find two Forms’ under each module pool. PERFORM customer_function_pbo(sapfp50m) and PERFORM customer_function_pai(sapfp50m). Place your cursor on 'customer_function' and double click. It will take you to 'FORM customer_function_pbo'. In this form you should see a CALL CUSTOMER-FUNCTION '001' function module. Double click on '001' and you can see SAP has provided an INCLUDE object, for e.g. INCLUDE ZXPADU01. You can add your logic in this object ZXPADU01 and at runtime when you enter data in the respective infotype for e.g. 0000, the validation included in the object will be executed.

Execute transaction CMOD to define Project that contains User Exit.

Here is an example of HR Benefit USER EXIT:

Enter Project name, for e.g. ZBEN0003, select option 'Enhancement assignment' and enter for e.g. PBEN0003 (name of SAP enhancement object). Click on 'Components' button and the screen will display 'EXIT_SAPLHRBEN00FEATURE_003'. Double click on this object and it will take you to FUNCTION EXIT_SAPLHRBEN00FEATURE_003. There will be an INCLUDE object starting with name 'Z' in this function module that you can update with your custom logic.

<b>User exit

- In computer software, a user exit is a place in a software program where a customer can arrange for their own tailor-made program to be called. In the R/3 system from SAP, a user exit is contrasted with a customer exit and allows a customer's developer to access program components and data objects within the R/3 system. In R/3, some user exits use Include statements to include customer program enhancements that are called from the program. Other user exits use tables that are accessed through customization.</b>

A Short Tutorial on User Exits:

Content Author: Abhishek

<b>User exits:

1. Introduction

2. How to find user exits

3. Using Project management of SAP Enhancements

1. Introduction</b>:

User exits (Function module exits) are exits developed by SAP. The exit is implemented as a call to a functionmodule. The code for the function module is written by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.

The naming standard of function modules for functionmodule exits is:

EXIT_<program name><3 digit suffix>

The call to a functionmodule exit is implemented as:

CALL CUSTOMER.-FUNCTION ❤️ digit suffix>

Example:

The program for transaction VA01 Create sales order is SAPMV45A

If you search for CALL CUSTOMER-FUNCTION i program

SAPMV45A you will find (Among other user exits):

CALL CUSTOMER-FUNCTION '003'

exporting

XVBAK = VBAK

XVBUK = VBUK

XKOMK = TKOMK

importing

lvf_subrc = lvf_subrc

tables

XVBFA = XVBFA

XVBAP = XVBAP

XVBUP = XVBUP.

The exit calls function module EXIT_SAPMV45A_003

2. How to find user exits?

Display the program where you are searching for and exit and search for CALL CUSTOMER-EXIT

If you know the Exit name, go to transaction CMOD.

Choose menu Utilities->SAP Enhancements. Enter the exit name and press enter.

You will now come to a screen that shows the function module exits for the exit.

3. Using Project management of SAP Enhancements, we want to create a project to enhance transaction VA01

- Go to transaction CMOD

- Create a project called ZVA01

- Choose the Enhancement assign radio button and press the Change button

In the first column enter V45A0002 Predefine sold-to party in sales document.

Note that an enhancement can only be used in 1 project. If the enhancement is already in use, and error message will be displayed

Press Save

Press Components. You can now see that enhancement uses user exit EXIT_SAPMV45A_002. Double click on the exit.

Now the function module is displayed. Double click on include ZXVVAU04 in the function module

Insert the following code into the include: E_KUNNR = '2155'.

Activate the include program. Go back to CMOD and activate the project.

Goto transaction VA01 and create a sales order.

Note that Sold-to-party now automatically is "2155"

Field exits (SMOD/CMOD) Questions and Answers

1. Field exit was created with CMOD, but is not processed when calling the screen.

- Since the field exit is not processed until PAI, an action must be triggered on the screen (Return, Save,).

- Set profile parameter abap/fieldexit to YES and restart the system.

- After activating the function module FIELD_EXIT... and the field exit, leave the transaction on whose screen the field exit is to be executed. The screen is not generated until the transaction is started.

- Do not work on different application servers since there may be some delay before the field exit is activated.

- The profile parameter must be set on all or none of the application servers.

- If the field exit is to only be active on specific screens, check whether you chose the correct program and the correct screen

number (take care with sub screens).

- Using SE51 -> Field list, check that the screen field does have a reference to a data element. In the name of the field exit use the name of the data element and not the field name.

- After transport, field exits are marked as active but will not be processed.

Tip: First try deactivating the field exit once more and then afterwards, activate it again.

2. How is performance affected by setting abap/fieldexit?

- If a screen is generated and the profile parameter is set, a check is run on 2 tables (TDDIR, TDDIRS) to see whether a field exit must be generated for the respective field. In practice, the screen load is not generated until the screen is selected after an

update. The user should not notice any difference because screen generation is very fast.

3. Can you read the contents of other screen fields in the field exit?

- In principle, every field exit can store its value in the global variables of the function group (TOP) and hence make them

available to other field exits. Note here that field exits are always called and not only if an entry is made in the field or if the field is empty. In addition, it is not possible to make any assumptions about the order in which the field exits will be called in the future.

4. How does the field exit behave on step loop fields?

- After the user has entered data, the field exit is called in PAI as often as there are visible fields in the step loop. The system

variable SY-STEPL is incremented each time. If a new value is assigned to the field, it is displayed in the module between LOOP and ENDLOOP. This module is also called once for each visible step loop line.

5. Can field exits be debugged?

- No. Field exits must be tested separately in the ABAP/4 Development Workbench. For errors which only occur in the screen environment, it is helpful to write interesting variable to the file system using TRANSFER... . These can then be analyzed there.

6. What can you do if the field contents are no longer transported to ABAP/4.

- Check whether a value is assigned to the field OUTPUT.

7. When is the field exit called if a conversion exit is attached to the

data element ?

- The field exit is called after the conversion exit. This means that the INPUT field receives the data in the same format as the

ABAP/4 program also receives it.

8. Although a global field exit is inactive, a function module is called which does not exist (for example FIELD_EXIT_PROGRAMM_@)

- This is an error in the kernel which no longer occurs as of 3.0C. As a temporary measure, it is useful to assign a program and a screen which do not exist to the field exit and then activate the field exit.

9. Field exit is not visible in CMOD, although created.

- If you want to create a field exit for a data element, a function module is proposed with the name FIELD_EXIT_. This

function module must exist for the field exit to work. If you do not create this function module, but do create one with a suffix,

the data element is not displayed in CMOD.

10. Field exit is not executed although it is active.

- Fields which do not have the 'Input field' attribute usually do not trigger a field exit. The field exit is designed to allow an

extended input check. It is therefore only called for input fields - even if they are not ready for input at runtime of the application by LOOP AT SCREEN.

This rule does not apply, however, if the field is located within a step loop. Here the field will be always activated, even if it is

invisible.

- Field exits can only be executed for fields that are directly related to the dictionary. If the relation is indirect, i.e. via an ABAP declaration (LIKE), no field exit can be executed.

11. Field exits on check buttons do not work

- Field exits are only intended for input fields. As check buttons count as graphical elements, you cannot install field exits on

them.

12. Field exits do not work on selection screens

Finding the user-exits of a SAP transaction code

*

  • Finding the user-exits of a SAP transaction code

*

  • Enter the transaction code in which you are looking for the user-exit

  • and it will list you the list of user-exits in the transaction code.

  • Also a drill down is possible which will help you to branch to SMOD.

*

*

report zuserexit no standard page heading.

Tables: TSTC, TADIR, MODSAPT, MODACT, TRDIR, TFDIR, enlfdir.

TSTCT.

Data: jtab like TADIR occurs 0 with header line.

Data: field1 (30).

Data: v_devclass like TADIR-DEVCLASS.

parameters: p_tcode like TSTC-TCODE obligatory.

select single * from TSTC where tcode eq p_tcode.

if sy-subrc eq 0.

select single * from TADIR where pgmid = 'R3TR'

and object = 'PROG'

and obj_name = TSTC-PGMNA.

Move: TADIR-DEVCLASS to v_devclass.

if sy-subrc ne 0.

select single * from TRDIR where name = TSTC-PGMNA.

if TRDIR-SUBC eq 'F'.

select single * from TFDIR where pname = TSTC-PGMNA.

select single * from enlfdir where funcname =

TFDIR-FUNCNAME.

select single * from TADIR where pgmid = 'R3TR'

and object = 'FUGR'

and obj_name eq enlfdir-area.

move: TADIR-DEVCLASS to v_devclass.

endif.

endif.

select * from tadir into table jtab

where pgmid = 'R3TR'

and object = 'SMOD'

and devclass = v_devclass.

select single * from TSTCT where SPRSL eq sy-langu and

tcode eq p_tcode.

format color col_positive intensified off.

write :/(19) 'Transaction Code - ',

20(20) p_tcode,

45(50) TSTCT-TTEXT.

skip.

if not jtab [] is initial.

write :/( 95) sy-uline.

format color col_heading intensified on.

write:/1 sy-vline,

2 'Exit Name',

21 sy-vline ,

22 'Description',

95 sy-vline.

write :/( 95) sy-uline.

loop at jtab.

select single * from modsapt

where SPRSL = sy-langu and

name = jtab-obj_name.

format color col_normal intensified off.

write:/1 sy-vline,

2 jtab-obj_name hotspot on,

21 sy-vline ,

22 modsapt-modtext,

95 sy-vline.

endloop.

write:/(95) sy-uline.

describe table jtab.

skip.

format color col_total intensified on.

write:/ 'No of Exits:' , sy-tfill.

else.

format color col_negative intensified on.

write:/(95) 'No User Exit exists'.

endif.

else.

format color col_negative intensified on.

write :/( 95) 'Transaction Code Does Not Exist'.

endif.

at line-selection.

get cursor field field1.

check field1(4) eq 'JTAB'.

set parameter id 'MON' field sy-lisel+1(10).

call transaction 'SMOD' and skip first screen.

*---End of Program

SAP User Exits Routine

User exits are routine which SAP allows you to add in additional customized programs process without affecting the standard SAP programs.

SAP userexits are usually declared as form routines:-

Form userexit_xxxxx

........................

end form

In VL01 - Create Delivery Order, standard program SAPMV50A, the standard program did not check for storage location equal to space, and delivery quantity less than one when the user click the save button. Therefore I have to insert the additional checking into the user exit routine.

Steps:-

• Goto transaction VL01 to pick a Sales Order for delivery (you don't have to save the data)

• In the initial screen, click System -> Status -> Double click on Program (Screen)

• In the dialog program SAPMV50A, click Edit -> Search/replace

• Type userexit in the Find field, then click the In program radio button and hit Enter

• A number of userexit routine will be display. You have to roughly decide which the correct userexit routine to be use is.

Form userexit_save_document_prepare.

case xlips-pstyv.

When 'TAX' or 'REX'.

  • Accept this two Delivery item category

When 'REN'.

if xlips-lgort = space.

  • Reject this Delivery item category

message e001.

endif.

when others.

if xlips-matnr <> space.

  • Check storage location not space

if xlips-lgort = space.

Message e002.

endif.

  • Check delivery quantity not zero

if xlips-pikmg < 1.

message e003.

endif.

endif.

endcase.

endform.

What is the use of user-exit and all?

Is it about modifying SAP program?

Suppose that you need some functionality which is not provided in sap what do you do. Sap has provided you with three options.

1) Customizing.

2) Modifications.

3) User Exits.

So what are these three:-

The first case when you take Customization is nothing but you are customizing SAP according to your need and requirement for example you want the Purchase Order Numbers to start with <Co_Name><seq_no>(sequential no) this kind of stuff is done in customization.

Modification is nothing but you are modifying SAP standard code which is written during developing your SAP standard programs or screens.

Thirdly to avoid modifications SAP has provided you with some exit points like for example after the PBO event in module pool programming comes the PAI, so in between these two events you wanted the change something so SAP has provided with an exit point. That exit point is called user exits. For example user exits for me21 PO Create is MM06005 if I am not wrong, they are nothing but simple function module within which you write your code which functions just like normal program and executes between the PAI and PBO events.

Former Member
0 Kudos

Hi,

Go to SMOD,In the field Enhancement,press F4.

Here in the Packge give the packge as VA and enter.

You will get the list of exits.

Reward points if useful

Regards,

Amrish Purohit

Former Member
0 Kudos

Hi MBM,

Goto the following path to get the list of user exits for pricing.

SPRO>Sales & Distribution>System Modifications>User Exits>Click on Help next to the user exits for price determination.

Here is the list for u r reference.

USEREXIT_PRICING_PREPARE_TKOMK (module pool SAPLV60A, program RV60AFZZ)

This user exit allows you to copy additional fields for pricing in the TKOMK communication structure (header fields), which have not been provided in the standard SAP system. These fields can also be used for pricing in the billing document.

This user exit is described in detail in the "New fields in pricing" section.

USEREXIT_PRICING_PREPARE_TKOMP (module pool SAPLV60A, program RV60AFZZ)

This user exit allows you to copy additional fields for pricing in the TKOMP communication structure (item fields), which have not been provided in the standard SAP system. These fields can also be used for pricing.

This user exit is described in detail in the "New fields in pricing" section.

USEREXIT_FIELD_MODIFICATION (module pool SAPMV61A, program MV61AFZA)

You can use this user exit to adjust the display of individual lines in the condition screen by changing the display attributes of the screen fields. This does not include the display of subtotals.

This user exit is also used in order processing.

USEREXIT_FIELD_MODIFIC_KZWI (module pool SAPMV61A, program MV61AFZB)

You can change the display of subtotals in the condition screen by changing the display attributes of the screen fields.

This user exit is also used in order processing.

USEREXIT_FIELD_MODIFIC_KOPF (module pool SAPMV61A, program MV61AFZB)

You can adjust the display of subtotals in the condition screen to your requirements by changing the display attributes of the screen fields.

This user exit is also used in order processing.

USEREXIT_FIELD_MODIFIC_LEER (module pool SAPMV61A, program MV61AFZB)

You can adjust the display of blank lines in the condition screen to your requirements by changing the display attributes of the screen fields.

This user exit is also used in order processing.

USEREXIT_PRICING_CHECK (module pool SAPMV61, program MV61AFZA)

You can install additional checks to the standard checks of condition lines (e.g. maximum/minimum value).

USEREXIT_PRICING_RULE (module pool SAPLV61A, program RV61AFZA)

In the standard SAP system, it is predefined which condition categories and classes can be copied or recalculated per pricing type. You can change the predefined standard procedure for each pricing type.

USEREXIT_CHANGE_PRICING_RULE (module pool SAPMV61A, program MV61AFZA)

You can use this user exit to change the pricing type that has been predefined in the copying control table in billing.

USEREXIT_XKOMV_BEWERTEN_INIT (module pool SAPLV61A, program RV61AFZB)

This field is used in the formulas and therefore initialized before the loop for the pricing procedure starts.

USEREXIT_XKOMV_BEWERTEN_END (module pool SAPLV61A, program RV61AFZB)

Within a loop for the price components during pricing, specific values can be transferred into the communication structures in pricing to be further processed.

USEREXIT_XKOMV_ERGAENZEN (module pool SAPLV61A, program RV61AFZB)

In change mode, you can change the dynamic part of the condition record (KONVD) that is always redetermined (i.e. it is not stored in database table KONV).

USEREXIT_XKOMV_ERGAENZEN_MANU (module pool SAPLV61A, program RV61AFZB)

You can use this user exit to change the ready-for-input fields of the manually entered condition record in add mode in the condition screen.

USEREXIT_XKOMV_FUELLEN (module pool SAPLV61A, program RV61AFZB)

This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record.

USEREXIT_XKOMV_FUELLEN_O_KONP (module pool SAPLV61A, program RV61AFZB)

This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record. This may include subtotals, manually entered conditions or conditions that have been calculated with a formula.

USEREXIT_PRICING_COPY (module pool SAPLV61A, program RV61AFZA)

You can change the KONV fields for copied price components.

Regards,

Sreekanth

Former Member
0 Kudos

Hi,

User Exits For Price Determination

USEREXIT_PRICING_PREPARE_TKOMK (module pool SAPLV60A, program RV60AFZZ)

This user exit allows you to copy additional fields for pricing in the TKOMK communication structure (header fields), which have not been provided in the standard SAP system. These fields can also be used for pricing in the billing document.

This user exit is described in detail in the "New fields in pricing" section.

USEREXIT_PRICING_PREPARE_TKOMP (module pool SAPLV60A, program RV60AFZZ)

This user exit allows you to copy additional fields for pricing in the TKOMP communication structure (item fields), which have not been provided in the standard SAP system. These fields can also be used for pricing.

This user exit is described in detail in the "New fields in pricing" section.

USEREXIT_FIELD_MODIFICATION (module pool SAPMV61A, program MV61AFZA)

You can use this user exit to adjust the display of individual lines in the condition screen by changing the display attributes of the screen fields. This does not include the display of subtotals.

This user exit is also used in order processing.

USEREXIT_FIELD_MODIFIC_KZWI (module pool SAPMV61A, program MV61AFZB)

You can change the display of subtotals in the condition screen by changing the display attributes of the screen fields.

This user exit is also used in order processing.

USEREXIT_FIELD_MODIFIC_KOPF (module pool SAPMV61A, program MV61AFZB)

You can adjust the display of subtotals in the condition screen to your requirements by changing the display attributes of the screen fields.

This user exit is also used in order processing.

USEREXIT_FIELD_MODIFIC_LEER (module pool SAPMV61A, program MV61AFZB)

You can adjust the display of blank lines in the condition screen to your requirements by changing the display attributes of the screen fields.

This user exit is also used in order processing.

USEREXIT_PRICING_CHECK (module pool SAPMV61, program MV61AFZA)

You can install additional checks to the standard checks of condition lines (e.g. maximum/minimum value).

USEREXIT_PRICING_RULE (module pool SAPLV61A, program RV61AFZA)

In the standard SAP system, it is predefined which condition categories and classes can be copied or recalculated per pricing type. You can change the predefined standard procedure for each pricing type.

USEREXIT_CHANGE_PRICING_RULE (module pool SAPMV61A, program MV61AFZA)

You can use this user exit to change the pricing type that has been predefined in the copying control table in billing.

USEREXIT_XKOMV_BEWERTEN_INIT (module pool SAPLV61A, program RV61AFZB)

This field is used in the formulas and therefore initialized before the loop for the pricing procedure starts.

USEREXIT_XKOMV_BEWERTEN_END (module pool SAPLV61A, program RV61AFZB)

Within a loop for the price components during pricing, specific values can be transferred into the communication structures in pricing to be further processed.

USEREXIT_XKOMV_ERGAENZEN (module pool SAPLV61A, program RV61AFZB)

In change mode, you can change the dynamic part of the condition record (KONVD) that is always redetermined (i.e. it is not stored in database table KONV).

USEREXIT_XKOMV_ERGAENZEN_MANU (module pool SAPLV61A, program RV61AFZB)

You can use this user exit to change the ready-for-input fields of the manually entered condition record in add mode in the condition screen.

USEREXIT_XKOMV_FUELLEN (module pool SAPLV61A, program RV61AFZB)

This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record.

USEREXIT_XKOMV_FUELLEN_O_KONP (module pool SAPLV61A, program RV61AFZB)

This user exit is always called up during a redetermination of all or individual price components. You can change the work fields of the condition line. However, this only applies to conditions that have been determined via a condition record. This may include subtotals, manually entered conditions or conditions that have been calculated with a formula.

USEREXIT_PRICING_COPY (module pool SAPLV61A, program RV61AFZA)

You can change the KONV fields for copied price components.

Return ->

Application

Reward points if useful

Regarsd,

Amrish Purohit