tmannais
14th March 2019, 05:20
I am confident that there must be a standard dll function for getting the default price for an item in Sales Order Line (and maybe other places) given every other data such as Business Partner, Quantity, and everything else it needs to know in order to calculate discount and/or promotion.
The question is what is it and how can I use it?

bdittmar
14th March 2019, 10:05
I am confident that there must be a standard dll function for getting the default price for an item in Sales Order Line (and maybe other places) given every other data such as Business Partner, Quantity, and everything else it needs to know in order to calculate discount and/or promotion.
The question is what is it and how can I use it?

Hello,
have a look at :

Library tdslsdll0017

Sales - Integration with Pricing

(22 Functions available)


Regards

tmannais
14th March 2019, 10:17
I don't have the standard source code.
How can I check what you suggested?

tmannais
14th March 2019, 11:31
I used ttstpbaandoc to generate the Library Document out and looked through the page, but I still don't know which one to use.

I think this is the closest function that I would like to try.

tdsls.dll0017.retrieve.sales.order.line.price.discounts
void tdsls.dll0017.retrieve.sales.order.line.price.discounts( domain tdpcg.prds i.apply.price.disc.both, boolean i.update.uef, boolean i.update.pcf, boolean i.delete.manual.discount, domain tcorno i.orno, domain tccono i.cono, domain tcpono i.cpon, domain tccwoc i.ccof, domain tcitem i.item, domain tcuef.effn i.effn, domain tccpva i.cpva, domain tccom.bpid i.ofbp, domain tccom.bpid i.stbp, domain tcmcs.cpcl i.cpcl, domain tcmcs.cpln i.cpln, domain tcmcs.cmnf i.cmnf, domain tcdate i.odat, domain tcdate i.ddta, domain tcqsl1 i.qoor, domain tcqsl1 i.qoor.org, domain tccuni i.cuqs, domain tcconv i.cvqs )

Expl.: The purpose of this function is to retrieve the price and
discounts for a sales order line.
After call of this function the global pricing variables are
filled.
Pre: Sales Order Header & Line are present
Post: N.A.
Input: Sales Order Line Attributes (tdsls401):
i.orno -> Order number
i.cono -> Contract
i.cpon -> Contract position
i.ccof -> Contract Sales Office
i.item -> Item
i.effn -> Effective Unit |#201421.n
i.cpva -> Product Variant
i.ofbp -> Sold-to BP
i.stbp -> Ship-to BP
i.cpcl -> Product class
i.cpln -> Product Line
i.cmnf -> Manufacturer
i.odat -> Order Date
i.ddta -> Planned Delivery Date
i.qoor -> Order quantity
i.qoor.org -> Original Order Quantity
i.cuqs -> Order Unit
i.cvqs -> Order Unit conversion factor
i.apply.price.disc.both -> Recalculate price, discount or both
|#201421.sn
i.update.uef -> Update table in UEF (Effectivity Unit)?
Prices can be retrieved from UEF with or
without updating(re-calculation) of price
dependent UEF tables. If the argument has value
true, UEF table is updated, else(false) UEF
table is read.
|#201421.en
|#800-140971.sn
i.update.pcf -> Update tables in PCF (product variants)?
Prices can be retrieved from PCF with or
without updating(re-calculation) of price
dependent PCF tables. If the argument has value
true, PCF tables are updated, else(false) PCF
tables are read.
i.delete.manual.discount -> if manual discount must be deleted
or not. |#800-140971.en
Output: The global pricing variables are filled.
Return: N.A.

However, it is going to give output to the "global pricing variables", which I have no clue of what they are and how to use them.
Please give me some advice.

tmannais
14th March 2019, 12:21
I found another interesting function but this one is even more confusing to use because its explanation is so minimal.

tdpcg.dll0001.retrieve.price.and.discounts
long tdpcg.dll0001.retrieve.price.and.discounts( domain tdpcg.tyor i.type.of.order, domain tcorno i.number, domain tccono i.contract, domain tcpono i.contract.position, domain tccwoc i.contract.office, domain tcitem i.item, domain tcyesno i.subcontracted, domain tcuef.effn i.effectivity.unit, domain tccpva i.product.variant, domain tcguid i.specification, domain tccom.bpid i.buy.sell.bp, domain tccom.bpid i.ship.bp, domain tccom.bpid i.pricing.bp, domain tcmcs.cpcl i.product.class, domain tcmcs.cpln i.product.line, domain tcmcs.cmnf i.manufacturer, domain tcdate i.order.date, domain tcdate i.planned.delivery.date, domain tcqsl1 i.order.quantity, domain tcqsl1 i.original.order.quantity, domain tcqsl1 i.price.group.quantity, domain tccuni i.quantity.unit, domain tcconv i.quan.unit.conv.factor, boolean i.delete.manual.discount, boolean i.delete.pricebook.discount, domain tdpcg.prds i.apply.price.disc.both, domain tdpcg.prpc i.price.percentage, boolean i.update.uef, boolean i.update.pcf, domain tcncmp i.financial.company, domain tcccur i.transaction.currency, ref domain tcratc i.rate(), ref domain tcratf i.rate.factor(), domain tcdate i.rate.date, domain tcrtyp i.rate.type, domain tdpcg.prit i.price.type, domain tcorno i.production.order, domain tcorno i.maintenance.work.order, domain tcorno i.service.order, ref domain tccuni io.price.unit, ref domain tcconv io.price.unit.conv.factor, ref domain tcpric io.price, ref domain tcperc io.percentage, ref boolean o.derived.item.used, ref domain tdpcg.prbk o.price.book, ref domain tdgen.porg io.price.origin, ref domain tdpcg.made o.price.matrix.definition, ref domain tdpcg.prse o.price.matrix.sequence, ref domain tdpcg.maty io.disc.matrix.type(), ref domain tdgen.dorg io.discount.origin(), ref domain tdpcg.made io.disc.matrix.definition() fixed, ref domain tdpcg.prse io.disc.matrix.sequence(), ref domain tcdisc io.discount.percentage(), ref domain tddiam io.discount.amount(), ref domain tccdsc io.discount.code() fixed, ref domain tddmth io.discount.method(), ref domain tdpcg.dssc io.discount.schedule() fixed, ref domain tcyesno io.determining, ref domain tcyesno io.eligible )

Expl.: This method is a performance layer around
retrieve.price.and.discounts function.

Can anyone suggest me on how to properly use this?

martin.f
1st July 2021, 18:07
Has anyone an idea what the global pricing variables are?
I think
tdsls.dll0017.retrieve.sales.order.line.price.discounts goes in the right direction. However, Like in the explanation above I do not know what the global pricing variables are.
I need to determine via dll the discount of a sales order line.

Regards
Martin