Ansicht
Dokumentation

PRCG_DOC_CONDITION_A - Define Alternative Calculation of Condition Amount in Document

PRCG_DOC_CONDITION_A - Define Alternative Calculation of Condition Amount in Document

BAL Application Log Documentation   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.
SAP E-Book

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 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. In addition, the method supports different attributes of the price element that triggers the execution of the Business Add-In.

Importing Parameters

  • DOC_ATTRIBUTES
Contains several attributes of the document for which pricing is executed. For example, the local currency or the document currency can be accessed.
  • DOC_DATES
The pricing date of the document is transferred to the method.
  • DOC_QUANTITIES
The volume associated with the document can be read using 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.

  • 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 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).

  1. You implement logic for the BAdI and assign a unique filter value to it.
  2. Once you have implemented the BAdI, you must configure the following:
    1. In the Set Alternative Calculation of Condition Amount configuration activity, you assign a routine number to the process enhancement option Condition Amount (CONDITION_AMOUNT).
    2. In the same configuration activity, you assign for this routine number the filter value of the BAdI as the enhancement identifier (ID) for the process enhancement option task Condition Amount in Document(DOCUMENT_CONDITION_AMOUNT).
    3. 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.

Recommendation:

  • To assure consistent calculation of the condition types, it may be necessary to additionally implement the BAdI Define Alternative Calculation of Condition Amount in Document Item(PRCG_DOC_ITEM_CONDITION_AMOUNT). You must assign both implementations to the same routine number in the activity Set Alternative Calculation of Condition Amount.
  • The use of a routine for the alternative calculation of the condition amount for subtotals on header level is not supported.

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_CNDN_AMT_EXAMPLE.

For information about implementing BAdIs as part of the enhancement framework, see SAP NetWeaver Platform on SAP Help Portal at http://help.sap.com/nw_platform. Choose a release and then under Application Help -> SAP NetWeaver Library: Function-Oriented View -> Application Server -> Application Server ABAP -> Application Development on AS ABAP -> ABAP Customer Development -> Enhancement Framework.






TXBHW - Original Tax Base Amount in Local Currency   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.

Length: 5271 Date: 20240523 Time: 220521     sap01-206 ( 97 ms )