Ue Se Me
Ue Se Me
• Adding a field to "Sales Org View2" of MM01/MM02 (No screen exit/BaDI available) (More
details) NEW
• Printing Attachments Of Work Order Via IW32 (More details) NEW
• Adding Fields to CJI3 Report (More details) NEW
• Screen Exit for Notification Header (TCode: IW21) and show the custom fields in standard
report for notifications (IW28, IW29) (More details)
• Automatically filling the field "Payment Terms" and disable the same while creating PO using
the transaction ME22N (More details)
• Modifications to the SAP standard menu (More details)
• Working with Menu Exits (More details)
• Adding custom fields to the transaction CS01,CS02 and CS03 (Bill of Materials) (More
details)
• Adding custom fields to the Purchase Order transaction ME22N (More details)
• Implementing Screen Exits for the transaction MIGO (More details)
• Implementing Screen Exit for the transaction CO01 (More details)
• Changing the description of the standard SAP fields (More details)
• Implementing Screen Exit in "CJ01" (More details)
• Adding a custom screen in XD01(More details)
• Implementing Screen Exit for MM01/MM02/MM03 (More details)
• How to implement a screen exit to a SAP Standard transaction (More details)
• Finding user exits using a TCode (More details)
• Working with User Exits (More details)
• Implementing Field Exit for the transaction MK01 (More details)
• Adding custom fields using EEWB Transaction (More details)
Scenario:
• Business requirement is to display all the attachments related to work order and print the
selected attachments via tcode IW32.
• This can be done manually from IW32, but it requires lot of efforts as each time required
attachment needs to be opened and printed. So, it’s a time consuming procedure.
• So, in this tutorial we demonstrate how we can achieve this using custom functionality
using Enhancement.
3. Select attachment list, it will display the attachments for the work order.
4. In current scenario, for printing the attachments, user have to follow the above procedure, open
the document and then print it. Every time, user must to open the document manually and then
print it.
5. So, the procedure becomes time consuming and also involves lots of efforts.
6. In order to achieve this functionality, I have used Enhancement IW010018 to display all the
attachments related to work order and we can print as all the attachments at the same time.
Enhancement IW010018:
Function exit used for this object is ‘EXIT_SAPLCOIH_018’ and screen exit ‘SAPLXWOC’ shown
below.
Click here to continue..
We are using function pool ‘SAPLXWOC’ to create the custom Subscreen and to write logic for
populating the table control and printing the attachments.
Include ‘ZXWOCZZZ’ must be used to write any logic in the PBO and PAI of the screen.
We have CAUFVD structure available in this Function exit. Based on the work order number
(CAUFVD-AUFNR), Equipment number (CAUFVD-EQUNR), functional location (CAUFVD-
TPLNR), task lists (CAUFVD-PLNTY, CAUFVD-PLNNR, CAUFVD-PLNAL) we can fetch the
related attachment names.
Table SRGBTBREL will fetch the unique identification number for each attachment (INSTID_B).
Using this number, we can fetch attachment name and its details.
Below is the screenshot of the data fetching from these 2 tables. Internal table I_OBJECTS, will
be populated with the attachment details. We can take the desired fields from the internal table
into new internal table I_WORK and pass it to screen exit.
So, I_WORK will be populated with the details of the attachments of the work order.
2. Go to layout and create a table control, which will display the list of attachments.
Create a pushbutton to print the selected attachments. Function code for pushbutton
should be ‘ENT1’. No other function code works for the pushbutton in the
enhancement tab.
3. Now, go to flow logic tab and in PBO of the screen, write a logic to to fill the table cotrol. We
will use the internal table (I_WORK) populated in the function exit.
Loop at the internal table I_WORK and populate the table control (ZATTACHMENT).
In tcode IW32, when we goto enhancement tab, the list of attachment present for that order
will be displayed. Then, user can select the attachments to be printed and press ‘Print’ button.
So, we need to check the selected entries and print them, this logic will be written in PAI of
the screen.
4. Below is the screenshot of the coding for PAI, Module STATUS_0900. It will fetch the
selected attachments.
Click here to continue..
For printing the attahcments, we need to read the contents of the attachment using FM
‘SO_DOCUMENT_READ_API1' into internal table.
We need to pass the unique identification number for the attachment (I_WORK-INSTID_B) to
the FM and fetch the contents of the attachment into internal table ‘I_TAB_OBJCONTX’.
6. We are using class ‘CL_GUI_FRONTEND_SERVICES’ to get the attachment path and
to print them.
So , we need to call
METHOD ‘CL_GUI_FRONTEND_SERVICES=>GET_SAPGUI_WORKDIR’ to fetch the
path/name of the attachment.
If attachment is of URL type, then this FM will give us the full path of the attachment
else if attachment is of external type, then name of the attachment will be fetched.
Now, let’s see how enhancement tab displays the attachment details.
5. Once downloading of the attachment is done, attachment is opened for printing and once
printed it is closed.
Target Readers: SAP ABAP developers with basic knowledge of Customer Exits and Basic
ABAP syntaxes.
Purpose of the document: To add Vendor No and Vendor Name in report CJI3.
In CJI3 Vendor name will come for only invoices, when offsetting account type(GKONT) is K, but
for GRN documents system will not show the vendor no, so to get this we need to add two fields
Vendor No(LIFNR) and Name(NAME1) in CJI3 report where report should give Vendor details for
GRN documents also.
Enhancement Process:
1. Add fields to structure “RKPOS” using field exit “CI_RKPOS” using Customer exit
“COOMEP01”.
2. Add fields to the view “V_TKALV”, so that these fields should get added to the field
catalog of CJI3 report.
3. Add required code in the exit “EXIT_SAPLKAEP_001”
Step 1.
Goto CMOD and Create a Project.
Goto Enhancement Assignment and add “COOMEP01” and double click on include “CI_RKPOS”.
Add customer required fields as shown below:
Click here to continue...
Step 2:
Now we need to add the above fields in the field catalog of CJI3 .
For that we need to maintain View V_TKALV. Goto SM34, enter V_TKALV and Press Maintain
button
Step 3.
*&---------------------------------------------------------------------*
*& Include ZXKAEPU01
*&---------------------------------------------------------------------*
IF I_REP_OBJECT = 'PD'.
CS_RECORD-ZZLIFNR = CS_RECORD-GKONT.
CS_RECORD-ZZNAME1 = CS_RECORD-GKONT_KTXT.
ELSEIF CS_RECORD-EBELN IS NOT INITIAL.
IF SY-SUBRC = 0.
ENDIF.
ENDIF.
ENDIF.
I_REP_OBJECT specifies which report you are using, so as to avoid unnecessary selection we
need to keep the required value only. For CJI3 report the value for I_REP_OBJECT is ‘PD’.
4. Before creating the customer fields in screen, create the fields in QMEL table of structure
CI_QMEL.
8. Activate the project. Now go to IW21 and see the custom fields. Functional consultant will do
the configuration where to show these fields.
9. Now we can see how we can get these values in the standard report for notification. The
transaction codes are IW28 and IW29.
Screen Exit for Notification Header (TCode: IW21) and show the
custom fields in standard report for notifications (IW28,
IW29)
...Previous
Now run tcode IW28 and execute. If you are not finding the custom fields, then choose Settings-
>Layouts->Current.
13. You can view your group in the filter. Choose the custom fields from that.
14. Now you can view the fields in ALV
The requirement is to capture contract number wise payment terms while creating PO. This
contract number is maintained in Z-Table along with vendor and payment terms etc. When we
select the contract number the corresponding payment terms should automatically reflect in
payment terms irrespective of the original value and make that field display mode immediately.
To add the contract number in the standard PO , we have to enhance the screen using the exit
‘MM06E005’.
Step2: Now click on’ Enhancement assignments’ button to add the PO enhancement.
Step3: Now click on ‘Component’ button and activate the project.
Double click on screen ‘0101’. Then it opens screen painter to add the contract number.
Step4: Go back to ‘Flow logic’ and write the following code in POV (Process on Value-Request)
to get the F4 help.
When we select the contract number ‘9001’, the automatically the payment term field is filled with
‘0001’ as shown.
Now it is in enable mode. We have to make it to display mode.
We can achieve this by enhance the method FS_GET in the method PBO of the class
CL_BASIC_MODEL_VIEW_MM (Write the enhancement spot in the method FS_GET).
Step6: Now create the enhancement spot in the method ‘FS_GET’ and write the following code
as shown.
After selecting the contract number, the payment term field would be disabled.
Scenario:
You would like to include the link to your company intranet portal or the end user manual in all the
SAP transactions for making it easier to the end-users.
Pre-requisites:
Create a transaction which navigates to the required portal or the end user manual as required.
Procedure:
Go to transaction SE41.
Now you can add your own menu items here. Please note that the change would reflect in all the
transactions this is being used.
Select the position where you would like to include your custom menu-item and do the right-click.
Now select “Insert entry” from the context menu.
Enter the custom menu-item as required.
You can observe that the new custom menu item is part of the standard menu (as shown below):
We can even have sub-menu as well (see the screenshot below):
We can also deactivate any of the menu-items as required. To do this:
Now the menu would look as follows (you can observe that the function “Own Jobs” is
deactivated):
You can activate the function by clicking on “Function Code” again.
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.
Example: Adding custom menu options for the standard transaction MC94.
Identify the menu exit from the standard transaction, i.e. through SMOD.
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.
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 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.
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.
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.