Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

user_exit

Former Member
0 Likes
852

i don't know about user_exit , so please tell me something about user_exit . A simple program also send me . <b><u>Write the process to do it</u></b> .

E-mail - kknewdelhi@gmail.com

7 REPLIES 7
Read only

Former Member
0 Likes
762

You should probably search the forums / SDN before posting these questions. You will find answers to them yourself.

Also, there are quite a few sites which will give you lot of information, so try using GOOGLE.

Regards,

Ravi

Read only

Former Member
0 Likes
762

Hi Krishna,

There are lots of sample codes with step by step procedures and website for learning userexits, within this ABAP FORUM, give a search with the key word "user- exit".

Check out one of thos links here,

http://www.sap-img.com/abap.htm, and search for user exit.

Good luck.

Regards,

Anjali

Read only

Former Member
0 Likes
762

Hi,

User Exits are a method whereby the end user can add extra functionality or

change to a certain degree the way that SAP performs certain functions.

<b>How are they implemented ?</b>

User Exits are implemented in such a way that unlike changes to SAP

standard code, they will survive across upgrades and hot pack applications.

They are also User Objects and can therefore be implemented without the

need of requesting an SSCR from SAP.

Within the standard SAP programs at key points are calls to function

modules starting with 'EXIT_'. These function modules generally accept as

input parameters structures containing for example the entire Order Header

(VBAK) of the sales order just entered, or perhaps a table of the Order

Items. These function calls are placed at points such as just before the

Order is saved or just before it is printed and so on.

These function modules contain a single include statement. The name of this

include is in the User domain and starts with Z. This enables it to be

edited without the need for an SSCR and also prevents it being overwritten

during upgrades.

Once this include has been created and activated, and the user exit is

activated the User exit becomes functional.

<b>Implementing a User Exit.</b>

User Exits are implemented using the transaction code 'SMOD'. Enter this in

the command line and press the Enter key. This will then show the SMOD

parameter screen

User Exits are assigned a project name which begins with Z. Having entered

the relevant name in the 'Project' field, click the Create (or Change)

button as applicable.

When you are creating a new project, the projects attribute screen will be

displayed. This allows you to enter a title for the project and allows

access to the Enhancements (User Exits) that you want to assign to the

project and the components that you wish to use within those enhancements.

This screen allows you to enter a description of the project. Once you have

done this, click the save button. You will be asked as usual to assign a

development class and create a transport.

Once the transport has been created you can then go on to assign the

enhancements that you wish to use to the project.

Locating The Enhancements For A Project.

Unfortunately I have access to a 4.6C system only so therefore this

description is based around that.

To find enhancements for a particular program locate the Development Class

for the relevant program. Run the transaction and on the first input screen

click on the Status button. This provides the program name. Another method

of finding the program name is to use transaction SE93 which is the

Create/Modify Transaction transaction. Enter the transaction code and click

display.

In either case, cut the program name and then enter it into transaction

SE38 ? the ABAP program editor. Select the 'Attributes' radio button and

click display. Note the Development Class.

In 46C, go back to the SMOD main screen, enter the project name and select

the 'Enhancement Assignment' radio button.

Click the change button. This will display the enhancement assignment

screen. Position the cursor in the first field and press the <F4> key. This

will display the Input Help personal list window, a standard window that

you should be familiar with. Click the 'Information System' button and

enter the development class located above into the development class field.

Click the green tick.

This will display a list of enhancements for that particular development

category with a short description of what they do.

Select relevant description which will be transferred back to the

Enhancement Assignment screen.

For versions other than 46C, use transaction SE37 which is the Function

Module editor, in the function module name field press the <F4> key and

select further options. One of these will be the development class.

Clicking the enhancement button provides information on the enhancement.

The information displayed in this report includes whether the enhancement

