Skip to Content
author's profile photo Former Member
Former Member

screen exits

Hi,

In Screen exit we need to do following things ,

1) Append stucture to add new fields in a table.

2) Create a Subscreen to display these new fields.

3) Function Exits to flow the data to and from the screen,program and database.

Need explaination on this.

charitha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 05:55 AM

    Hi Charitha,

    Check this info.

    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.

    Screen Exit is nothing but enhancing the screen like creating some more fields, subscreen and so on.

    1. Go to the screen >System >Status-->Program (Double

    click this program. It will take you to the program.

    2. Now, Goto-->Object Directory Entry.

    3. Make a note the package name.

    4. Now run the transactions SMOD, press F4 and enter the

    above noted package, press enter.

    5. It will display list of Exits.

    6. Now go back to the initial screen SMOD.

    7. Specify the exit name here and select the radio button

    Components.

    8. It will display four group boxes one for FM, second

    for Fcodes, thrid for Screen areas and last for

    includes.

    9. Goto transaction CMOD, create a new project, and

    click the button "Enhancement assignments" and

    specify your enhancements that you got in SMOD.

    10. Now bouble clikc the enhancement, it will take you to editor with some includes starting with Z, double clikc the include you want to edit and proceed.

    and you just go through these links also

    screen-exit

    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

    screen-exits

    Hope this resolves your query.

    <b>Reward all the helpful answers.</b>

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 05:59 AM

    Hi Charitha,

    Go through this info.

    USEREXIT

    UserExits allow us to add our own functionality to SAP standard program without modifying it . These are implemented in the form of subroutines and hence are also known as FORM EXITs. The UserExits are generally collected in includes and attached to the standard program by the SAP.

    All UserExits start with the word USEREXIT_...

    FORM USEREXIT_..

    z..

    ENDFORM.

    The problem lies in finding the correct userexit and how to find it if one exists for the purpose. Once the correct userexit is found the necessary

    customer code is inserted in the customer include starting with the z..

    in the form routine.

    e.g. USEREXIT_SAVE_DOCUMENT_PREPARE

    Certain application like SD still provide this form of enhancement using userexit but this practice is no longer being followed for newer extensions

    instead they are using EXITs which come bundled in enhancement packages . Nevertheless existing USEREXITS will be supported by SAP an all the newer versions of SAP.

    HOW TO FIND USEREXITS

    UserExits can be found in number of ways:

    1) To find UserExits in SD module , goto object navigator(SE80) and select

    development class from the list and enter VMOD in it. All of the UserExits in SD are contained in the development class VMOD. Press

    enter and you will find all the includes which contain UserExits in SD for

    different functions like PRICING, ORDER PROCESSING etc. Select the userexit according to the requirement and read the comment inserted in it

    and start coding .

    Some examples of UserExits in SD(SALES & DISTRIBUTION ) are:

    1)ADDING OF NEW FIELDS IN PRICING

    In Pricing in SD the fields on the basis of which pricing is done are derived from the FIELD CATALOG which is a structure KOMG .This structure is used to transfer transaction data to the pricing procedure in SD and is also known as communication structure.This structure KOMG consists of two tables KOMK for Header related fields and KOMP for item related fields.

    The fields which are not in either of the two tables KOMK and KOMP

    cannot be used in pricing .Sometimes a need arises when the pricing

    is to be based on some other criteria which is not present in the form of fields in either of the two tables.

    This problem can be solved by using USEREXITS which are provided for pricing in SD.

    Pricing takes place both when the SALES ORDER ( Transaction VA01) is created as well as when INVOICING ( Transaction VF01) is done.Hence SAP provides 2 UserExits ,one for sales order processing which is

    USEREXIT_PRICING_PREPARE_TKOMP or

    USEREXIT_PRICING_PREPARE_TKOMK

    Depending upon which table (KOMK or KOMP) the new fields were inserted we use either of the above two UserExits.These UserExits are found in include MV45AFZZ of the standard SAP sales order creation program SAPMV45A.

    In the case of userexit which will be called when invoicing is done ,these are provided in the include RY60AFZZ which is in the standard SAP program SAPMV45A. The name of the UserExits are same. i.e

    USEREXIT_PRICING_PREPARE_TKOMP or

    USEREXIT_PRICING_PREPARE_TKOMK

    These UserExits are used for passing the data from the communication structure to the pricing procedure, for this we have to fill the newely created field in the communication structure KOMG for this we fill the code in the above userexit using the MOVE statement after the data that

    has to be passed is taken from the database table by using the SELECT statement. The actual structure which is visible in these UserExits and which is to be filled for that particular field is TKOMP or TKOMK.

    Before the coding for these UserExits is done ,it is necessary to create a new field in either of the two tables KOMK or KOMP .For this purpose includes are provided in each of them .

    To create the field in header data(KOMK) the include provided is KOMKAZ and to create the field in item data(KOMP) the include provided is KOMPAZ.

    One possible example for the need of creating new fields can be e.g. Frieght to be based upon transportation zone ,for this no field is available in field catalog and hence it can be created in KOMK and then above UserExits can be used to fill the transportation data to it.

    2)The other method of finding userexit is to find the word USEREXIT in the associated program of the transaction for which we want to determine userexit using SE38.

    3)The other method of finding UserExits is to find the include in case of SD/MM applications where the UserExits are located ,this can be found in the SAP reference IMG generally in the subfolder under SYSTEM MODIFICATION.

    Some other examples of UserExits in SD are:

    USEREXIT_NUMBER_RANGE

    This userexit is used to assign a different internal document number to the sales order(VA01) when it is created depending on some criteria like a different SALES ORGANIZATION(VKORG) .

    USEREXIT_SAVE_DOCUMENT_PREPARE

    This userexit is used to insert the ABAP code which will be called when the document (sales order VA01) is just about to be saved. This userexit is used generally for custom checks on different fields , to display some information before the order will be saved or for making changes to certain fields before the sales order will be saved.

    Exits & Enhancements

    There are mainly six types of EXITs in sap which have been collected in the form of enhancement packages and attached to standard code in SAP.

    These are different from USEREXIT in the way that they are implemented in the form of FUNCTIONs while in USEREXITS we use form routines for their implementation. These are also sometimes known as function exits . These start from the word EXIT_ followed by the program name and then followed by a three digit number.

    e.g. EXIT_SAPMV45A_002

    This exit is found in SD in enhancement V45A0002.

    TYPES OF EXITS

    1)MENU EXITS

    2)FUNCTION EXITS

    3)TABLE EXITS

    4)SCREEN EXITS

    5)KEYWORD EXITS

    6)FIELD EXITS

    We use SAP transactions CMOD and SMOD to manage exits. Before implementing an exit , it is required to create the project by using CMOD

    selecting the enhancement e.g. V45A0002 and selecting the component

    (one which fulfills our need) i.e the exit which will be implemented in SMOD and after coding has been done the project has to be activated.

    An exit can be coded only once.

    FUNCTION EXITS

    These are used to add functionality through ABAP code . These start from the word EXIT_programname_NNN ending in a 3 digit number. No access code is required to implement any type of exit including function exits.

    The function exits are called from the standard SAP program in the form of ABAP statement

    CALL CUSTOMER-FUNCTION 'NNN'

    This is in contrast to USEREXITs where PERFORM statement is used to call the required userexit. To implement the FUNCTION EXITs first of all the project is created and a suitable enhancement package is selected and from its components the function exit to be implemented is selected and on double clicking it the exit code will appear in ABAP EDITOR(se38) where a Z include will be found and the customer code should be entered in this include.

    ADDING A DEFAULT SOLD-TO-PARTY in Sales Order Creation

    To show a default sold-to-party in this field when the user creates a sales order (VA01) we can use a function exit .This function exit is located in enhancement no. V45A0002 . Before we can choose the exit we have to create a project in CMOD after that enter V45A0002 in the enhancement field and click on the components . In the components you will see the exit EXIT_SAPMV45A_002 . This exit is used for our purpose.

    Double clicking on this exit will takes us to function builder (SE37) . This function exit has one exporting parameters and two importing parameters, we are interested in exporting parameter which is E_KUNNR of type KNA1-KUNNR i.e if we move the desired customer name to this

    structure(E_KUNNR) it will be shown in the field as the default value when we create the sales order.

    This function also contains a customer include ZXVVA04 . This include will be used to write our custom code .

    Double clicking on this include and it will prompt us that this include does not exists do you want to create this object ,select yes and the include will be created .In this include we can write our own code that will fill the field E_KUNNR.

    e.g. E_KUNNR = 301.

    Activate the include and Activate the project. Now when ever the SALES ORDER will be created , sold-to-party field will come up with a predefined customer .

    FIELD EXITS

    The field exits are managed, created, activated through program RSMODPRF. The field exit is associated with a data element existing in ABAP dictionary and hence to the screen field using that data element.

    The format of field exit is :

    FIELD_EXIT_dataelement_A-Z or 0-9

    If a particular screen and program name is not specified than the field exit will effect all the screens containing that data element.

    The function module associated with field exit shows two parameters INPUT and OUTPUT. Input parameter contains the data passed to the field exit when the field exit was invoked by the R/3 , We can write our own code to change the output parameter depending upon our requirements.

    Before the field exit can have any effect the system profile parameter ABAP/FIELDEXIT in all the application servers should be set to YES

    ABAP/FIELDEXIT = YES.

    **********rewords some points if it is helpful.

    Rgds,

    P.Naganjana Reddy

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 05:50 AM

    Hi,

    Screen Exit is nothing but enhancing the screen like creating some more fields, subscreen and so on.

    1. Go to the screen >System >Status-->Program (Double

    click this program. It will take you to the program.

    2. Now, Goto-->Object Directory Entry.

    3. Make a note the package name.

    4. Now run the transactions SMOD, press F4 and enter the

    above noted package, press enter.

    5. It will display list of Exits.

    6. Now go back to the initial screen SMOD.

    7. Specify the exit name here and select the radio button

    Components.

    8. It will display four group boxes one for FM, second

    for Fcodes, thrid for Screen areas and last for

    includes.

    9. Goto transaction CMOD, create a new project, and

    click the button "Enhancement assignments" and

    specify your enhancements that you got in SMOD.

    10. Now bouble clikc the enhancement, it will take you to editor with some includes starting with Z, double clikc the include you want to edit and proceed.

    and you just go through these links also

    screen-exit

    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction

    screen-exits

    How to implement screen exit for a SAP standard transaction HOT

    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 subscreen area into the standard screen – where the programmer can attach his subscreen of his own program with the new fields.

    A function group under which the new subscreen 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 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.

    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).

    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 subscreens, Tabstrip 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 subscreen with the new fields. Write PBO and PAI for the subscreen, if required.

    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.

    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.

    Activate the project.

    Test to ensure that required functionality are 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 Subscreens 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 subscreens 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 subscreen and its underlying program. Import parameter : I_ANLU will be populated with the values for user-defined fields which will be passed to the subscreen 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 subscreen 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 subscreen under function group XAIS. This is the function group under which the two function exit modules also exist. So, if the custom subscreen 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:

    Deciding the Final course of Action

    After making all the investigations, the final course of action was determined.

    SrlNo Step Justification

    A project has to be created using transaction CMOD where the enhancement AIST0002 will be included.

    Customizing include CI_ANLU has to be created with the custom fields demanded When CI_ANLU will be developed, the custom fields will get appended to the database table ANLU. Also, these fields will be used to create screen fields in the new subscreen.

    A custom subscreen, say, 9000 will be developed under function group XAIS. The screen group for the screen will be ‘CUST’ (or any name). The three custom fields added to table ANLU (by creating CI_ANLU) will be used to create new fields in the screen.

    In the PAI of the subscreen, validation for Location to start with ‘L’ will be added. The subscreen with three new fields has to be developed so that it can be attached to a subscreen area of the asset master screens.

    In the custom include of the function exit module ‘EXIT_SAPLAIST_002’, the following code will be written:-

    ANLU = I_ANLU. I_ANLU is the import parameter of this FM. The value is assigned to the global variable ANLU, referring which the three new subscreen fields are developed. So, data retrieved from database table ANLU will be passed to this FM as I_ANLU by the standard SAP main program. The value will be taken and passed to the global variable of the function group XAIS, so that the three custom fields (referring to ANLU of XAIS) get populated.

    In the custom include of the function exit module ‘EXIT_SAPLAIST_003’, the following code will be written:-

    E_ANLU = ANLU. The changed values in the subscreen fields exist in global variable ANLU for the function group XAIS. This function exit module will pass the data back to the SAP main program as E_ANLU.

    Proper linkage/configuration has to be done so that the new subscreens get linked to the appropriate subscreen area of the Asset master screen. This has to be done – otherwise, the new custom subscreen will not be displayed in the Asset master screens.

    Development

    Creating a Project to include the enhancement

    Go to transaction CMOD and create a project.

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

    Enter the name of the enhancement and Save.

    Go to ‘Components’.

    Creating Custom Include for ANLU

    The screen shown below 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.

    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.

    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.

    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).

    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.

    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.

    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.

    Test the Exit

    Everything is over. Now, go to transaction code AS01/02/03 or AS91 to deal with an asset of asset class 1000. You will see your new fields added to the screen. Add values to them…save. Then, enter into the tcodes again to see whether the values entered by you are being displayed or not.

    Original Source: ittoolbox.com

    reward if sueful

    regards,

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 23, 2007 at 05:51 AM

    Exit's are nothing but the R/3 Enhancements which allows you to add your own functionality to SAP’s standard business applications without having to modify the original applications. SAP creates customer 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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.