EXP_0010.doc

(282 KB) Pobierz
BC425 Enhancements and Modifications

 

0

 

0.2

 

0.3

 

nSAP application programmers define keywords in different lengths and a short description for each data element.

nYou create field exits in Project Management. Field exits are processed when the user leaves a screen that contains a field that refers to a data element containing a field exit.

0.4

 

nSAP lets you create a field exit for every input-ready screen field that has been created with reference to the ABAP Dictionary. The additional program logic is stored in a function module and is executed at a  specific point at the PAI event.

nThe slide shows the order in which processing takes place. Before the PAI event of the screen is executed, the system performs the following checks: First the system checks if all the required fields have been filled in. If a required field is empty, the screen is shown again. The system then checks that data has been entered in the correct format. Any defined field exits are executed next. For example, by sending an error message you can have the screen sent again.

nOnce all the field exits have been checked, the screen is processed as normal.

Field transport

Foreign key check

Processing of PAI module for screen

0.5

 

nField exits take you from a screen field with a data element reference to a function module. Field exits can be either global or local.

nGlobal field exits are not limited to a particular screen. If a global exit's data element is used on several screens, the system goes to the function module for all these screens after activating the field exit. Here you can, for example, edit the contents, force a new entry to be made by outputting an error message, or prohibit certain users from proceeding further.

nLocal field exits are valid for one screen only. If you assign a screen from a specific program to a field exit, then the system will go to the appropriate function module from this screen once the exit has been activated.

nYou can either create one global field exit or up to 36 local field exits for a data element,  but not both.

nEach exit number refers to a different function module. Field exit function modules adhere to the following naming convention:

Prefix:                                          FIELD_EXIT_

Name:                                          <Data element>

Suffix (for local field exit):               _0 to _9, _A to _Z

0.6

 

nTo create field exits, choose Utilities in the ABAP Workbench. Choose "Enhancements" and then "Project management" to edit field exits and to implement customer exits.

nWith Goto -> Global enhancements -> Field exits you start the transaction for maintaining field exits. To create a new enhancement, choose the menu path Text Enhancements -> Create.

nEnter the name of the data element to which your screen field refers in the modal dialog box. The Function Builder is started. The system specifies the name of the field exit. Do not change this name. Create the function module in a customer function group.

nThe function module interface is fixed and cannot be changed. The function module has an import parameter INPUT and export parameter OUTPUT. The contents of the screen field are stored in parameter INPUT. The contents of OUTPUT are returned in the screen field when you leave the function module.

0.7

 

nIn the source text, export parameter OUTPUT of the function module must be assigned a value that is transported back to the screen field. Otherwise the screen field would be initial after executing the field exit.

nThe following ABAP statements are not allowed in field exit function modules:

­CALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMIT

­COMMIT WORK, ROLLBACK WORK

­COMMUNICATION RECEIVE

­EXIT FROM STEP-LOOP

­MESSAGE I, MESSAGE W

­STOP, REJECT

nWhen you debug a screen that is referenced by a field exit, the field exit code is ignored by the debugger. As with any normal function module, you can, however, debug the field exit code in the Function Builder's test environment.

0.8

 

nYou can create local field exits that relate to a specific screen.  Create a local field exit. A global field exit must already exist. Edit the local field exit based on the global field exit.

nYou can create up to 36 local field exits, each of which carries a unique suffix. The system proposes a name for the function module; you should use this name.

nDefining local field exits means that the function module of the global field exits initially created are no longer used. However, you must not delete them for technical reasons. The field exits in the system would be deleted if you deleted the global function module of the field exit from the list.

0.9

 

nYou must activate the field exit as well as the function module. Also note that field exits are only taken into account during screen execution if the R/3 profile parameter abap/fieldexit = YES has been set for all application servers. (This profile parameter is set to 'NO' by default).

nIf you declare field exits for multiple screen fields, you have no control over the order in which they are processed. In particular, you cannot access the contents of other screen fields in a field exit.