has been implemented, and is active. (Green things scattered throughout the

report). Clicking the Exit name (In this case 'EXIT_SAPLV60A_002' will

display the relevant function module:

To create the enhancement, double click the Include name. This then takes

you into SE38 where you can edit the include to your hearts content.

<b>Step by step procedure for creating Field Exits</b>

There are eight steps to creating a field exit:

Step 1: Determine Data Element

Step 2: Go To Field Exit Transaction

Step 3: Create Field Exit

Step 4: Create Function Module

Step 5: Code Function Module

Step 6: Activate Function Module

Step 7: Assign Program/Screen

Step 8: Activate Field Exit

Step 1: Determine Data Element

- Before you can begin adding the functionality for a field exit, you must know the corresponding data element.

- An easy way to determine the data element associated to a particular screen field is to:

Go the appropriate screen.

Position the cursor in the appropriate field.

Press ‘F1’ for field-level help.

Click on the ‘Technical info’ pushbutton (or press ‘F9’) on the help dialog box.

On this Technical Information dialog box, the data element will be specified if the field is 'painted' from the ABAP/4 Dictionary.

Step 2: Go To Field Exit Transaction

- The transaction to create field exits is CMOD.

- You can use the menu path Tools -> ABAP/4 Workbench -> Utilities -> Enhancements -> Project management.

- From the initial screen of transaction CMOD, choose the Text enhancements -> Field exits menu path.

- After choosing this menu path, you will be taken to the field exits screen. From here, you can create a field exit.

NOTE : Even though you use transaction CMOD to maintain field exits, you do not need to create a project to activate field exits.

Step 3: Create Field Exit

- From the field exit screen of transaction CMOD, choose the Field exit -> Create menu path.

- After choosing this menu path, a dialog box will prompt you for the appropriate data element .

- Enter the data element name and click the ‘Continue’ pushbutton.

- Now, you will be able to create the function module associated to the data element’s field exit.

Step 4: Create Function Module

- You will automatically be taken to the Function Library (SE37) after entering a data element name and clicking the ‘Continue’ pushbutton.

- In the ‘Function module’ field, a function module name will be defaulted by the system based on the data element specified. This name will have the following convention:

FIELD_EXIT_<data element>

- You can add an identifier (an underscore followed by a single character ).

- The first function module for a data element’s field exit must be created without an identifier.

- To create the function module, click on the ‘Create’ pushbutton, choose menu path Function module -> Create, or press ‘F5’.

- After choosing to create the function module, you will get the warning: "Function module name is reserved for SAP". This message is just a warning so a developer does not accidentally create a function module in the field exit name range. By pressing ‘Enter’, you will be able to go ahead and create the function module.

- Before coding the function module, you will have to specify the function modules attributes -- function group, application, and short text.

Step 5: Code Function Module

- From the function module’s attributes screen, click on the ‘Source code’ pushbutton or choose the Goto -> Function module menu path to the code of the function module.

- Here you will add your desired functionality for the field exit.

- Remember that field exit’s function module will have two parameters -- one importing parameter called "INPUT" and one exporting parameter called "OUTPUT". These parameters will be set up automatically by the system.

- You must remember to assign a value to the OUTPUT field. Even if the value does not change, it must be moved from the INPUT field to the OUTPUT field.

Step 6: Activate Function Module

- After coding the function module, you must remember to activate it.

- Use the Function module -> Activate menu path to activate the function module.

- At this point, you can return to the field exit transaction.

- You should be able to 'green arrow' back to this transaction.

- When you return to the field exit transaction, you will see an entry for the newly created field exit.

- At this point, the field exit is global. That is, it applies to all screens that use a particular data element. On any screen that uses the data element, the corresponding field exit function module will be triggered, once it is active.

- Also, the field exit will not be triggered yet because it is inactive.

Step 7: Assign Program/Screen

- This step is only needed if you want to make a field exit local.

- To make a field exit local, select the field exit and click on the ‘Assign prog./screen’ pushbutton.

- In the dialog box , indicate the appropriate program name and screen number.

This information indicates that the field exit is local to the specified screen in the specified program.

- In the dialog box, you determine which function module gets executed for the field exit by specifying the identifier in the ‘Fld. Exit’ field.

- If this field is left blank, the function module triggered will be 'FIELD_EXIT_<data element>'.

- If a single-character identifier is entered into the field, the function module triggered will be 'FIELD_EXIT_<data element>_<identifier>'.

Step 8: Activate Field Exit

- The field exit must be active for it to be triggered by the system.

- Activate the field exit by choosing the Field exit -> Activate menu path.

- After assigning the field exit to a change request, its status will change to ‘Active’ and it will be triggered automatically on the appropriate screen(s).

NOTE : In order to activate the field exit the profile parameter abap/fieldexit = YES must be set on all application servers

rgds,

latheesh

Message was edited by: Latheesh Kaduthara

Read only

Former Member
0 Likes
762

HI

GOOD

GO THROUGH THIS

The following document is about exits in SAP :-

The R/3 enhancement concept allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications.

SAP creates user exits for specific programs, screens, and menus within standard R/3 applications. These exits do not contain any functionality. Instead, the customer exits act as hooks. You can hang your own add-on functionality onto these hooks.

Types of Exits

There are several different types of user exits. Each of these exits acts as hooks where you can attach or "hang" your own add-ons.

Menu Exits

Menu exits add items to the pulldown menus in standard SAP applications. You can use these menu items to call up your own screens or to trigger entire add-on applications.

SAP creates menu exits by defining special menu items in the Menu Painter. These special entries have function codes that begin with "+" (a plus sign). You specify the menu item’s text when activating the item in an add-on project.

Screen Exits

Screen exits add fields to screens in R/3 applications. SAP creates screen exits by placing special subscreen areas on a standard R/3 screen and calling a customer subscreen from the standard screen’s flow logic.

Function Module Exits

Function module exits add functions to R/3 applications. Function module exits play a role in both menu and screen exits.

When you add a new menu item to a standard pull down menu, you use a function module exit to define the actions that should take place once your menu is activated.

Function module exits also control the data flow between standard programs and screen exit fields. SAP application developers create function module exits by writing calls to customer functions into the source code of standard R/3 programs.

These calls have the following syntax:

CALL CUSTOMER-FUNCTION ‘001’.

Field Exits

Field exits allow you to create your own programming logic for any data element in the Dictionary. You can use this logic to carry out checks, conversions, or business-related processing for any screen field. Example: The data element BBBNR identifies a company’s international location number. You might want to set up your R/3 System so that all international location numbers are larger than 100.

The field exit concept lets you create a special function module that contains this logic.

You assign the special function module to the data element BBBNR. You then assign the module to any programs and screens in which users can add new international location numbers. When you activate your field exit, the system automatically triggers your special routine whenever a user enters a company location number.

In 4.6c, you can use "RSMODPRF" program to create field exits.

An example of a user exits :-

MODULE user_exit_0001 INPUT

CASE okcode.

WHEN 'BACK OR EXIT'.

CASE sy-dynnr.

WHEN '100'.

SET SCREEN 0.

LEAVE SCREEN.

WHEN '200'.

        • Note that you can write any code that satisfy your needs. ****

        • But in this case, this was wrote as a sample code for reference sake. ****

        • And you can test it. ****

SET SCREEN 100.

LEAVE SCREEN.

ENDCASE.

ENDCASE.

THANKS

MRUTYUN

Read only

Former Member
0 Likes
762

How to find user Exits for a screen.

Step-by-step process of creating Exits

1.Evoke the Transaction code CMOD or alternatively you can use the path tools --> ABAP workbench --> utilities --> Enhancements --> Project Management.

2.Specify a Project name in the Enhancement Text box.

Click on the create icon on the screen. For example let us create an enhancement project say z user.

3.In the next screen enter the description of the project.

4.Save and Select Enhancement components.

5.Provide the exit required...

6.then save and in COMPONENTS tab ..activate the exit components..

Run the transaction MB51.

Go to Sytem->status.

Get the package name from the dialog (system status find program name&#61664; go to se51 then see GOTO &#61664; object directory entry.

Go to transaction cmod and goto utilities &#61664; SAP enhancements enter the package name in F4 help.

You will get the list of transactions

Read only

Former Member
0 Likes
762
Read only

Former Member
0 Likes
762

Hi,

I have sent u some docs.

rgds,

latheesh