Translate

Saturday, 18 August 2012

Custom Tab Enhancement in MM01/MM02/MM03

Description : Adding custom tab in Master Material Creation.

Go to Material Master Table (MARA)
Select append Structure, Then Create Structure, Then add your Own Fields,
Then Save Structure.

Goto SPRO->Logistics-general->Material Master->Configuring Material Master->
Create Program for Customized Subscreens
Create Function Group.
then Goto SE80 Tx, Enter the Function Group,
In Screens, Develop Screen with ur Append Structure.


Code: 

PROCESS BEFORE OUTPUT.
module disable_fields.
module get_data.
* Verarbeitung vor der Ausgabe
PROCESS AFTER INPUT.
module export_data.

Program: 
MODULE export_data INPUT.

EXPORT mara TO MEMORY ID 'ZMARA'.

ENDMODULE. " EXPORT_DATA INPUT

MODULE disable_fields OUTPUT.

IF sy-tcode = 'MM03'.
LOOP AT SCREEN.
screen-input = 0.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
ENDMODULE. "disable fields output.

MODULE get_data OUTPUT.
DATA: matnr TYPE matnr.

IF sy-tcode = 'MM01'.
LOOP AT SCREEN.
IF screen-name = 'TEMP' .
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDMODULE. " GET_DATA OUTPUT


Then Write User Exit:

Goto CMOD, Create Project,
Give Enhancement name MGA00001. and Goto Components,
Double Click on Functoion Exit, Double Click 4 or 5 times on Include,
then Write, 

IF SY-UCOMM = 'BU' OR SY-UCOMM = 'YES'.
IMPORT MARA TO MMARA FROM MEMORY ID 'ZMARA'.
IF SY-SUBRC = 0.
CMARA-FERTH = MMARA-FERTH. "like add ur own fields here
ENDIF.

Then Save and Activate.

Then Goto SPRO->Logistics-general->Material Master->Configuring Material Master->
Define Structure of Data Screens for Each Screen Sequence

Select Screen Sequence 21, then Click Data Screens
now Select basic data1, then click copy as, then create new tab
now select new tab, then click Subscreens,
You can create new entries or modify existing entries,
for example modifing,
select one entry, in program option , then add your function group to sapl. just remove MGD1 and add ur function group.
then add ur screen number in screens option. 

Then Check MM01/02/03.......

                       

No comments: