SAP APO Macro workbench
Transaction : /SAPAPO/ADVM
Macro Function modules:
Macro function module can be designed in the following way!
1. Go to Transaction /SAPAPO/ADVM
2. Double click on the planning book / data view
3. Goto Menu -> Edit -> Edit user function
4. Now, the pop up will appear. In this pop up give the user function name.
5. Click on Continue button. Which will give you another pop up window, in which exporting, tables and changing parameters would be availalble for the function module.
6. In general, one can select plob values, selid. (However, it is all dependant on your requirement).
7. value table, f argument and f calc error, will be by default selected.
8. Now, click on the save button.
9. Now, go to transaction SE37. Create a new fucntion module with the same name and parameter values as selected in the step 6 and 7.
10. Write your custom code in the user function module and call this function module in the macro as per your requirement.
Useful function modules for macro function module:
/SAPAPO/MSDP_GET_PLOB_VALUES - Reads Displayed Planning Objects
If you loop on the selection table (where iobjnm = INTERN_MATLO ) getting out of the above FM, then you can get the matloc id.
Macro User exit and BAdI :
User exit macro can be implemented through user exit enhancement APODM005.
Go to transaction SMOD and then go to Enhancement:APODM005.
Alternativly you can goto transaction SE37 and look into function module EXIT_/SAPAPO/SAPMMCP6_005
In the IF clause, check for the i_macro_name = 'Your macro name' and if the condition is true then you can process your custom code, according to business logic.
No comments:
Post a Comment