Professional Documents
Culture Documents
Creating A BAdI Macro
Creating A BAdI Macro
Header Data
Released On
Release Status
Component
28.12.2011 09:47:45
Released for Customer
SCM-APO-FCS-MAC MacroBuilder
Symptom
As of SCM 5.0, it is possible to use BAdI macros instead of User Exit macros.
This note explains how to use BAdI macros.
Other Terms
/SAPAPO/SDP94, /SAPAPO/SNP94, /SAPAPO/TS_BATCH_RUN
/SAPAPO/ADVX_MACRO_CALCULATION
Class /SAPAPO/ADVX, method USER_EXIT_MACRO
Solution
You can create your own implementations of the BAdI /SAPAPO/ADVX,
method USER_EXIT_MACRO.
The BAdI macro is a substitute for the old User Exit(enhancement APODM005)
Caution:
Likewise with User Exit macros, there should be only ONE implementation of this BAdI method, with
different coding based on the macro's internal name (I_ADV_MACROID).
Otherwise all the implementations of the BAdI would be executed and this may give unexpected
results.
Proceed as follows to implement your BAdI Macro:
1. In the macroBuilder, create a macro of type BAdI. Save the macroBook.
2. In transaction SE18, create your BAdI implementation. Here below, as a reminder, steps how to
do this. For further information, please check the online documentation.
a) Display BAdI /SAPAPO/ADVX,
b) Push the <Create BAdI Implementation> button,
c) Next screen, push <create Enhancement Implementation>,
d) Enter the name of the implementation and a short text, then <enter> and <continue> until
the list of Enhancement Implementation is displayed again.
e) Choose the object created above and <Enter>
f) Enter the BAdI implementation name again as well as the description, and a name for the
implementing class.
g) Next screen <create> or <copy> as per your requirement and <save>.
Now you are taken to the BAdI Implementation screen.
h) Double click the implementing class then double click the method
(/SAPAPO/IF_EX_ADVX~USER_EXIT_MACRO) and enter in change mode to create your own code.
H i n t :
You can check the example class /SAPAPO/CL_EX_ADVX_EXAMPLE and its
method /SAPAPO/IF_EX_ADVX~USER_EXIT_MACRO to see how to extract the macro name and then write the
code corresponding to the macro name.
Validity
This document is not restricted to a software component or software component version
References
This document refers to:
SAP Notes
539797 Collective consulting note on macros
418801 Creating a user exit macro
412429 Defining jobs with macros