Key users can implement Alternative Calculations or Pricing Requirements with Business Add-In (BAdI) in Pricing context and connect them to routine with a unique enhancement identifier. After the all this adaptations, The routine number can be used for setting custom calculations in the pricing procedure.
Creating Custom Logic
Go to Custom Logic app
You can create a new custom logic with Create button.
In the new implementation screen, there are 3 steps to complete the creation of a custom logic. Firstly, you should complete the choosing of Extension Point. You can filter them using by Business Context as a Pricing.
In this blog, the alternative calculation of condition amount in document item will be used for the example scenario. Also you can apply the same steps for header level calculation or requirements.
After choosing extension point, click Step 2 to continue with Implementation Attributes.
In the implementation attributes, you can add filter to connect routine to custom logic as below;
The filter pop-up will be displayed in the screen and click add button again to add filter condition;
You should enter a unique value for identifier and click save button as below;
After the completion the scope of custom logic, you should go to step 3 to set Implementation ID.
Review for New Implementation.
Click Create button and Publish the custom logic.
You can access the code editor by clicking Open Code Editor.
You can use the following code to compare subtotals and raise a message;
* Mandatory step for all implementations:
* Move the importing parameters to the changing parameters.
MOVE-CORRESPONDING item_amounts TO item_result_amounts.
MOVE-CORRESPONDING item_attributes TO item_result_attributes.
MOVE-CORRESPONDING item_quantities TO item_result_quantities.
MOVE-CORRESPONDING prcg_element_attributes TO prcg_element_result_amounts.
MOVE-CORRESPONDING active_price_amounts TO active_price_result_amounts.
IF item_amounts-subtotal4amount LT item_amounts-subtotal5amount.
* It is possible to raise a message.
pricing_message = 'Net amount cannot be less than calculated costs'.
* You can also set a pricing error if required.
item_result_attributes-pricinghaserror = abap_true.
ENDIF.
Setting Alternative Calculation
Go to Implementation Activities -> General Business Data -> Price Management -> Sales Pricing -> Setting for Pricing in Sales -> Set Alternative Calculation of Condition Amount (SSCUID 102430)
In the customizing screen, enter a routine number and description, then assign the enhancement identifier to routine number as below;
Assignment the enhancement Ids to Routine number
Finally, 3009999 numbered routine can be used in any pricing procedure.
References
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Subject | Kudos |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
User | Count |
---|---|
10 | |
5 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 |