ENHANCEMENT - MENU 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.

MENU EXIT

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

Menu Exit is identify by '+' symbol.

We need to just double click on '+' symbol and create custom menu's.

Every menu exit should have Function module exit.

Menu exit is used to add menu's where function module is used to add the code for the respective menu.
 
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 PROGRAM

ADDING A CUSTOM MENU IN MC94 T CODE TO DISPLAY  SMARTFORMS TCODE

STEP: 1

We need to Find the Package Name of MC94 Tcode, so go to SE93 Tcode .

Give Tcode MC94 and click on Display.




Here we will get package name as MCP2 as shown below.





STEP: 2

Now go to Tcode SMOD and Click on Find icon .

Provide the package name and click on execute button.

We will get list of enhancement names.








Now we need to look for Menu exits, these are identified by '+' symbol.

Double on each exit one by one to get required menu exit.

As per our requirement MCP20003 is suitable as it as menu exits.

Just double click on it.







+ symbol are nothing but menu exits.

Before Creating a Menu Exits we need to create a project.

STEP: 3

Go to CMOD Tcode and create a project as below.

project names is zmenu.




Click on create icon and provide some description.

Click on enhancement assignments tab to give our enhancement name and press enter.











Then click on Components Tab to activate our enhancement so that our logic what we will write in function module exit (include) it will work.

Red colour indicates INACTIVE STATE.




Green colour indicates ACTIVE STATE...to get colour green click on ACTIVATE ICON.





Now Just double click on '+CU1'   and provide Function Text and click on copy as shown below.



 Then double click on our EXIT_SAPMMCP6_003.

 It will shown the Include based on import and export parameters we need to write the business logic.






Now double click on include and write the logic.

Based on Import Parameter we are writing our required logic.




LOGIC IS



ACTIVATE THE INCLUDE AND WE MUST CHECK WHETHER OUR PROJECT IS IN ACTIVE MODE OR NOT.

IF NOT OUR LOGIC WONT EXECUTE.

TESTING:

Go to Tcode MC94 .

Provide PLANNING TYPE as COMMIT.




Press Enter.

And click on ACTIVE VERSION.




Now go to EXTRAS TAB and then go to CUSTOMER FUNCTIONS and click on

our FUNCTION TEXT (call transaction smart forms) what we written previously.




Now we will go directly to SMARTFORMS SCREEN.







NOTE:

WHATEVER MENU WE CREATED IT WILL THERE AT EXTRAS TAB.