We know about mass changes.
We can change a field value from mass changes with the given value..
But some business logic needs one field value should be same as a another field.
Here with the help of some coding we can carry mass changes from one field to another field.
Jürgen Sir replied in this the exact procedure, which helps me a lot to make the document, its almost help me 90% to make this document.
A lots of thanks to Jürgen Sir.
Lets discuss about requirement and step by step procedure.
Suppose we have two fields in material master.
1. Reorder Point (MARC-MINBE)
2. Maximum Lot Size (MARC-BSTMA).
We have some value in field Maximum Lot Size (MARC-BSTMA)..
Here we can see we have a value only field Maximum Lot Size (MARC-BSTMA), bur we haven’t any value in Reorder Point (MARC-MINBE)
Now we have enter the value to Reorder Point (MARC-MINBE) field. But the condition will be that Value should be same as field Maximum Lot Size (MARC-BSTMA) with respective material.
It means for material TUPUCOZ5215, BSTMA value is 500, so the field value of MINBE will be also 500 for this material.
And also for material TUPUCOZ5216, BSTMA value is 600, so the field value of MINBE will be also 600 for this material.
Here we can change the value for field MINBE as respective to field BSTMA.
Use t-code MASS (you can use MM17 directly for material mass changes)
Use the Object Type as BUS1001
You can see the initial screen
Click on the tab Fields, and select the field MARC-MINBE and MARC-BSTMA
Now press Execute.
Give your all material with respective plant.
Then press execute.
You can see the initial screen appear for mass changes.
We can see our two fields Reorder Point and Maximum Lot size.
We can see we have some value in field Maximum Lot Size.
Now we have to fill out the field Reorder Point as copy from Maximum Lot Size with respective material.
Now Move your mouse pointer to Reorder Point, then click on Enter Formula/FORM Routines.
Press the option as shown in above figure or you can also find this from Application menu as shown as below screen.
Now you can see a pop-up will come which will be like below screen.
As we have to change the value for field Reorder Point, so we have to write a code for this field.
Now click on the ABAP which is right side of Reorder point.
Now the screen will be like below.
Its a ABAP FORM routine.
We have to just add our own logic here..
As we have to fetch the field value from field Maximum Lot Size (MARC-BSTMA), So we have write as like below screen shot.
As you can see I have just entered a line where X value will be as per value of BSTMA.
Don’t forget to give the dot (.)at the last of this line.
Then just press Ctrl+S or you can select Save from table as below screen shot.
After press save, you will see the back screen as shown below
Then press continue or enter.
You can see a text will come on the Reorder point field.
Now our coding part is done.
Now you have to deselect the Maximum Lot Size field. If you continue without deselect this field, then the field value for Maximum Lot Size will remove.
(Note : Press only one time on Carry Out Mass Changes, if you press twice on this option, then the value will remove)
Now we can see the result.
Our Reorder Point replaced with the same value as Maximum lot Size with respective material.
Now we can save our data.
Now you can see a success message like as below
Now our all data saved.
Lets check the MARC table and the value for Reorder Point and as well as Maximum Lot Size.
Here we can see our Reorder Point (MINBE) changed as per Maximum lot Size (BATMA) as per respective material.
Its not only for material master..
It will applicable for all mass changes.
Thanks and Regards