Skip to Content

The LPP – last purchase price – solution was created due to a legal requirement in Brazil for Retail companies in stock transfer order process. In this scenario, the price of the last purchase must be taken as base for tax calculation. Therefore, the system will pick up the price of the last invoice entered.
For IPI there is no calculation for LPP.
If the condition is set to “statistics” in the tax procedure configuration, it will not update the LPP table


Formulas of the LPP:


  • Goods receipt:

New average = ( total stock * average from DB + tax amount ) / ( total stock + GR quantity)

  • Invoice verification:

New average = ( average from DB * ( total stock * convertion factor 1 / convertion factor 2 ) ) + tax value ) / total stock




The LPP can be used for ICMS, SubTrib and reimbursement conditions and it is activated via customizing, following the IMG path below:

  • SPRO > Financial Accounting > Financial Accounting Global Settings > Tax on Sales/Purchases > Basic Settings > Brazil > Define Tax Types.
  • Or via SM30, view J_1BAJ,
  • Or via J1BTAX > Condition Set Up > Tax Types


Fields and table info:


In the table J_1BLPP the data for LPP is stored. The key of the table contains the same key fields as the valuation data table MBEW and the ID for the             LPP. The information found in this table are:

  • J_1BLPPID – Identifies the LPP scenario. If only ICMS is involved, the ID is set to I and if SubTrib then ID is set to S.
  • J_1BLPPNET – Net amount of last Nota Fiscal.
  • J_1BLPPBRT – Gross amount of last Nota Fiscal .
  • J_1BICMSVAL – ICMS amount of last Nota Fiscal.
  • J_1BSUBTVAL – SubTrib amount of Last posted Nota Fiscal.
  • J_1BICMSAVR – Average ICMS amount over all LPP relevant Nota Fiscais.
  • J_1BSUBTAVR – Average SubTrib amount over all LPP relevant Nota Fiscais.
  • J_1BDOCREF – Shows the last document posted.


Some scenarios and outcomes examples:


  • Posting invoice receipt with ICM0 only.
    • This will not change J_1BLPP table.
  • Posting invoice receipt with ICM0 and ICMS ST.
    • This will update J_1BLPP table row of LPP ID ‘S’.
  • Posting invoice receipt with ICMS (other than ICM0).
    • This will update J_1BLPP table row of LPP ID ´I´.
  • Posting invoice receipt with ICMS (other than ICM0) + ICMS ST.
    • This will update J_1BLPP table row of LPP ID ‘S’.
  • Posting invoice receipt with ICMS + ICMS ST on the tax code but with value 0 (either one, or both conditions) in NF.
    • This will update J_1BLPP table row of LPP ID ‘S’.
  • Cancellation
    • If a document is cancel on the same day it was posted, the LPP table will be updated. IMPORTANT: if a document is posted in the meantime, the LPP table already has new values, so if you try to cancel after a new invoice is posted the LPP table will not be updated.


Debug Tips:


  • J_1B_LPP_CHECK – This function checks if conditions are activated for LPP calculation.
  • J_1B_LPP_GET_PRICE – info from J_1BLPP is picked up.
  • J_1B_LPP_CALCULATE – Calculation of LPP
  • J_1B_LPP_UPDATE – This function updates the data base table J_1BLPP with the new calculated LPP.
  • J_1B_LPP_GET_PRICE_FOR_UPDATE – The function fills the internal table, which passes to the update function. Also, it calls the enqueue function for LPP table.
  • J_1B_LPP_CANCEL – The function checks if for the cancellation the LPP should be updated on the data base. This is done when the cancel document is posted on the same day as the original one.
  • J_1B_CHECK_LPP_FOR_STO – This function will check whether the LPP should be pick up for the STO scenario.

See Also


  • 2317999 J_1BLPP Wrong Updated when ICMS and ICST are Equal Zero
  • 2314013 LPP Wrongly Updated During Goods Receipt Cancelation with STO
  • 2223869 LPP: Table improperly updated J_1BLPP when there several complementary purchase
  • 2245043 Values at J_1BLPP duplicated after creating a Credit Memo
  • 2233870 Error while updating J_1BLPP with condition ICST
  • 2230148 J_1BLPP is updated wrongly when PO has alternative UOM


Link to the Portuguese version of this post here.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply