
If the enrichments executed by the sequences in standard Customizing do not fit your specific business needs, you have the following options:
Create a new enrichment sequence with customer-specific logic
Replace a single step within a sequence of individual steps with a customer-specific function or add a new individual step to calculate a customer-specific new key figure (requires changing the data model)
Create a customer-specific ALL_STEPS sequence
Recommendation
Do not create new purposes. The purposes in standard Customizing should be sufficient.
Do not change the function types, functions, sequences in standard Customizing.
If you need to adjust the enrichment, create new sequences. If necessary, create new functions and function types.
If the overall logic of the enrichment meets your requirements, but you want to reduce the number of calculated key figures or calculate one or more key figures in a slightly different way, you can create a new enrichment sequence. To reduce the number of key figures, add the enrichment steps you need to your new sequence and skip the ones you do not need. Activate your new sequence in Customizing.
If you want to calculate one or more key figures in a slightly different way, check how the standard logic works:
If the customer-specific algorithm you need works with the same input/output, do the following:
Add all steps of the standard enrichment sequence that meet your business requirements to your sequence.
Create a stored procedure for the key figure you want to calculate differently and make the system call your procedure instead of the standard one.
Implement the Business Add-In BAdI: Stored Procedures in Data Enrichment and return the name of your stored procedure.
If the customer-specific algorithm you need requires a different input, do the following:
Add all of the steps in the standard enrichment sequence that meet your business requirements to your own sequence.
Create a new function for an existing function type.
Create an ABAP class that implements the interface /DDF/IF_FES_ENRICHMENT. Let the class inherit from /DDF/CL_ENR if the helper methods defined there seem beneficial to you. However, you can also call the helper methods without inheriting from this class.
Assign the name of your class to your new function in the Customizing activity Define Functions under Function Class Name.
Create a customer-specific stored procedure that implements the algorithm you need.
In the EXECUTE method of your ABAP class, enter the code to call this stored procedure.
Add your new function to your enrichment sequence at the place where it fits.
The wrapper class of the sales data enrichment calls the EXECUTE method of your class at the place in the sequence that you have defined in Customizing.
If you need to calculate enriched key figures in a completely different way, you can do the following:
Create a new sequence with one single step.
Create a customer-specific function of function type ALL_STEPS.
Add your function to your sequence.
Create an ABAP class for your function as described above.
Assign the name of your class to your function as described above.
Add the coding logic you need to the EXECUTE method of the ABAP class. You can call one or more customer-specific stored procedures, you can do processing in ABAP, or whatever fits your business requirements.
Recommendation
SAP recommends to keep the wrapper class for any of the enrichment purposes (Sales Data Enrichment or Stock Data Enrichment) by a customer-specific class. If you have to create your own wrapper class, create a class that implements interface /DDF/IF_FES_WRAPPER and enter it as wrapper class on purpose level. You are then responsible to set up the complete orchestration of the corresponding enrichment yourself.