Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhancement in transaction MM01/03

Former Member
0 Kudos

Hi Experts,

I have a requirement, where i need to change field values before saving into database.

In MM01 transaction, i have to prefix material as MM_.While saving into database it should remove that prefix.

ex:if i am entering material as MM_XYZ,it should save as XYZ in database.

Thanks in Advance.

31 REPLIES 31

arindam_m
Active Contributor
0 Kudos

Hi,

There are other two User exits for MM01. Check these:

MGA00002 Material Master(Industry)Number Assignment.

MGA00003 Material Master (Industry and Retail)Number Display.

Cheers,

Arindam

Former Member
0 Kudos

Hi arindam,

Now while displaying in mm03 transaction,i want t display as MM_XYZ .

what i should do?is der any badi??or any customer exit.

Former Member
0 Kudos

is this for Material Code or Material Description.

for this kind of requirement I suppose you need to use implicit enhancement

after the material data is read modify the display variable.

and on click of save again modify the variable with implicit enhancement.

Former Member
0 Kudos

Hi,

it is for material description.I guess there are some badi's or customer exit to do the  enhancement.

I just want to track MAKT table as changing or exporting parameter in any of badi or customer exit

0 Kudos

Hi Nikhil,

Please go for a BADI in your case,

As it should be displayed in everywhere, MM01 / MM02 / MM03.

So you need to implement a BADI.

Check the below document to find a relevant badi for your case.

http://scn.sap.com/docs/DOC-33611

Hope this helps.

Former Member
0 Kudos

Hi Nikhil,

Please put a break point on line 20,

  exit_name in class cl_exithandler method 'get_instance' . This would give you all the required exits.

Reagrds,

DN.

Former Member
0 Kudos

Have you considered changing the Conversion routine on DD Matnr?  I think that I'd look for an Implicit Enhancement location there...

Neal

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Nikhil,

I guess you can use BADI BADI_MATN1,

There are 4 methods in this interface

MATN1_INPUT_001Number Conversion Input Start
MATN1_INPUT_002Number Conversion Input Finish
MATN1_OUTPUT_001Number Conversion Output Start
MATN1_OUTPUT_002Number Conversion Output Finish

implement the input method to change the material number from MM_XYZ to XYZ

implement the output method to change the material number from XYZ to MM_XYZ

correct me if i am wrong.

Regards,

Charlie

Former Member
0 Kudos

hello Nikhil

you can do this

LOOP AT IT_TAB.

SHIFT IT-TAB-FIELD BY 3 PLACES LEFT.

MODIFY IT_TAB.

ENDLOOP.

THANKS

Former Member
0 Kudos

Hi Nikhil,

For Tracking MAKT Table use this BADI_MATERIAL_CHECK with method "CHECK_DATA" .

METHOD if_ex_badi_material_check~check_data.

   

DATA : ls_text TYPE short_desc.

 

READ TABLE stext INTO ls_text INDEX 1.

 

IF sy-subrc EQ 0.

  ................

ENDIF


ENDMETHOD.

Regard's

Smruti

0 Kudos

Hi experts,

I am Not able to trace material description,

Can any one know where can i trace this.

0 Kudos

Hi smruti,

I want to track makt table in transaction mm03 while displaying material details.

thanks in advance

0 Kudos

Hi Nikhil,

i don't what is ur actual requirement but i sure you can track MAKT Table using below BADI  for T-Code MM01/MM02 and  MM03 T-code display the Material Master Record you can't edit any field value at run time .Put Break point and Check is it track or Not .

BADI_MATERIAL_CHECK

METHOD IF_EX_BADI_MATERIAL_CHECK~CHECK_DATA.

  DATA : ls_makt TYPE makt,

            ls_text TYPE short_desc.

 

IF  SY-TCODE EQ 'MM02' OR SY-TCODE EQ 'MM01'.

BREAK-POINT.

  SELECT SINGLE *

              FROM makt

              INTO ls_makt

              WHERE matnr EQ wmara-matnr AND

               spras EQ 'EN'.

 

READ TABLE stext INTO ls_text INDEX 1.

 

IF sy-subrc EQ 0.

 

