0% found this document useful (0 votes)
924 views53 pages

Ue Se Me

This document discusses how to add custom fields to the SAP CJI3 report. It involves: 1. Adding the custom fields to the RKPOS structure using the CI_RKPOS field exit and the COOMEP01 customer exit. 2. Adding the custom fields to the view V_TKALV so they are included in the CJI3 report's field catalog. 3. Adding required code to populate the custom fields in the EXIT_SAPLKAEP_001 exit. The enhancements will display the vendor number and name in the CJI3 report for goods receipt documents, in addition to invoices.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
924 views53 pages

Ue Se Me

This document discusses how to add custom fields to the SAP CJI3 report. It involves: 1. Adding the custom fields to the RKPOS structure using the CI_RKPOS field exit and the COOMEP01 customer exit. 2. Adding the custom fields to the view V_TKALV so they are included in the CJI3 report's field catalog. 3. Adding required code to populate the custom fields in the EXIT_SAPLKAEP_001 exit. The enhancements will display the vendor number and name in the CJI3 report for goods receipt documents, in addition to invoices.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 53

User Exits/Screen Exits/Menu Exits

• 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)

Printing Attachments Of Work Order Via IW32


By Archana Pawar, Infosys Technologies

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.

Manual printing of the attachments:


1. Go to IW32 and open the work order.

2. Select ‘services for object’.

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.

7. Below I have demonstrated this functionality.

Enhancement IW010018:

Function exit used for this object is ‘EXIT_SAPLCOIH_018’ and screen exit ‘SAPLXWOC’ shown
below.
Click here to continue..

Printing Attachments Of Work Order Via IW32


...Previous

Data declaration for the exits:

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 ‘ZXWOCTOP’ must be used for data declaration.


The internal tables being used in the function exit as well as in the screen exit must be
declared in this include.

Include ‘ZXWOCZZZ’ must be used to write any logic in the PBO and PAI of the screen.

Coding for Function exit:

We need to start with the function exit ‘EXIT_SAPLCOIH_018’.


1. Double click on include ‘ZXWOCU15’ and create it.

2. Create a function module and call it in this include.

 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.

 For that we need to use 2 tables, ‘SRGBTBREL’ and ‘SOOD’.

 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.

Click here to continue..

Printing Attachments Of Work Order Via IW32


...Previous

Coding for Screen exit:


1. Create a screen ‘0900’ in program ‘SAPLXWOC’, which is called in the program
‘SAPLCOIH’.

Create it as a subscreen type.

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

Printing Attachments Of Work Order Via IW32


...Previous

5. MODULE F_USER_COMMAND_0900_AFTER_LOOP witll check the sy-ucomm and print


the attachments.

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.

After that we need to download it on the local system using FM ‘GUI_DOWNLOAD’.

Then print the attachment using method ‘CL_GUI_FRONTEND_SERVICES=>EXECUTE’


with document path and ‘Print’ command.
The selected attachments will be printed.

Demo of printing attachments via IW32:

Now, let’s see how enhancement tab displays the attachment details.

1. Go to IW32. Open work order having attachments.

2. Go to enhancement tab, it will display attachment list.


3. Select the attachment and press ‘Print’ button.

4. It will display message at the bottom after download is completed.

5. Once downloading of the attachment is done, attachment is opened for printing and once
printed it is closed.

6. So, the required attachments are printed.

Adding Fields to CJI3 Report


By Md Faheem Ur Rahman, Sterling & Wilson Ltd

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

Adding Fields to CJI3 Report


...Previous

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

Double click on “Field catalog information”

And press push button “New Entries”.


Add the required fields as shown below.
Then select these entries and click on “Selection dependencies” as shown below :
Press on New Entries and create the following entries:

Now save the entries.

Click here to continue...

Adding Fields to CJI3 Report


...Previous

Step 3.

Add required code in “EXIT_SAPLKAEP_001”.

*&---------------------------------------------------------------------*
*& Include ZXKAEPU01
*&---------------------------------------------------------------------*
IF I_REP_OBJECT = 'PD'.

IF CS_RECORD-GKONT IS NOT INITIAL AND CS_RECORD-GKOAR = 'K'.

CS_RECORD-ZZLIFNR = CS_RECORD-GKONT.
CS_RECORD-ZZNAME1 = CS_RECORD-GKONT_KTXT.
ELSEIF CS_RECORD-EBELN IS NOT INITIAL.

SELECT SINGLE LIFNR FROM EKKO INTO CS_RECORD-ZZLIFNR


WHERE EBELN = CS_RECORD-EBELN.

IF SY-SUBRC = 0.

SELECT SINGLE NAME1 INTO CS_RECORD-ZZNAME1 FROM LFA1


WHERE LIFNR = CS_RECORD-ZZLIFNR.

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’.

And activate the enhancement as shown below.

Now we will check CJI3 Report.


Execute. Now go to change catalog you will find the added columns as shown below.
Now the O/P will be as shown below:
Screen Exit for Notification Header (TCode: IW21) and show the
custom fields in standard report for notifications (IW28,
IW29)
By Mohan Babu K J, IBM India

The user exit used is QQMA0001. Steps are given below.

