05-10-2013 1:39 PM
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.
05-10-2013 1:43 PM
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
05-10-2013 2:13 PM
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.
05-10-2013 2:27 PM
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.
05-11-2013 6:00 AM
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
05-14-2013 10:04 AM
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.
05-10-2013 1:58 PM
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.
05-10-2013 2:55 PM
Have you considered changing the Conversion routine on DD Matnr? I think that I'd look for an Implicit Enhancement location there...
Neal
05-10-2013 3:05 PM
05-10-2013 3:24 PM
Hi Nikhil,
I guess you can use BADI BADI_MATN1,
There are 4 methods in this interface
MATN1_INPUT_001 | Number Conversion Input Start |
MATN1_INPUT_002 | Number Conversion Input Finish |
MATN1_OUTPUT_001 | Number Conversion Output Start |
MATN1_OUTPUT_002 | Number 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
05-11-2013 4:32 AM
hello Nikhil
you can do this
LOOP AT IT_TAB.
SHIFT IT-TAB-FIELD BY 3 PLACES LEFT.
MODIFY IT_TAB.
ENDLOOP.
THANKS
05-11-2013 7:22 AM
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
05-11-2013 8:33 AM
Hi experts,
I am Not able to trace material description,
Can any one know where can i trace this.
05-11-2013 10:56 AM
Hi smruti,
I want to track makt table in transaction mm03 while displaying material details.
thanks in advance
05-13-2013 3:59 AM
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
05-13-2013 6:52 AM
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,
05-13-2013 7:08 AM
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
05-13-2013 7:18 AM
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.
05-13-2013 7:32 AM
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
05-13-2013 7:37 AM
Hi Swarna,
I know this is the last option left,
But i just want to implement this using exit/badi.
Thanks You.
05-13-2013 7:46 AM
Hi,
I am not sure but I think, any change using BADis result in database save.
Regards,
Swarna
05-13-2013 10:04 AM
Hi swarna,
How can i achieve implicit enhancement.
i mean in which module(program SAPLMGD1 screen 1002) can i do????
05-13-2013 10:08 AM
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
05-13-2013 5:25 PM
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
05-11-2013 9:15 AM
Try using BADI_MATERIAL_REF
It has C_MAKT that is a changing parameter.
05-14-2013 7:37 AM
Your requirement matches exactly the definition of conversion exit, so look at domain MATNR conversion exit, you should easily find the BAdI (already mentionned by Charlie Cai) as well as good old customer-exits (SMOD enhancement MGA00003)
If that don't solve your problem, could you elaborate on, your exact requirement ?
Regards,
Raymond
05-14-2013 9:54 AM
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
05-14-2013 10:06 AM
Check for the BADI in the way Which I mentioned earlier.
Hope that solves your problem.
05-14-2013 11:51 AM
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
05-14-2013 12:26 PM
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
05-14-2013 1:14 PM
Hi Nikhil,
Can you Share that BADI Name ? "I got one badi to remove MM_"
Regard's
Smruti
05-14-2013 1:32 PM
Hi Smruti,
The same one what you have suggested,
BADI_MATERIAL_CHECK.
Thanks & Regards,
NIkhil H