cancel
Showing results for 
Search instead for 
Did you mean: 

Get Item Price method with multiple unit of measures

cesidio_ludovisi
Explorer
0 Kudos

Hi all,

I have a question about the GetItemPrice Method in SAP B1 9.0 or 9.1.

They introduced the price lists with multiple unit of measures, so you can define prices for the same item on price list for multiple unit of measure.

Also you can define time and volume discounts for multiple unit of measure.

In this case, how can you get the right item price for the unit of measure you want?

The GetItemPrice Method gets 4 parameters : cardcode, itemcode, amount and date. What about the unit of measure??

How you can get the right item price via DI API?Is there any new method or service to do this?

Maybe an example could be more clear. Let's suppose that we have

Unit of measureQuantityDiscount %
UM1105
UM2155
UM3205

How can i tell to GetItemPrice to consider the Unit of Measure to detect the correct price?

This is an image of a sample configuration

Hope it's clear.

Accepted Solutions (1)

Accepted Solutions (1)

cesidio_ludovisi
Explorer
0 Kudos

Solved by myself.

There's the new company service using the new item prices interface.

Answers (2)

Answers (2)

dimantha747
Explorer
0 Kudos

Hi

can you please tell me what is the service ?

Regards

Dimantha

cesidio_ludovisi
Explorer
0 Kudos

Here my code

Public Function SAP_GetItemPriceWithUM(ByVal cardCode As String, ByVal itemCode As String, ByVal amount As Double, ByVal refDate As Date, ByVal currency As String, ByVal PriceListNum As Integer, ByVal UOMEntry As Integer, ByVal UOMEntryQty As Double, ByRef dblPrice As Double, ByRef dblDiscount As Double) As Boolean

        Dim params As SAPbobsCOM.ItemPriceParams

        Dim rtnParams As ItemPriceReturnParams

        Try

            params = oSAPB1Addon.oCompany.GetCompanyService.GetDataInterface(CompanyServiceDataInterfaces.csdiItemPriceParams)

            params.CardCode = cardCode

            params.ItemCode = itemCode

            params.UoMEntry = UOMEntry

            params.UoMQuantity = amount

            'params.InventoryQuantity = amount

            params.Currency = currency

            params.Date = refDate

            params.PriceList = PriceListNum

            rtnParams = oSAPB1Addon.oCompany.GetCompanyService.GetDataInterface(CompanyServiceDataInterfaces.csdiItemPriceReturnParams)

            rtnParams = oSAPB1Addon.oCompany.GetCompanyService.GetItemPrice(params)

            dblPrice = rtnParams.Price

            dblDiscount = rtnParams.Discount

            Return True

        Catch ex As System.Exception

            oSAPB1Addon.SBO_Application.MessageBox("[Utility.SAP_GetItemPriceWithUM][EXCEPTION]: " & ex.Message)

            Return False

        End Try

    End Function

pedro_magueija
Active Contributor
0 Kudos

Hi Cesidio,

Being an SDK method it would have to be SAP to change it. Perhaps open a ticket with SAP support since this can be classified as a missing but important functionality.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn