I still see a lot of misunderstandings about updating tables on several forums. There are even people doing direct table updates. Which for me is a case to get fired.
While doing updates on tables there are bapi’s avalaible for almost every table.
How to find a BAPI for Particular transaction?
For example we want to create some material in the material master.
-First execute transaction: MM01 to create the material master record.
-Go to: <<< System >> <<< Status >>>
- Then double click on the field transaction
- In the next screen double click on Package You will get the following screen:
Within the transaction BAPI you can find the right BAPI’s available via the previous spotted Application Component. It was LO-MD-MM.
The application component was LO-MD-MM, when clicking the object names. you will see the application component. The object names Material, RetailMaterial and StandardMaterial, all have an application component LO-MD-MM.
When clicking on the Methods under the object names you will find the BAPI available. Make sure that the Release status is Released.
I have now found the BAPI_MATERIAL_SAVEDAT. When I double click on the BAPI name, I am entering the BAPI and can read the ‘FUNCTION MODULE DOCUMENTATION’.
How can this BAPI update Custom fields?
Up to now we only have found the BAPI which we can use. I now will demonstrate how it works with updating some Custom field (ZZFields). I am assuming that you will find your way in filling all the other structures.
Good luck with it!