Introduction to Menu Exit

 

  • Menu exit allows us to add menu items to the menu bar of SAP programs.
  • For any SAP transaction, we see there are already a lot of menu bars present.
    • Now, Suppose I have to add some addition menu items, then I can use Menu exits for the same purpose.
  • We can perform Customer functionalities on these menu items.

Note :-

  • These menu items have function codes that begins with “+” ( a plus sign ).

let’s take a requirement to understand this concept.

Requirement :-

  • We have a transaction code CAT2 which is used for timesheet.



  • Now, we also have a transaction code CAT4 which is used for approving the timesheet.

  • But, My Customer wants that there should be a menu bar on CAT2 transaction code and when I will click on that additional menu item, it should take me to the approve timesheet.

Important Note :-

  • Whenever you get any requirement for customer exit, it is always mandatory to check for its feasibility.

Ways to find a Menu Exit :-

  1. Check for menu items starting with “+” ( a plus sign ) in the ( System → Status → GUI Status → Menu Bar ).
  2. Put the package name of the program in SMOD transaction code. ( Utilities → Find → Package Name ).
  3. Go to transaction code SE84 ( Enhancements → Customer Exits ).

Checking the Feasibility of Menu Exit for the above Requirements :-

  • Step 1 :- On CAT2 transaction code → go to System → Status.

  • Step 2 :- Copy the Program name.

  • Step 3 :- Go to SE38 transaction code and select the attributes radio button.

  • Step 4 :- Pass the program name and click on display.



  • Step 5 :- Copy the Package name and go to SE84 transaction code.

  • Step 6 :- Click on Enhancements → Customer Exit → Enhancements.



  • Step 7 :- In the package provide the package name and click on execute button.



    • It will show all the customer Exits of the given package.


  • Step 8 :- Double Click on customer exit for Customer functions.



    • In the function codes we can see all the Menu Exits out of which one is for approve the timesheet.

Conclusion :-

  • So, After Checking for feasibility of the above requirements, we found the Menu exits that are suitable for the given requirements.
  • Therefore, We can say that it is feasible.

Implementing the Menu Exit in CAT2 transaction code :-

  • Step 1 :- Copy the above used customer exits that we have got.

  • Step 2 :- Go to CMOD transaction code.

  • Step 3 :- Provide a project name and click on create button.



  • Step 4 :- Provide the short description.



  • Step 5 :- Click on Enhancements assignments.

  • Step 6 :- Provide the name of the customer exit here.



  • Step 7 :- Click on the components tab.

    • In the components tab, all the function module exit, menu exit, screen exits that are available in the given customer exit will be shown.



  • Step 8 :- Now, we can use +CU6 or +CU7 as per our requirement, so lets take +CU6.

    • Go to change mode and double click on +CU6.



    • Click on copy button.

    • Activate the project.



  • Step 9 :- Now Simply go to CAT2 transaction code we can see clearly we have a menu bar for our requirement.




Writing logic for Above created Menu Bar :-

  • We will use the function module exit for writing the logic for our menu bar.

  • Step 1 :- Go to CMOD and open the above created project in display mode → click on components tab.



  • Step 2 :- Double click on function exit which is given above.



  • Step 3 :- Double click on the include which is given above and write the below logic.




Testing the Implementation :-

  • Step 1 :- Go to CAT2 transaction code.

  • Step 2 :- Provide the necessary details .



  • Step 3 :- Click on approve timesheet.



    • We can see we got navigated to CAT4 transaction code.

Comments

Popular posts from this blog

Understanding Different Types of SAP Function Modules: Normal, RFC, and Update

Unlocking SAP ABAP Secrets: Interactive Classical Reports with GET CURSOR, At User Command, and a Comparison of HIDE Statements

Mastering ABAP: A Step-by-Step Guide to Function Modules and Groups for Modularized Programming