Wednesday, February 2, 2011

Working with Menu Exits

Menu exits add items to the pull down menus in standard SAP applications. You can use these menu items to call up your screens or to trigger entire add-on applications.

SAP creates menu exits by defining special menu items in the Menu painter. These special entries have function codes that begin with ‘+’ (a plus sign). You can specify the menu items text when activating the item in an add-on project.

Note: along with Menu exits SAP also provides the function module exit to attach the functionality for each menu option.

We can add customer menu options in two places:

  • To the initial screen on the SAP menu (Area Menus)
  • To the standard menus of the standard transactions.

Example: Adding custom menu options for the standard transaction MC94.

Identify the menu exit from the standard transaction, i.e. through SMOD.

Go to transaction SMOD. and press F4.

Choose from information system, if you get a screen as shown below.

You will get the below screen. Enter the package name in Package and press enter.

(You will get the package name using attributes of the program for the transaction)

These are the list of exits available and MCP20003 is the Menu exit.

Go to the initial screen of SMOD transaction and enter the enhancement name and select the option component and click on display to check the list of components from the enhancement.

You will get the components of the exit.

Note: since the function codes for the menu options are already available, it is enough to provide the meaningful descriptions. But this enables the options only and the functionality can be linked in the function code.

Execute the COMD transaction and provide the project name and click on Create button if the project is not yet created. Else deactivate the project by clicking on and open the project in change mode.

Now click on enhancement assignments.


Provide the enhancement name, save it and click on components

Now you will get the components of the exit. Double click on required function code i.e. +CU1.

Provide the function text, which is to be displayed as the menu option and click on Copy.

Once the test is provided, we need to link the functionalities for the already activated function codes through the function module exits.

Double click on the function module exit EXIT_SAPMMCP6_003.

Now double click on include ZXSOPU03. It will ask for creation click on Yes.

Save it as a local object and write the code as shown below. And activate it.

Now back to the initial screen of COMD and activate the project

Note: Make sure that the project is always activated and so that the additional functions get activated.

Testing the enhancement

We need to execute the corresponding standard transaction to make sure that the additional options are available and the corresponding functions are called.

Execute the transaction MC94. Enter the planning type and press enter

Enter the Material group and Material number. Now click on Active version.

Now you will get a screen as shown below.

Now in Menu à Extras à Customer functions you can find the Menu item “Create program - SSR3KOR” which is created now.

Click on Create program – SSR3KOR. You will get SE38 screen where you can create a program.

No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites