You are on page 1of 13

Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

Documentation
For Extra new Fields
For only Semi finished Goods
In
Material Master (MM01/MM02/MM03)

Created by: Ravi Kiran Katta

LPC Group Confidential (Internal Purpose Only) Page 1 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

Development Objective:
This document provides the procedure for adding additional new fields to transaction
code’s MM01/MM02/MM03 under BASIC DATA 1 view.
These Fields are only available for material Type ZJRL i.e. Semi Finished Goods
only.

Procedure:
1. A custom table named ZMARA_EXTN_T created with the following workable fields.

2. Go to Transaction SPRO, Display IMG.


3. Go to Logistics-General à Material Master à Configuring the material master and execute
‘Create Program for Customized Sub screen’.

LPC Group Confidential (Internal Purpose Only) Page 2 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

4. From the Popup displayed. Create a function group : ZFG_MM.

5. Now Go to Object Navigator SE80 and open the created Function Group ZFG_MM.

LPC Group Confidential (Internal Purpose Only) Page 3 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

6. Create your own new custom screen in screen 0001. From the Layout of SE51 use the function
key F6 and add the fields of our custom dictionary table ZMARA_EXTN_T and create a
screen like below.
Note :- (Here, All the Screen Fields are kept invisible).

7. flow logic of screen 0001.

8. Code is as given below.


*----------------------------------------------------------------------*
***INCLUDE LZFG_MMO01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module disable_fields OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module disable_fields output.
data: id_mtart type mtart.
* import id_mtart from memory id 'ID_MTART'.
if sy-tcode eq 'MM01'.
get parameter id 'MTA' field rmmg1-mtart.
elseif sy-tcode eq 'MM02' or sy-tcode eq 'MM03'.
get parameter id 'MAT' field rmmg1-matnr.
select single mtart from mara

LPC Group Confidential (Internal Purpose Only) Page 4 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

into rmmg1-mtart
where matnr eq rmmg1-matnr.
endif.
if rmmg1-mtart eq 'ZJRL'.
if sy-tcode eq 'MM01' or sy-tcode eq 'MM02'.
loop at screen.
if screen-name eq 'EXTN_DATA' or
screen-name eq 'ZMARA_EXTN_T-ZWIMR' or
screen-name eq 'ZMARA_EXTN_T-ZGSM' or
screen-name eq 'ZMARA_EXTN_T-ZWIDR' or
screen-name eq 'ZMARA_EXTN_T-ZDIAM' or
screen-name eq 'ZMARA_EXTN_T-ZPLY' or
screen-name eq 'ZMARA_EXTN_T-ZWTDR' or
screen-name eq 'ZMARA_EXTN_T-ZNSR' or
screen-name eq 'ZMARA_EXTN_T-ZKM' or
screen-name eq 'ZMARA_EXTN_T-ZRPT' or
screen-name eq 'ZMARA_EXTN_T-ZCORE' or
screen-name eq 'ZMARA_EXTN_T-ZREWIN' or
screen-name eq 'ZMARA_EXTN_T-ZPACK' or
screen-name eq 'ZMARA_EXTN_T-ZBDISK' or
screen-name eq 'ZMARA_EXTN_T-ZWIDSR'.
screen-active = '1'.
screen-input = '1'.
screen-invisible = '0'.
endif.
modify screen.
endloop.
endif.

if sy-tcode eq 'MM03'.
loop at screen.
if screen-name eq 'EXTN_DATA' or
screen-name eq 'ZMARA_EXTN_T-ZWIMR' or
screen-name eq 'ZMARA_EXTN_T-ZGSM' or
screen-name eq 'ZMARA_EXTN_T-ZWIDR' or
screen-name eq 'ZMARA_EXTN_T-ZDIAM' or
screen-name eq 'ZMARA_EXTN_T-ZPLY' or
screen-name eq 'ZMARA_EXTN_T-ZWTDR' or
screen-name eq 'ZMARA_EXTN_T-ZNSR' or
screen-name eq 'ZMARA_EXTN_T-ZKM' or
screen-name eq 'ZMARA_EXTN_T-ZRPT' or
screen-name eq 'ZMARA_EXTN_T-ZCORE' or
screen-name eq 'ZMARA_EXTN_T-ZREWIN' or
screen-name eq 'ZMARA_EXTN_T-ZPACK' or
screen-name eq 'ZMARA_EXTN_T-ZBDISK' or
screen-name eq 'ZMARA_EXTN_T-ZWIDSR'.
screen-active = '1'.
screen-input = '0'.
screen-invisible = '0'.
endif.
modify screen.
endloop.
endif.

LPC Group Confidential (Internal Purpose Only) Page 5 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

endif.

endmodule. " disable_fields OUTPUT


*&---------------------------------------------------------------------*
*& Module DISPLAY_DATA OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
module display_data output.

data: w_zmara_extn_t type zmara_extn_t.


clear w_zmara_extn_t.
if sy-tcode eq 'MM03' or sy-tcode eq 'MM02'.
select single * from zmara_extn_t
into w_zmara_extn_t
where matnr eq rmmg1-matnr.

if sy-subrc eq 0.
zmara_extn_t = w_zmara_extn_t.
endif.
endif.

endmodule. " DISPLAY_DATA OUTPUT

*----------------------------------------------------------------------*
***INCLUDE LZFG_MMI01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Module export_Data INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*

*----------------------------------------------------------------------*
* MODULE export_data INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
module export_data input.
free memory id 'ZMARA_EXTN_T'.
export zmara_extn_t to memory id 'ZMARA_EXTN_T'.
endmodule. " export_Data INPUT

9. To include IMGMMI0X. Create a enhancement and add the code as below

LPC Group Confidential (Internal Purpose Only) Page 6 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

10. Save and activate all the parts.

11. Now go to transaction SPRO, Display IMG then go to Logistics-General à Material Master à
Configuring the material master and execute ‘Define Structure of Data Screens for Each Screen
Sequence’.

LPC Group Confidential (Internal Purpose Only) Page 7 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

12. Select the screen sequence 21 and double click on data screens folder from the left tree panel.

LPC Group Confidential (Internal Purpose Only) Page 8 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

13. Here select Basic data 1 and Double click on SubScreens.

LPC Group Confidential (Internal Purpose Only) Page 9 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

14. Add the Custom Created Sub Screen here as shown below. & Save the Modifications.

15. Now the final Step is to update the data in the Custom created table ZMARA_EXTN_T.
Write the following code to the Exit - EXIT_SAPLMGMU_001.

16. Save and Activate.

LPC Group Confidential (Internal Purpose Only) Page 10 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

Result:

1) Scenario 1. Go to MM01 à Create a Material of type ZFER(finished goods) and click enter.

You can see the fields are not visible under basic data 1 view

LPC Group Confidential (Internal Purpose Only) Page 11 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

Scenario 2.
Create a material of Type ZJRL.

As you can see fields are now available.

LPC Group Confidential (Internal Purpose Only) Page 12 of 13


Documentation For Extra new Fields for only Semi finished Goods In Material Master (MM01/MM02/MM03)

References: www.saptechnical.com

LPC Group Confidential (Internal Purpose Only) Page 13 of 13