Advanced Pricing Without Edit Line Issue ( B4201500 Calculate Sales Price and Cost)

coolkl

Active Member
Hello Group,

I am using B4201500 Calculate Sales Price and Cost to retrieve price from Advanced Pricing. The Price is retrieved, but not the correct price. Issue is I pass the adjustment schedule. This schedule at Sequence 300 has List Prices i.e Prices for all Item like Base Price. At Sequence 340 we have Branch level prices. When this Business function executes it retrieves the price at Sequence 300. But actual valid price is at Sequence 340. If the List price Adjustment is expired it correctly picks the Branch Price.
Sales order Application correctly picks the Price at Seq 340, even though it finds a price first at Seq 300. So I am not sure whats missing in my mapping. Any idea, need some guidance.

0014 Calculate Sales Prices And Costs
VA rpt_PXszWorkStationId_JOBN -> BF szComputerID
VA rpt_PXmnJobNumber_JOBS -> BF mnJobNo
PO szPriceAdjustmentScheduleN -> BF szAdjustmentSchedule
VA evt_PXmnCustomerNumber_AN8 -> BF mnAddressNo
VA evt_PXmnCustomerNumber_AN8 -> BF mnShipToNo
VA evt_PXmnShortItem_ITM -> BF mnShortItemNo
VA evt_PXszCurrencyCode_CRCD -> BF szBaseCurrencyCode
VA evt_PXszCurrencyCode_CRCD -> BF szCustomerCurrencyCode
VA evt_PXmnUnitPrice_UPRC <- BF mnUnitPrice
VA evt_PXszCostCenter_MCU -> BF szBranchPlantDtl
"1.000" -> BF mnQtyOrdered
VA evt_PXszPricingUOM_UOM4 -> BF szTransactionUom
VA evt_PXszPricingUOM_UOM4 -> BF szPricingUom
SL DateToday -> BF jdPriceEffectiveDate
"1" X BF cSuppressWriteToWF
"1" -> BF cSuppressErrorMsg

I have reviewed the link as below.
http://www.jdelist.com/vb4/showthread.php/15997-Determining-Advanced-Pricing-without-F4211-Edit-Line
 

johndanter

Legendary Poster
What are you mapping into the CPGP DMCT etc?

Here's my BSFN that apparently works :)
I can't remember where in base E1 I lifted this sequence of base BSFNs and fetches from, but no one has complained about what it brings back....yet :)


Data Structure: D554108A - GTS Advanced Price DSTR
BF mnIdentifierShortItem [ITM]
BF szCostCenter [MCU]
BF mnAddressNumber [AN8]
BF mnQuantity [QTY]
BF szTransactionUOM [UOM]
BF szPricingUOM [UOM4]
BF jdDatePriceEffectiveDate [PEFJ]
BF mnPricePerUnitUPRC [UPRC]
BF mnAmountExtendedPriceAEXP [AEXP]
BF mnAmtListPricePerUnitLPRC [LPRC]
BF szAgreementNoDMCT [DMCT]
BF mnDifferenceMATH01 [MATH01]

=======

