Screen Exits
Screen Exits
- Details
- Category: SAP-ABAP
- Published on Wednesday, 22 October 2008 13:50
- Written by Kumar
- Hits: 4411
Introduction
SAP provides standard transactions to enter data into database. But a client may want to maintain some additional information in SAP other than what is provided.
To make provisions for this, additional screens have to be provided and additional fields must be added into appropriate database table.
To pave way for this, SAP has provided the option for screen exits. Usually, SAP provides the following:
- An append structure in the database table with the new fields.
- A sub screen area into the standard screen – where the programmer can attach his sub screen of his own program with the new fields.
- A function group under which the new sub screen has to be created with the new fields.
- Function exits to synchronize the PBO and PAI of the standard SAP program with the PBO and PAI of the sub screen – so that data can flow back and forth between the standard SAP program and the program written by the developer for the sub screen. These function modules also exist in the same function group under which the sub screen will have to be developed.
Finally, a linkage has to be done between the sub screen areas of standard SAP screen with the custom sub screen constructed by the developer.
Typically, SAP provides an enhancement in which the developer can create an append structure, use the function exits to synchronize the PBO and PAI of the standard SAP program and the custom sub screen program, and make the necessary linking( as mentioned above in step 4. But, again, this is not a hard and fast rule. Linking in some case is also done by configurations.) SAP also usually provides the name of the function group under which the sub screen has to be developed.
Necessary guidance about implementing a screen exit development is usually available in the Documentation section of the enhancement (can be availed by transaction SMOD).
Pre-Requisites
The developer to work on screen exit should have essential knowledge on the following:
- DDIC concepts, including the knowledge of append structure.
- Concept of SAP Enhancements and implementing them using Projects.
- Concept of function exits.
- Knowledge on Module Pool – including sub screens, Tab strip controls etc.
Steps
Guidelines
So, a developer can follow the guidelines mentioned below to implement a screen exit to a standard SAP transaction, as and when required:
Find out the Required Enhancements
- Go to SMOD. Press F4 in the Enhancement field. In the next popup window, click pushbutton ‘SAP Applications’. A list will appear that contains information on all the enhancements, categorized under functional areas. Developer must search for the enhancements relevant to his functional area of interest – for e.g., Purchasing, Asset Accounting, etc.
- Note down the enhancements. Then, come to the initial screen of SMOD and view the documentation of each enhancement to find out which one is required for your development.
Utilize the Enhancement in a Project
After you have found one, do as directed in the documentation. Generally, the steps are as follows:
- Create a project using CMOD including your enhancement.
- Create the append structure with new fields.
- Go to the desired function group and create a sub screen with the new fields. Write PBO and PAI for the sub screen, if required.
- Use the function exits in the enhancement to link the PBO and PAI of the sub screen with that of the main SAP program supporting the SAP transaction.
- Maintain necessary linkage between the sub screens areas of standard SAP program with the custom sub screen developed along with the custom program name. This can be done in the project (developed by CMOD including the enhancement) or outside as a part of configuration.
- Activate the project.
- Test to ensure that required functionality is met.
Case Study 1
Add three new custom fields for Asset master and maintain information for them
Requirement
Three fields in the legacy system have to be maintained in Asset master. These fields are:
- Original Asset number – 20 characters
- Location 2 – 15 Characters.
- Model no – 20 characters
Location 2 should start with ‘L’.
Pre-Analysis
Finding out the Enhancement
As described above, the enhancement is determined. It was found, that enhancement AIST0002 will serve the purpose. It contains the following components (can be viewed by transaction SMOD):
Exit Type Description EXIT_SAPL1022_001 Function Exit Check of User-Defined Fields when Using Create and Change BAPI EXIT_SAPLAIST_002 Function Exit Transfer Data for User Sub screens in PBO. EXIT_SAPLAIST_003 Function Exit Transfer of User-Defined Fields to SAP Master Data Transactions CI_ANLU Customizing Include Include structure to add new fields
Studying the Function Exits
The function module level documentation for the function exits are then viewed from transaction SE37. The documentation clearly laid out for the purpose for their use:
EXIT_SAPLAIST_002
Function module Level Documentation
This function module is called by asset master data maintenance at the start of the dialog. (When changing, it is called after reading of the data from the database; when creating it is called after the transfer of the default values from the asset class and reference asset.) The purpose of the function module is to enable this function group to recognize the master data. For interpreting or controlling master data fields that are important for user fields, it is possible to transfer to global variables at this point, so that they can be recognized when the user sub screens are processed.
Import Parameters
Understanding
This function module is called at the PBO to pass the information retrieved from the database to pass them to the custom sub screen and its underlying program. Import parameter: I_ANLU will be populated with the values for user-defined fields which will be passed to the sub screen program. So, there must be some sort of variable assignment from I_ANLU.
EXIT_SAPLAIST_003
Function module Documentation: This function module is called by SAP asset master data maintenance after the screens are processed, but before saving. The purpose of the function module is to transfer fields entered on user sub-screens of SAP asset data maintenance to the database for updating. The export parameter for this function module is:
Understanding
This function module will be used to transfer the user entered data in the sub screen fields to the main SAP program, which will then be saved into the database.
Studying the Documentation of the Enhancement
The enhancement documentation (as is viewed from the initial screen of SMOD] also supports the idea. Moreover, it informs that we need to develop a sub screen under function group XAIS. This is the function group under which the two function exit modules also exist. So, if the custom sub screen refers to the global data of the function group XAIS, then those values will also be available to these function exits as well.
Going to SE80 and viewing the function group XAIS helps us to inform that there are three DDIC tables declared for it:
- Prev
- Next >>

