Symptom
How can the Overall Customer Discount Percentage maintained for a specific customer account be retrieved using web services in SAP Business ByDesign?
Environment
SAP Business ByDesign
Cause
Currently, there is no web service available that directly returns the Overall Customer Discount Percentage for a specific customer account.
Resolution
Use the following web services to identify the Overall Customer Discount list for a customer.
1. Identify the Overall Customer Discount List
Use QuerySalesPriceListIn (Query Price Lists) to find the discount list associated with the customer.
Specify the following in the request:
TypeCode: 7PL1 - Overall Customer Discount
PriceSpecificationElementPropertyID: CND_BUYER_ID
PriceSpecificationElementPropertyValue: The relevant customer account ID
Example Request:
<n0:SalesPriceListFindByTypeCodeAndPropertyIDAndPropertyValueQuery_sync
xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
<SalesPriceList>
<TypeCode>7PL1</TypeCode>
<PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation1>
<IdentifyingIndicator>true</IdentifyingIndicator>
<PriceSpecificationElementPropertyReference>
<PriceSpecificationElementPropertyID>CND_BUYER_ID</PriceSpecificationElementPropertyID>
</PriceSpecificationElementPropertyReference>
<PriceSpecificationElementPropertyValue>
<ID>MC9785</ID>
</PriceSpecificationElementPropertyValue>
</PriceSpecificationPropertyValuationPriceSpecificationElementPropertyValuation1>
</SalesPriceList>
</n0:SalesPriceListFindByTypeCodeAndPropertyIDAndPropertyValueQuery_sync>
In this example, MC9785 is the customer account ID. Replace it with the relevant customer ID.
The response gives the matching discount list and provides header-level information, such as its ID, UUID, type code, status, currency, validity period, and administrative details.
2. Retrieve the Discount List Details
Use ManageSalesPriceListIn (Manage Price Lists) to retrieve the details of the discount list.
Pass the returned list ID or UUID in the request.
Example Request:
<glob:SalesPriceListFindByIDQuery_sync
xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
<SalesPriceList>
<UUID></UUID>
<ID>REPLACE_WITH_RETURNED_DISCOUNT_LIST_ID</ID>
</SalesPriceList>
</glob:SalesPriceListFindByIDQuery_sync>
Replace REPLACE_WITH_RETURNED_DISCOUNT_LIST_ID with the ID or UUID returned by the first service.
Review the response to find the discount percentage. The following from the response of a discount list tells you that discount is for example 5 %.
<Percent>-5.0</Percent>
Note: The first service identifies the relevant discount list; it does not directly return the Overall Customer Discount Percentage. The actual percentage must be determined from the detailed discount information returned by the second service.
Keywords
Overall Customer Discount, Customer Discount Percentage, Percentage, QuerySalesPriceListIn, ManageSalesPriceListIn, Sales Price List, Discount List, TypeCode, 7PL1, CND_BUYER_ID, Customer ID; Account ID, Price List, Discount, Web Services , KBA , SRD-CRM-ORD , Orders & Contracts , Problem
SAP Knowledge Base Article - Public