nAlso read note 29377 about field exits.

0.10

 

0.11

 

nPossible text enhancements include customer keywords and customer documentation of data elements.

nText enhancements differ from other application enhancements in that they take effect globally in all related SAP applications after activation (global enhancements).

0.12

 

nSAP application programmers define keywords in different lengths and a short description for each data element. Use the project management function to change these keywords and short texts.

nAll screen fields that use the keyword text of data elements can be renamed in this manner.

nA new short text in a data element will appear in the F1 help of the screen field.

0.13

 

nTo edit text elements in project management choose ABAP Workbench -> Utilities -> Enhancements -> Project management.

nUnder Global enhancements you can find enhancement functions for keywords and documentation for data elements.

0.14

 

nIn order for keyword changes to take effect on a screen, SAP application programmers have to maintain the MOD attribute (keyword modification indicator) of the affected field accordingly in the Screen Painter field list.

nThe MOD attribute must have one of the following values:

SPACE:                            the keyword that best fits the field length
1:                            short keyword
2:                            medium keyword
3:                            long keyword
4:                            keyword for header
V:                            variable text transfer from the ABAP Dictionary
F:                            fixed, no text transfer

nIf  'F' is entered, then the keyword is fixed on the screen and cannot be replaced. In all other cases, screens that refer to that particular data element will show the changed keyword.

0.15

 

nYou must always restore keywords after a release upgrade or after new corrections have been imported, whenever SAP has redelivered existing keywords. If customers want to retain their own keywords from the last release, they should choose the menu option Restore customer. SAP recommends that you always restore your keywords after a release upgrade.

nKeywords are restored by a program running in the background. This program checks all of the data elements that you have edited and restores their keywords and short texts if necessary.

nWith certain central keywords, such as BUKRS, MANDT, and so on, we recommend that you start the restoration process at a time when the contents of the tables that use BUKRS and MANDT are not being changed. Otherwise, activation of the data element may fail, changing the status to only partially active.

0.16

 

nTo undo keyword changes, choose the menu option Restore SAP.

nKeywords are restored by a program running in the background. This program checks all of the data elements that you have edited and restores their keywords and short texts if necessary.

0.17

 

0.18

 

nWhen enhancing data element documentation, include your SAP documentation as an include module. By doing this you do not lose the reference to SAP documentation. Any following documentation delivered by SAP is also taken into consideration.

nIf you press the F1 key while on the appropriate field after you have activated your documentation, your text will appear in addition to the SAP documentation.

nYou can generate a list of data elements that have been changed and edit the documentation by selecting the elements' corresponding lines in the list.

nSimply delete your own documentation if you want original SAP documentation to be displayed.

0.19

 

nYou also have the option to create your own data element documentation independent of the SAP documentation. However, this is not recommended, since the reference to SAP documentation is lost. If SAP delivers a new version of the documents in question, you may miss important information.

nYou may also use the include module for the SAP documentation in your own documentation. You should only do this, however, if changes to the contents of the original documentation are absolutely necessary in your R/3 System. The reference to SAP documentation is not totally lost in this case, but any changes that appear in later versions will not be reflected in your system.

0.20

 

nSAP customers can enhance the R/3 System with their own keywords, short texts, and documentation for data elements. These enhancements can be made using the project management function.

nOnce they are activated, enhancements of this kind are available in all SAP applications that use the data elements in question.

Exercises

 

 

Unit: Appendix

Topic: Field exits

 

At the conclusion of this exercise, you will be able to:

·Implement a field exit that can be used to make supplementary checks of a screen field.

 

 

The transaction that your co-workers use to display flight information (BC425_##) allows you to access data for all airline carriers. The customer service personnel, however, should only be able to access the airlines for which it has explicit authorization.

What is the name of the program for the above transaction?

1-1-1              What is the name of the data element referenced by the input field for the airline?

1-1-2       ...

Zgłoś jeśli naruszono regulamin