Create a project YPM01 in CMOD transaction code.


2. Add the enhancement assignment QQMA0001 in the project.

3. Go to Components and double click on the screen 0100.

4. Before creating the customer fields in screen, create the fields in QMEL table of structure
CI_QMEL.

5. Then create the custom fields in screen 0100.

6. Open FM EXIT_SAPMIWO0_008 and create include ZXQQMU0. This FM is used to pass


the value from table to screen fields.
7. Open FM EXIT_SAPMIWO0_009 and create include ZXQQMU08. This FM is used to pass
the value from screen to structure to store the value in table.

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.

Click here to continue...

Screen Exit for Notification Header (TCode: IW21) and show the
custom fields in standard report for notifications (IW28,
IW29)
...Previous

10. Implement the BADI BADI_EAM_SINGLELEVEL_LIST, and in method FILL_ADD_FIELDS


write your logic to fill alv.
11. You can also add separate group using the method CHANGE_FIELD_CATALOG.

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

Automatically filling the field "payment terms" and disable the


same while creating PO using the transaction ME22N
By Phani Diwakar, YASH Technologies

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’.

Step1: Go to transaction CMOD to create the project.


Click on Create button and provide the meaningful description in the following screen.

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.

Now open the Layout editor by click on Layout button.


Select the contract number field from the table EKKO (Add the field contract number to the
structure ‘CI_EKKODB’).

Save and activate.

Step4: Go back to ‘Flow logic’ and write the following code in POV (Process on Value-Request)
to get the F4 help.

Click here to continue....

Automatically filling the field "payment terms" and disable the


same while creating PO using the transaction ME22N
...Previous

Write the following code for getting F4 help as shown below.


TABLES ekko.
DATA: fs_return TYPE ddshretval,
it_return LIKE TABLE OF fs_return.
DATA: BEGIN OF fs_value,
vendorno TYPE lifnr,
contractno TYPE bbp_er_ctr_no,
cstart TYPE vbdat_veda,
cend TYPE vndat_veda,
pterm TYPE dzterm,
END OF fs_value,
it_value LIKE TABLE OF fs_value.
DATA: w_lifnr TYPE lifnr.
FIELD-SYMBOLS : <fs_ekko> TYPE ekko.
ASSIGN ('(SAPLMEPO)EKKO') TO <fs_ekko>.
IF sy-subrc EQ 0.
MOVE <fs_ekko>-lifnr TO w_lifnr.
ENDIF.
SELECT vendorno
contractno
con_start_dt
con_end_dt
payment_terms
FROM zcontract
INTO TABLE it_value
WHERE vendorno EQ w_lifnr.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'CONTRACTNO'
* DYNPPROG = ' '
* DYNPNR = ' '
* DYNPROFIELD = ' '
value_org = 'S'
* IMPORTING
* USER_RESET =
TABLES
value_tab = it_value
return_tab = it_return
EXCEPTIONS
parameter_error = 1
no_values_found = 2
OTHERS = 3
.
IF sy-subrc EQ 0.
READ TABLE it_return INTO fs_return INDEX 1.
IF sy-subrc EQ 0.
ASSIGN ('(SAPLMEPO)EKKO') TO <fs_ekko>.
MOVE :fs_return-fieldval TO ekko-contractno,
ekko-contractno TO <fs_ekko>-contractno.
READ TABLE it_value INTO fs_value WITH KEY contractno = ekko-
contractno.
IF sy-subrc EQ 0.
IF sy-subrc EQ 0.
MOVE fs_value-pterm TO <fs_ekko>-zterm.
ENDIF.
ENDIF.
ENDIF.
ENDIF.

Step5: Save and activate include.

When you execute the ME22N,

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.

FIELD-SYMBOLS: <fs_ekko> TYPE ekko,


<fs_fieldselection> TYPE MMPUR_FS.
ASSIGN ('(SAPLMEPO)EKKO') TO <fs_ekko>.
IF sy-subrc EQ 0.
IF <fs_ekko>-bsart EQ 'NB' AND
<fs_ekko>-contractno NE space.
READ TABLE my_fieldselection assigning <fs_fieldselection>
WITH KEY metafield = '11'.
IF sy-subrc EQ 0.
<fs_fieldselection>-fieldstatus = '*'.
ENDIF.
ENDIF.
ENDIF.

Step7: Now execute the transaction ME22N,

After selecting the contract number, the payment term field would be disabled.

Modifications to the SAP standard menu


By Sneha Latha

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.

Enter the program name MENUSYST.


Select the radio button Status and select the value MEN using F4.

Click on change. Following screen would be displayed:


Double-click on System. The menu is expanded.

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.

ZCOMPANY is the custom transaction code created for testing purpose.

Click here to continue...

Modifications to the SAP standard menu


...Previous

Now double-click on “ZCOMPANY”.

Set the function code to “T” in the following popup screen:


Save and activate.

Testing the scenario:

Come back to the main screen and click on “Test”

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:

Select the menu item to be deactivated and click on “Function Code”.


Following message is displayed:

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.

Working with Menu Exits


By Sasidhar Reddy Matli, Robert Bosch

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.


Click here to continue...

Working with Menu Exits


...Previous

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.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy