Ansicht
Dokumentation
PRCG_DOC_ITEM_CONDIT - Define Alt. Calculation of Condition Amount in Document Item
rdisp/max_wprun_time - Maximum work process run time General Material DataThis documentation is copyright by SAP AG.
This Business Add-In (BAdI) is used in the Pricing and Conditions(SD-BF-PR) component. You can use this BAdI to define alternative calculations for amount-related fields in the document item that are used for price elements. Amount-related fields can be, for example, the condition amount or the condition base value.
The method CHANGE_CONDITION_AMOUNT allows you to adjust different attributes and amounts of the document item. In addition, the method supports different attributes of the price element that triggers the execution of the Business Add-In.
Importing Parameters
- ITEM_AMOUNTS
- Provides calculated amounts of a document item, like the net amount, net price, tax amount, and so on.
- ITEM_ATTRIBUTES
- Contains several attributes of the document for which pricing is executed. For example, the sales organization, sold-to party, or the sales document category can be accessed.
- ITEM_DATES
- The pricing date of the document item is transferred to the method.
- ITEM_QUANTITIES
- Weights, volumes, and quantities associated with the document item can be read using this parameter. For example, the ordered quantity or the document items' net weight are retrieved from this parameter.
- PRCG_ELEMENT_ATTRIBUTES
- Data of the price element that triggers the method call is set to this parameter. For example, the condition type, the condition amount, or the condition calculation type are supported.
Changing Parameters
Note: The changeable attributes are initial when the BAdI method is executed and corresponding attributes must be calculated within the implementation. At the least, corresponding attributes of importing parameters must be assigned to the changeable attributes.
- ITEM_RESULT_AMOUNTS
- The parameter allows you to overwrite document item amounts, such as the subtotal amounts, or some buffer fields, such as the condition amount buffer Xworkd, which can be consumed in subsequent price elements of a pricing procedure.
- ITEM_RESULT_ATTRIBUTES
- The status of the difference for the customer-expected price and any error for the pricing calculation can be defined through these attributes.
- ITEM_RESULT_QUANTITIES
- You can set the time duration for condition amount calculation.
- PRCG_ELEMENT_RESULT_AMOUNTS
- Different attributes for a price element can be defined using this parameter. For example, you can set the condition amount, the condition base value, or the reason why the condition is inactive.
- PRICING_MESSAGE
- You can assign an error message text to this parameter, for example, to provide additional information about an error situation encountered during the calculation of the condition amount.
For more information about the standard settings (filters, single or multiple uses), see the Enhancement Spot Element Definitionstab in the BAdI Builder (transaction SE18).
- You implement logic for the BAdI and assign a unique filter value to it.
- Once you have implemented the BAdI, you must configure the following:
- In the Set Alternative Calculation of Condition Amount configuration activity, you assign a routine number to the process enhancement option Condition Amount (CONDITION_AMOUNT).
- In the same configuration activity, you assign for this routine number the filter value of the BAdI as the enhancement identifier (ID) for process enhancement option task Condition Amount in Document Item(CONDITION_ITEM_AMOUNT).
- In the Set Pricing Procedures configuration activity, you assign the routine number to your pricing procedures in the Routine for Alternative Calculation of Condition Amount(Alt. Calc. Cndn Amnt) field.
Caution: You should use the statement RAISE EXCEPTION only for critical business errors or programming runtime errors. This statement causes a pricing error and therefore might block the processing of business documents.
You can find an example implementation in the BAdI Builder on the Enhancement Spot Definitionstab in the Implementation Example Classessection.
The following example implementation is available: CL_PRCG_DOC_ITM_CNDN_AMT_EXMPL.
For information about implementing BAdIs as part of the enhancement framework, see SAP Library for SAP NetWeaver Platform on SAP Help Portal at http://help.sap.com/nw_platform. Choose a release and then Application Help. In SAP Library, choose SAP NetWeaver Library: Function-Oriented View -> Application Server -> Application Server ABAP -> Application Development on AS ABAP -> ABAP Customer Development -> Enhancement Framework.
PERFORM Short Reference Vendor Master (General Section)
This documentation is copyright by SAP AG.
Length: 5640 Date: 20240523 Time: 195401 sap01-206 ( 100 ms )