*  Your Enhancement Code or MAKT-MAKTX Field Track .

   

ENDIF .

   

ENDIF.

ENDMETHOD.

Regard's

Smruti

0 Kudos

HI Smruti,

I will explain you my requirement in simple way,

When i go to tcode mm02,i will enter material, suppose 14326,

I should add prefix to as mm_ to the material description.and when i do some changes and save it again it should save without that prefix.

Hope you got my requirement.

thank you,

0 Kudos

Ok Nikhil  , Can you check with below BADI , It's working fine as per your above requirement . Implement this BADI Using SE19 T-code and put Break-Point , and try to Change stext  field value which MAKT-MAKTX without writing any custom code , first check with manually(i.e. debug mode) , then you write ur Custom Code .

BADI Nmae : BADI_MATERIAL_CHECK

Method Name :  CHECK_DATA

Regard's

Smruti

0 Kudos

When i enter material number in mm02,

BADI_MATERIAL_CHECK will not get call.it will get cal while saving.

ECM_EXIT,BADI_MATERIAL_OD,GOS_SRV_SELECT

These three badi's are getting call,so i just want to track material description.

0 Kudos

Hi Nikhil,

the basic data screen in MM is from program SAPLMGD1 screen 1002. In the PBO of this screen, you can create an implicit enhancement to append MM_ to mast-maktx. And in PAI of this same screen, you can create one mor eimplicit enhancement to remove MM_ from maktx.

Thanks & Regards,
Swarna

0 Kudos

Hi Swarna,

I know this is the last option left,

But i just want to implement this using exit/badi.

Thanks You.

0 Kudos

Hi,

I am not sure but I think, any change using BADis result in database save.

Regards,

Swarna

0 Kudos

Hi swarna,

How can i achieve implicit enhancement.

i mean in which module(program SAPLMGD1 screen 1002) can i do????

0 Kudos

Hi,

I cant exactly say , place it in a particular module. But as this logic doesn't require any checks you can try keeping in last module available in that PBO/ PAI. PBO to concatenate MM_ and PAI to remove MM_ logic

Regards,

Swarna

0 Kudos

Here's the problem.  Do you want to see this prefix on any screen that displays material description.  The current suggestion requires you to change the PBO (and I think the PAI) of every single screen that displays the field.  Is that acceptable?

Neal

Former Member
0 Kudos

Try using BADI_MATERIAL_REF

It has C_MAKT that is a changing parameter.

raymond_giuseppi
Active Contributor
0 Kudos

Your requirement matches exactly the definition of conversion exit, so look at domain MATNR conversion exit, you should easily find the BAdI (already mentionned byMGA00003)

If that don't solve your problem, could you elaborate on, your exact requirement ?

Regards,

Raymond

0 Kudos

Hi Raymond,

My requirement is to display material description prefixing with MM_ in tcode mm03 .

I want to track makt-maktx.

Thanks & Regards,

NIkhil H

0 Kudos

Check for the BADI in the way Which I mentioned earlier.

Hope that solves your problem.

0 Kudos

If it is only in MM03, look for implicit enhancement in PBO and PAI of the subscreens containing this field like 1001, 1002, ... 1005 etc.

if it should also be executed in other programs, change the domain of the data element and create a domain with conversion-exit that add a prefix "MM_" during output, and remove it during input . But that would be a modification and requires a sscr key, and must be managed during upgrade and SP installation.

Can you elaborate on the purpose of this requirement (except shortening the field length for 3 characters)

Regards,

Raymond

0 Kudos

Hi Raymond,

I have fulfild the requirement by doing implicit enhancement while prefixinh MM_ for material descrition ,and I got one badi to remove MM_ while saving in the database.

Actually my requirement is to use any exit/badi.but  i could  find any of this .

so finally i did implicit enhancement In PBO  1002 subscreen.

thank You

0 Kudos

Hi Nikhil,

Can you Share that BADI Name ? "I got one badi to remove MM_"

Regard's

Smruti

0 Kudos

Hi Smruti,

The same one what you have suggested,

BADI_MATERIAL_CHECK.

Thanks & Regards,

NIkhil H