You are on page 1of 13

Implementing Menu Exits and Screen Exits in

CJ92 Transaction
Business Requirement: Add a custom screen in CJ92 transaction to
Display the date/name of the person created the PROJECT.
For this we need to implement Menu Exits and Screen Exits for transaction
CJ92

Technical requirements:
Tcode is : CJ91/ CJ92/ CJ93.
Date : Field Name is ERDAT.
Nmae : Field Name is ERNAM.
Table name is : PROJ
The above tables and fields are given by functional consultants.

STEPS:
Step1 : Find the Package Name
Step 2: Find the Enhancements(FM exits) using package name in
SMOD Transaction.
Step 3: If no Enhancements are available, use CALL CUSTOMER and
find an enhancement.
Step 4: Implement the enhancement using CMOD Transaction .
Step5 : Test it

Step1 : Find the Package Name


Goto SE93
Give Transaction code name as : Cj92
Click on Display
Transaction code will be displayed.
Note down the package name.
Step 2: Find the Enhancements(Screen/FM exits) using package
in SMOD transaction
Goto SMOD

Click on UTITLITIES From menu bar


Select FIND
Give Package name .
Click on Execute
No Enhancement are displayed here.
So, Use alternative approach as below.

Step 3: If no Enhancements are available, use CALL CUSTOMER and


find an enhancement.
Goto CJ92
Give any Std. project def., Ex : A-10000

Click System from Menu bar -> Status ->


Double click on Program (Screen)

Now, Click on Find Icon


Type Call customer in the Find field, then click the In Main program
radio button and hit Enter

Doble click on SAPLCJSS


A list of call customer functions will be displayed.
We cannot put any break-points and search for screen exit.
Double click on each call customer functions
Note down the Function Module name and doubl click
GOTO table SMOD and find the enhancement name for each
Function Module.
Repeat this for each Functon module .
Below is the list which displays Enhancement name for each
Function module

Now, Search for SCREEN EXITS.

Goto SMOD
Give the first Enhancement Name

Click on Display.
Click on Components
You can observe that there are no screen exits available.

Repeat the same for each enhancement and find the screen exits.

Goto SMOD
Give the first Enhancement Name

Click on Display.
Click on Components
You can observe that there are screen exits/Menu exits/FM Exits
available.

SO now , we can implement this Enhancement

Step 2: Implement the Scren Exit using CMOD Transaction .

Goto CMOD Transaction.


Give a name for the Project

Click on change
Click on Enhancement Assignments
Give the Enhancement name as CNEX0003

Click on Components
Below screen will be displayed

Here FM Exit s are :


EXIT_SAPLCJSS_002
EXIT_SAPLCJSS_003

Here Menu Exit

SAPLCJSS +CUD is used for the description to appear in the menu. +CUD acts as
Fcode (user command).
Here Screen Exit
SAPLXCN1 0300 - Here we add the screen elements.

Designing the Screen

Double click on 0205

Click on Continue
A screen will be created.
Give description

Select the screen type as SUBSCREEN Bcoz all screen exits will be
of type SUB-SCREENS

Click on Layout.
Drag and drop a text label and give name, text as NAME
Drag and drop a INPUT field and give name as V_NAME
Drag and drop another text label and give name, text as DATE
Drag and drop a INPUT field and give name as V_DATE
Change the format to DATS data type

Finally, the layout should look as below.

Click on flowlogic->activate it .
The Below fields need to be declared in the TOP Include file .
V_DATE, V_NAME .
Click on Display object list ICON

Function Group will be opened.

Expand XCN1
Expand Includes
Double click on TOP include file LXCN1TOP.

Now again double click on ZXCN1TOP.

Click on change button


Click on INSERT BUTTON

Write the Below Code.

Save it, activate it.


From the above steps, the custom screen is designed.

Now we need to write the logic to display the date/time


For the project.

Click on Back->back->back. Unitll the below screen is displayed.

Always we write the logic in FM exits.


Logic in Function Exits

Now we write the code in EXIT_SAPLCJSS_002 which will display


the DATE and NAME.

Double click on the Function exit EXIT_SAPLCJSS_002 and then


double click on the include ZXCN1U13.Create the include program.
Write the below logic

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

Menu Exit
Now to call this screen. We need Menu Exit.
Go back to the below screen.

Double click on the menu exit.

Give the text what you need on the Menu.


For My Requirement, I need Display NAME/DATE.

Now activate the Project.

Step5 : Test it

Now the output would be as below:


Because of Menu Exit, in the menu a new entry would appear (like Click Here) as shown below.

Now a new screen (i.e., our custom screen) would appear. Now the PBO Function exit would get
executed and shows the following Screen.

You might also like