Ansicht
Dokumentation

BAPI_RPC_CALCULATE_PRICES - Request Calculations and Adjust Requested Calculations

BAPI_RPC_CALCULATE_PRICES - Request Calculations and Adjust Requested Calculations

CL_GUI_FRONTEND_SERVICES - Frontend Services   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This BAPI, or the CalculatePrices method in the RetailPricing business object, facilitates communication between the sales price calculation function of the SAP System and one or more external systems.

You can use this BAPI to request and adjust calculations in external systems:

  • Requesting a Pricing Item
Every pricing item required must be requested precisely once using this BAPI. Requesting a pricing item causes the system to suggest all the relevant pricing data (such as markup, margins and sales prices, for example).
  • Adjusting a Requested Pricing Item
If the pricing items requested do not meet your expectations - for example, if the sales price suggested by the system is either too high or too low, the pricing item can be adjusted using this BAPI.

Depending on whether a calculation is to be requested or whether a requested calculation is to be adjusted, the interface tables CALCITEMIN and CALCITEMINX can be filled in different ways. You will find further information on this in the documentation for the individual tables.

Results of the Calculation

Each time the BAPI is called up, the result of the calculation is entered in the CALCITEMOUT export table. Any errors that may have occured are displayed in the RETURN export table. You will find further information in the interface documentation for the relevant tables.

Customer-Specific Enhancements

Further fields that are not contained in the CALCITEMIN, CALCITEMINX or CALCITEMOUT interface tables can be entered using the enhancement tables EXTENSIONIN and EXTENSIONOUT and the BAPI. You can find further information on this in the interface documentation for the individual tables.

Example

A dialog for calculating store-specific sales prices is to be created in an external system. A store, a quantity of articles and a validity period for the calculation (required fields) are to be entered in an initial screen. The system should then suggest the appropriate pricing items in a subsequent screen. The suggested final price should be the same as the current valid final price.

The data entered in the initial screen should be transferred to the BAPI using table CALCITEMIN (see "Pricing key" below). For the final price to be suggested in the way described above, the VKERV field must contain the value "02". When the BAPI is called up this time, the CALCITEMINX table does not have to be filled as pricing items have only been requested. Once the BAPI has been called up, the calculations requested are to be found in the CALCITEMOUT export table.

Users should be able to enter the prices suggested on the subsequent screen interactively. After each change the changed pricing items should be adjusted (markup, margins, and so on).

To do this, the contents of the fields must be transferred to the CALCITEMIN table along with the pricing key. The changed fields are also to be marked in the CALCITEMINX table, using the pricing key to ensure that the items are unambiguously assigned. When the BAPI is called up, the adjusted pricing items are displayed in the CALCITEMOUT export table.

Notes

Pricing key

Pricing items are identified using the logical key:

  • Sales_Org
  • Distr_Chan
  • Plant
  • Price_List
  • Material
  • Sales_Unit
  • Sales_Unit_ISO.

Certain fields have to be filled, depending on the level at which the calculation is to be performed. You will find details of this in the interface documentation on table CALCITEMIN.

Initialization

Every time you call module BAPI_RPC_CALCULATE_PRICES, a series of data is saved and adjusted in the main memory of different function groups in the receiving SAP system. You can use module BAPI_RPC_REFRESH_CALCULATIONS to keep the calling system independent of the inner status of the function groups mentioned above. For more details, see the documentation on the individual modules.

Further information





Parameters

CALCITEMIN
CALCITEMINX
CALCITEMOUT
EXTENSIONIN
EXTENSIONOUT
RETURN
RPCCONTROLIN

Exceptions

Function Group

WVK8

PERFORM Short Reference   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 5334 Date: 20240523 Time: 155449     sap01-206 ( 94 ms )