Event Level Variables
----------------------------------------
evt_LineTypeLNTY [LNTY]
evt_CompanyCO [CO]
evt_CurrencyCodeFromCRCD [CRCD]
evt_PriceAdjustmentScheduleASN [ASN]
evt_GroupCustomerPriceCPGP [CPGP]
----------------------------------------
00001 // Object Creation: John Danter 29/04/2014
00002 //
00003 // This BSFN will give back the various pirces an item may have on our system.
00004 // If Adv Prc is not setup the price is the base price
00005 //
00006 //
00007 // Setup defaults
00008 If BF szAgreementNoDMCT [DMCT] is less than or equal to <Blank>
00009 | BF szAgreementNoDMCT [DMCT] = "ANY"
00010 End If
00011 If BF szPricingUOM [UOM4] is less than or equal to <Blank>
00012 | BF szPricingUOM [UOM4] = "EA"
00013 End If
00014 If BF szTransactionUOM [UOM] is less than or equal to <Blank>
00015 | BF szTransactionUOM [UOM] = "EA"
00016 End If
00017 If BF mnQuantity [QTY] is equal to "0"
00018 | BF mnQuantity [QTY] = "1"
00019 End If
00020 If BF jdDatePriceEffectiveDate [PEFJ] is equal to Null Date
00021 | BF jdDatePriceEffectiveDate [PEFJ] = SL DateToday
00022 End If
00023 //
00024 //
00025 F4102.FetchSingle [Index 1: Branch, Item]
BF mnIdentifierShortItem [ITM] = TK Item Number - Short [ITM]
BF szCostCenter [MCU] = TK Business Unit [MCU]
VA evt_LineTypeLNTY [LNTY] <- TK Line Type [LNTY]
00026 //
00027 RetrieveCompanyFromBusUnit(B0000130.RetrieveCompanyFromBusUnit)
BF szCostCenter [MCU] -> szCostCenter [MCU0]
VA evt_CompanyCO [CO] <- szCompany [CO]
00028 //
00029 RetrieveCompanyCurrencyCode(B0000128.RetrieveCompanyCurrencyCode)
VA evt_CompanyCO [CO] -> szCompany [CO]
VA evt_CurrencyCodeFromCRCD [CRCD] <- szCurrencyCode [CRCD]
00030 //
00031 GetSoldToBillingInstructions(B4200100.GetSoldToBillingInstructions)
BF mnAddressNumber [AN8] -> mnSoldToAddress [AN8]
VA evt_PriceAdjustmentScheduleASN [ASN] <- szAdjustmentSchedule [ASN]
VA evt_GroupCustomerPriceCPGP [CPGP] <- szCustomerPricingGroup [CPGP]
00032 //
00033 //
00034 CalculateSalesPricesAndCosts(B4201500.CalculateSalesPricesAndCosts)
VA evt_PriceAdjustmentScheduleASN [ASN] -> szAdjustmentSchedule [ASN]
BF mnAddressNumber [AN8] -> mnAddressNo [AN8]
BF mnAddressNumber [AN8] -> mnShipToNo [SHAN]
BF mnIdentifierShortItem [ITM] -> mnShortItemNo [ITM]
VA evt_CurrencyCodeFromCRCD [CRCD] -> szBaseCurrencyCode [CRDC]
VA evt_CurrencyCodeFromCRCD [CRCD] -> szCustomerCurrencyCode [CRCD]
BF mnPricePerUnitUPRC [UPRC] <- mnUnitPrice [UPRC]
BF mnAmountExtendedPriceAEXP [AEXP] <- mnExtendedPrice [AEXP]
BF mnAmtListPricePerUnitLPRC [LPRC] <- mnListPrice [LPRC]
BF szCostCenter [MCU] -> szBranchPlantDtl [MCU]
VA evt_CompanyCO [CO] -> szCompany [CO]
BF mnQuantity [QTY] -> mnQtyShipped [SOQS]
"0" -> mnQtyBackOrdered [SOBK]
"0" -> mnQtyCanceled [SOCN]
BF mnQuantity [QTY] -> mnQtyOrdered [UORG]
BF szTransactionUOM [UOM] -> szTransactionUom [UOM]
BF szPricingUOM [UOM4] -> szPricingUom [UOM4]
BF jdDatePriceEffectiveDate [PEFJ] -> jdPriceEffectiveDate [PEFJ]
VA evt_GroupCustomerPriceCPGP [CPGP] -> szCustomerPricingGroup [PRGP]
"1" -> cSuppressWriteToWF [EV04]
"0" -> mnDiscountTrade [TRDC]
VA evt_LineTypeLNTY [LNTY] -> szLineType [LNTY]
BF szAgreementNoDMCT [DMCT] -> szAgreementNo [DMCT]
"1" -> cSuppressCostRetrieval [EV07]
00035 //
00036 //
00037 BF mnDifferenceMATH01 = [BF mnAmountExtendedPriceAEXP]-[BF mnAmtListPricePerUnitLPRC]
 
Last edited:

coolkl

Active Member
Thanks for the reply. We used Begin Doc Edit Line and then deleted the work file records and it has worked for us. I was using same BSFN as suggested, but didnot pass CPGP.
 
Top