ENHANCEMENT - SCREEN EXIT

ENHANCEMENT
1.      Enhancement is a concept by which we can add our custom code to standard SAP software without modifying it .
2.      Each enhancement point = Exit point.

SCREEN  EXIT

 Screen Exit is used to add custom screen's to standard menu bar.

 The screen which we created is of type SUB SCREENS.

 Screen Exit is identify by Screen no.  I.E 100, 200

 We need to double click on screen no and create a screen which should be of type sub screen's.

 Every Screen exit should have Function module exit.

 Screen  exit is used to add sub screen's where function module is used to add the code for the respective screen's
FUNCTION MODULE EXIT
Function Module Exit Is used to write the Piece of Code to Enhance The Standard SAP Software.
These exits will have IMPORTING and EXPORTING Parameters.
Based on these we need to built our code.
Function Module Exit will have ZINCLUDES
Double On ZINCLUDE and write the LOGIC..
For Implementing These Exits we Need to Create a Project.
PROJECT:
 Project is a group of Enhancements.
 i.e like Screen and Menu exit....
We can activate and deactivate the project.
 If we activate the project ,the enhancements under our project goes to active state and our     custom code will be executed.
 Project is used as like SWITCH , to execute/ not to execute the enhancements.
 TCODE is CMOD for project Creation.

MODSAP AND MODACT ARE THE TABLES FOR ENHANCEMENT NAMES.

EXAMPLE 

ADDING A NEW SCREEN IN CJ92 TRANSACTION WITH SOME FIELDS


FIELDS :

               ERNAM (NAME OF THE PERSON WHO CREATED THE OBJECT)
              ERDAT ( DATE ON WHICH RECORD WAS CREATED)

TABLE : PROJ

TCODE : CJ92

STEP 1:

Need to find the package name using TCODE SE93.


Give Tcode as CJ92 and click on DISPLAY.




Now note Down the Package Name.

Go to TCODE SMOD.

Give package name and click on execute icon




here we did not get any enhancements names


STEP 2: 


So we need to go with Program Name using SE93 Tcode.



Click on DISPLAY





Copy the program Name and double click on it, and provide  call customer key word in find option

select as string radio button and select in main program radio button and clik on enter


repeat the above steps untill we get the list of call customer functions.





Double click on each call customer functions and note down all exits names .





Repeat for all call customer functions and note down all exits name.


 STEP 3:


Go To SE11 Give Table Name as MODSASP 


CLICK ON DISPLAY



\
Click on contents at the output give our exits names in the member. parameter

Click on execute icon





Now we will get the Enhancement Name.



repeat like this for all exits to get enhancements names.

STEP 4:

Go TO SMOD Tcode

Provide the Enhancements which we got in smod tcode under enhancement parameter and click on display button.

and look for screen exit .screen exit is identified by number. i.e 100,300.

As per our requirement the enhancement is CNEX0003



click on display




Now we need click on components and here we can see the screen exit.


STEP 5:

Before implementing this we need to create a project so that our enhancement in this project goes to ACTIVE state and our business logic will execute..

Go to Tcode CMOD and create a project as ZSCREEN.






Provide the enhancement name under enhancement assignments tab, click on enter.


'





Click on Components Tab and click on activate button.

Before it will be in RED colour Means its in INACTIVE STATE



When we click on Activate icon It goes to GREEN colour Means it is ACTIVE MODE




Here MENU EXIT is used for adding DESCRIPTION to be appear in menu.

Double click on screen 0205 and provide some description and compulsory we need select scrren as SUB SCREEN.



Click on LAYOUT option


LAYOUT SCREEN WILL BE APPEAR



Drag and drop text labels and input field as below


Click on flow logic and activate it.

Click on display Object List icon.

Function group will be opened.



Expand as below until  we get LXCN1TOP”.  


Double on that LXCN1TOP


Again dobule click on Include ZXCN1TOP.

Click on display <->  change option and click on insert option and declare them as shown below.



From the above the custom screen has been created.

Now we have to write the logic to display time and for the project.

For that we to use function Module exit EXIT_SAPLCJSS_002
  just double click on it we will get the include again dobule click and write the logic.


      v_name = SAP_PROJS_IMP-ernam .
  v_date = SAP_PROJS_IMP-erdat .

To Call the Screen we need to use menu exit, so go back to menu exit and double click on '+cu1' and assign name and click on copy as shown below



Now activate the entire project.

TESTING:

Go to code CJ92.

Provide the input as below


Then click on DETAILS Tab and we will able to see a menu that we created previously as shown below.



When we clicked on CLICK HERE the screen what we created will displayed as below.