Pricing Programs and Their Logic For Debugging Help
Pricing Programs and Their Logic For Debugging Help
Pricing Programs and Their Logic For Debugging Help
Function PRICING
1. Form KONDITIONSVORSTEP (LV61AA12)
build KOMT1 (pricing procedure, relevant condition types including their characteristics)
If something is incorrect in standard pricing types you have to check it here. Internal table STEU
contains the attributes of pricing types and shows at what circumstances a condition is
redetermined.
Customer specic pricing types are defined in the User Exit.
pricing worktable TKOMV (pricing worktable that contains information of all items) is filled if
necessary
perform xkomv_aufbauen_pruefen
if sy-subrc eq 0 => Condition will be redetermined
userexit_xkomv_bewerten_init
LOOP
loop at xkomv.
perform konditionsbasis_ermitteln
calculate XKOMV-KAWRT
if xkomv-kofra ne 0.
if preisfindungsart ne E
lf pricing type = E nothing will be done while running PRICING, no calculation, but formulas
will be run (without changing XKOMV)
This part of the coding is only run if pricing type = E. XKOMV will not be changed even if the
values within this formula have been changed.
xkomv = rettkomv. (rettkomv includes the values before running the formula)
if xkomv-kofrs ne 0.
perform xkomv_kwert_ermitteln.
calculate XKOMV-KWERT
currency conversation
* recalculate komp-netpr
KOMP~NETPR is calculated
Only the last price of the pricing procedure will be active => Note 836243
userexit_xkomv_bewerten_end
perform konditionsausschluss
read customizing of condition exclusion groups
Subtotals (lines in XKOMV without condition types) are not appended to TKOMV
Function PRICING_COMPLETE
All items will be calculated again depending on pricing type. Check preisfindungsart_kopf if you need
to know which pricing run will be triggered
LOOP AT tkomp.
Depending on the pricing type the necessary function modules are called. The standard
pricing is done again, normally there is only a calculation.
No condition records will be redetermined.
LOOP AT gkomz.
PRlClNG_COMPLETE is only called while going to Header conditions or while saving a document
(Due to performance issues). It might happen that item values are changing again aer saving the
doucment or going to Header conditions.
Function PRICING_COPY
Each and every condition of the referenced document is copied from KONV table into XKOMV of the
new document. If necessary the conditions are xed (XKOMV_KSTEU).
pricing type is set in eld MODE at this part of the coding. You can check each time if MODE
contains the correct value as it is set in the copy control
userexit_pricing_copy
In this user exit it is possible to change everything in XKOMV. Here it is possible to change
KSTEU if a special condition should be recalculated again
If the quantity has been changed while copying the conditions, the value will be adjusted
arbfeld = xkomvkwert * quantity_new / quantity_old.
At the end of this function XKOMV will be copied to HKOMV and then HKOMV will be copied to
TKOMV. TKOMV is used in function module PRICING