Skip to Content

SCREEN EXITS

 

 

Screen Exit is a type of Customer exits, which are “hooks” provided by SAP within many standard programs, screens and menus on which customers may “hang” custom functionality to meet business requirements

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.

Screen exits allow you to add your own fields to specified screens in standard transactions.

To make provisions for this, additional screens have to be provided and additional fields must be added into appropriate database table.

 

Example Screen Exit

 

Scenario: In transaction CAT2 – Time Sheet Entry, HR wishes to include an interactive acknowledgement that knowingly submitting incorrect data is grounds for dismissal.

 

image

 

As a solution, SAP has provided the option for screen exits. Usually, SAP provides the following:

  1. An append structure in the database table with the new fields.
  2. A subscreen area into the standard screen – where the programmer can attach his subscreen of his own program with the new fields.
  3. A function group under which the new subscreen has to be created with the new fields.
  4. Function exits to synchronize the PBO and PAI of the standard SAP program with the PBO and PAI of the subscreen – so that data can flow back and forth between the standard SAP program and the program written by the developer for the subscreen. These function modules also exist in the same function group under which the subscreen will have to be developed.
  5. Finally, a linkage has to be done between the subscreen area of standard SAP screen with the custom subscreen 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 subscreen 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 subscreen 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).

 

Locating Screen Exit: Method 1

SMOD

  1. Execute transaction SMOD.
  2.  

  3. Specify relevant search criteria and execute search in the Repository Information System.
  4.  

image

3. Explore search results to locate appropriate Enhancement.

image

 

Locating Screen Exit: Method 2

1. Execute transaction SE81. Select appropriate application area and click

image

  1. Click Information system button.
  2. Expand Repository Information system -> Enhancements -> Customer Exits tree and double-click Enhancements entry.
  3.  

  4. Proceed as with Method 1 (results will now be filtered according to application area).
  5.  

image 

Utilize the Enhancement in a Project

After you have found one, do as directed in the documentation. Generally, the steps are as follows:

  1. Create a project using CMOD including your enhancement.
  2.  

  3. Create the append structure with new fields.
  4.  

  5. Go to the desired function group and create a subscreen with the new fields. Write PBO and PAI for the subscreen, if required.
  6.  

  7. Use the function exits in the enhancement to link the PBO and PAI of the subscreen with that of the main SAP program supporting the SAP transaction.
  8.  

  9. Maintain necessary linkage between the subscreen area of standard SAP program with the custom subscreen 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.
  10.  

  11. Activate the project.
  12.  

  13. Test to ensure that required functionality are met.

 

     

CASE STUDY

 

Add three new custom fields for Asset master and maintain information for them

REQUIREMENTS

 

Three fields in the legacy system have to be maintained in Asset master. These fields are:

  1. Original Asset number – 20 characters
  2.  

  3. Location 2 – 15 Characters.
  4.  

  5. Model no – 20 characters
  6.  

Location 2 should start with ‘L’.

 

DEVELOPMENT STEPS IN DETAIL

 

STEP 1: Finding 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 Subscreens in PBO. EXIT_SAPLAIST_003 Function Exit Transfer of User-Defined Fields to SAP Master Data Transactions CI_ANLU Customizing Include structure to add new fields.

 

STEP 2: Creating a Project to include the enhancement

  1. Go to transaction CMOD and create a project.
  2.  

  3. Enter a description for the project. Then, click on the pushbutton ‘Enhancement Assignments’ in the Application Toolbar.
  4.  

  5. Enter the name of the enhancement and Save.
  6.  

  7. Go to ‘Components’.
  8.  

    STEP 3: Creating Custom Include for ANLU

The screen will appear, showing all the enhancement components under the assignment AIST0002. Double-click on the name of the Include Structure to create it.

Create the include structure with three new fields, as required. Then, save and activate it.

 

STEP 4: Develop the subscreen and the program

 

Go to transaction SE80. For the function group XAIS, create a new subscreen 9000.

Create it as subscreen.

Then, go to the Layout of the screen and create three new fields from Database table ANLU.

Drag the fields in the screen body and place them.

Then, save and activate the screen and come back to screen flow editor.

Create the PAI module to add validation for field “Location 2”, as required .

Activate the whole function group and come out.

 

STEP 5: Write code in the Function Exits to synchronize the programs

Now, code has to be written in the function modules EXIT_SAPLAIST_002 and EXIT_SAPLAIST_003 so that data flows to and fro between the main SAP program and custom subscreen program. For that, go back to transaction CMOD and change the function exits.

Write code in the function module EXIT_SAPLAIST_002 called once at the beginning of the transaction:

Write code in EXIT_SAPLAIST_003 to pass the data from the subscreen to SAP main program.

Then, activate everything – the whole project and come out.

 

STEP 6: Complete the configuration to link the subscreen.

The development portion is complete. Now, linking of the subscreen has to be done with the subscreen area of the main program. In most of the cases, this linking can be done in the enhancement itself. But, here, requirement is a bit different. It is done by configuration using SPRO.

Assets are created under Asset class. And for each asset class, there is a layout assigned to it. For a layout, there are multiple tab pages assigned to it. And, for each tab page, there are multiple screen groups/field groups assigned.

Here, the requirement is to create these three custom fields in the tab page ‘General’ of asset master screen (AS01/AS02/AS03/AS91).

 

STEP 7: Determine the Layout

To achieve this, first of all, we need to find out which layout is assigned to asset class 1000.For that, go to transaction AOLK( information has to be obtained from functional consultant).Select the Asset Class ‘1000’ and click on folder ‘General Assignment of Layout’.

Here, for Asset class 1000, for all the user groups, tab layout SAP is assigned. Since layout ‘SAP’ cannot be changed, it has to be copied and manipulated to include our screen group. Later, the new layout has to be assigned over here.

 

STEP 8: Create new tab layout

Go to transaction AOLA. Copy the tab layout ‘SAP’ to create another layout, say, YSUB.

System will copy all the settings and will inform you about that.

Select your newly created layout and double-click on the folder ‘Tab page titles’.

You want to put your custom fields in the tab page “General”. So, select this tab page entry and double-click on the folder “Position of Groups”.

Here, all the field groups currently residing in the tab-page “General” are shown. Add an entry for your newly created fields.

Select the group box from the list. An entry will come with “U” padded with the custom subscreen prepared by you.

Then, save and come out.

 

STEP 9: Assign the new Layout to Asset Class

Now, go to tcode AOLK and assign tab layout YSUB for asset class 1000.

Save and come out.

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

    1. Sandra Rossi
      Screen exits are still useful in new installations of ECC 6 modules (MM, FI, etc.) What other new possibilities do you have?

      But I can understand that there are probably lots of free blogs and wikis about this topic everywhere on internet, so why adding a new one?

      (0) 

Leave a Reply