05-19-2006 6:19 AM
HI All,
I have created a field exit for the field REVOK but its not getting executed. Here I am giving the procedure how I created field exit. Please tell me where I went wrong:
In SE37, created a fn module with name FIELD_EXIT_DCM_REVOK where DCM_REVOK is the dataelement of the field REVOK in ME22N tcode. I wrote the code, and activated. There I havent given any input and output parameters.
After that, I executed the program RSMODPRF, gave dataelement DCM_REVOK as input and executed. In the next screen, it has shown all the dataelements in which my data element is also there, there I activated that.
After testing my particular requirement in me22n, observed that this code is not getting executed.
Is the above procedure correct or do I have to follow any other steps??
Please suggest me.
Thanks & Regards,
Satish
05-19-2006 6:23 AM
Try these steps out..
Step by step procedure for creating Field Exits
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 elements 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 elements 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 modules 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 exits 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
05-19-2006 6:55 AM
HI Sravanthi,
Thank you for giving the clear steps in creating field exits. I am tryig to follwo the same procedure.
Create field exit..
in cmod tcode, i didnt find the following path
Field exit -> Create menu path
instead, i went to path like this
GOTO->Text Enhancements->Dataelements->New DE cust path
there I have given dataelement and clicked on push button, its showing documentation but not navigating to SE37.
I am using 4.7EE version.
Please suggest me how to proceed
satish
05-19-2006 6:23 AM
Hi satish,
1. observed that this code is not getting executed.
How did u test this ?
2. In field exit, Debugging is not possible.
3. Hence, to check, whether the field exit
is in fact getting fired,
just give some WARNING MESSAGE
(without any condition)
as the first line in the field exit.
4. In this way, we can first come to know
whether the field exit is getting fired or not !
regards,
amit m.
05-19-2006 6:27 AM
HI,
I gave warning message only in the first line of source code, I didnt get that message while testing, so thought that this particular code is not getting executed.
satish
05-19-2006 6:57 AM
Hai Satish
Go through the following Documents
Step by step procedure for creating Field Exits
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 elements 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 elements 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 modules 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 exits 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
Thanks & regards
Sreeni
05-19-2006 11:05 AM
HI All,
I have created field exit as per the procedure.
Now the profile parameter abap/fieldexit is set to be YES. This should be done at RZ10 tcode and we need to restart SAP system. Right??
Satish