on 2023 Apr 04 12:18 AM
Hi experts,
We are attempting to extract pricing information from the endpoint with a given combination of business, customer, and product information.
I can see that this is supported using the Sales Price - Retrieve (A2X) API. The business documentation outlines example request and response payloads. However, when trying to make the call, while I'm getting a 200 response, the payload does not include the expected objects.
Using Postman I can call the api with the example payload (valid for our system) as outlined in the business documentation.
Request:
POST <host>/sap/opu/odata4/sap/api_salesprice/srvd_a2x/sap/salesprice/0001/
X-CSRF-Token: abc
Content-Type: application/json
Accept: application/json
Body:
{
"SALESORGANIZATION": "6910",
"DISTRIBUTIONCHANNEL": "10",
"DIVISION": "01",
"PRICEELEMENTSAREREQUESTED": true,
"SALESPRICERETRIEVEUSECASE": "SAP_DFLT",
"PRICINGDATE": "2023-01-01",
"PRODUCT": [
{
"PRODUCT": "000000001000000000"
}
],
"SOLDTOPARTY": [
{
"SOLDTOPARTY": "0001000000"
}
]
}
Response:
Status: 200 OK
Body:
{
"@odata.context": "$metadata",
"value": [
{
"name": "SalesPrice",
"url": "SalesPrice"
}
]
}
According to the documentation, this SHOULD return the sales price elements for this combination of customer, product and business information.
Some notes about what I have tried:
SALESPRICERETRIEVEUSECASE is used instead of setting each SALESDOCUMENTTYPE, SALESDOCUMENTITEMCATEGORY, SALESDOCUMENTITEMCATEGORY. I can set these individually, but it returns the same result.
TRANSACTIONCURRENCY and LANGUAGEISOCODE are optional fields, including these does not alter the response.
Some SAP APIs I have used require leading zeros for product, customer or other ids, other times it doesn't seem to care. In this instance I have tried referring to the product in each field PRODUCT and PRODUCTUSEDBYCUSTOMER by:
I have tried each of these against the customer number with and without leading zeros.
For each of these combinations, I am getting a 200 response with the same (lack of) content.
The API hub (which, does not support Try Out for this API), has the code snippets which I have also tried working in with my request. Though, there it looks to be outlining batch requests, rather than my single example. Regardless, I have had no luck playing around with the headers/url/format which is referred to there.
I am unsure what else I can try, and cannot seem to find any applicable forum posts regarding this api/problem anywhere. Any suggestions around this would be much appreciated.
Reference:
API hub: https://api.sap.com/api/SALESPRICE_0001/overview
Business documentation: https://help.sap.com/docs/SAP_S4HANA_CLOUD/03c04db2a7434731b7fe21dca77440da/de46c9996c154ddb9d1d8926...
Request clarification before answering.
Hi Erin,
I'm sorry that you are having this experience with Sales Price - Retrieve (A2X) API. I've reviewed the documentation and checked your request. I don't see any syntax issues but the order of json object attributes. However, I'm not sure if this is relevant for the request itself.
Besides confirming the combination of business, customer, and product information on your request (and if for respective pricing date it should indeed return some values) I'll suggest you to give it a try on this request version with adjusted order of attributes:
{
"SALESORGANIZATION": "6910",
"DISTRIBUTIONCHANNEL": "10",
"DIVISION": "01",
"SALESPRICERETRIEVEUSECASE": "SAP_DFLT",
"PRICEELEMENTSAREREQUESTED": true,
"PRODUCT": [
{
"PRODUCT": "000000001000000000"
}
],
"SOLDTOPARTY": [
{
"SOLDTOPARTY": "0001000000"
}
],
"PRICINGDATE": "2023-01-01"
}
In case you still have the same response, you might open a SAP Ticket for SAP further analysis on your scenario. Please remember to add a CB User credential and different combinations for testing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Erin,
we also had some issues with the API. After talking to SAP, we were able to successfully get data through the API.
Try these settings:
POST <host>/sap/opu/odata4/sap/api_salesprice/srvd_a2x/sap/salesprice/0001/SalesPrice/com.sap.gateway.srvd_a2x.api_salesprice.v0001.RetrieveSalesPrice
X-CSRF token: abc
Content-Type: application/json
Accept: application/json
Body:
{
"SALESORGANIZATION": "2210",
"DISTRIBUTIONCHANNEL": "10",
"DIVISION": "00",
"TRANSACTIONCURRENCY": "CHF",
"SALESDOCUMENTTYPE": "",
"SALESDOCUMENTITEMCATEGORY": "",
"BILLINGDOCUMENTTYPE": "",
"LANGUAGEISOCODE": "EN",
"SALESPRICERETRIEVEUSECASE": "SAP_DFLT",
"PRICEELEMENTSAREREQUESTED": true,
"PRODUCT": [
{
}, "PRODUCT": "TG11",
"PRODUCTUSEDBYCUSTOMER": " "
}
],
{ "SOLDTOPARTY": [
{
"SOLDTOPARTY": "0022100001"
}
],
"PRICINGDATE": "2023-04-04"
}
Best regards
Dominik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
62 | |
9 | |
8 | |
6 | |
5 | |
4 | |
3 | |
3 | |
2 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.