cancel
Showing results for 
Search instead for 
Did you mean: 

api_warehouse_order_task_2

Glyba_Dmitrii
Discoverer
0 Kudos
396

Hello

I need to use API api_warehouse_order_task_2 for cancel task, I use request 

Glyba_1_0-1741944059807.png

In body I add this:

{
    "DirectWhseTaskConfIsAllowed": true
}
 
and have error back from SAP:
Glyba_1_1-1741944148845.png

HTTP request look like:

Glyba_1_2-1741944322520.png

What am I doing wrong?

Accepted Solutions (0)

Answers (3)

Answers (3)

Christian_Ries
Product and Topic Expert
Product and Topic Expert

Hi @Glyba_Dmitrii ,

this should work. Based on the data you provided, it is not clear to us why it does not work. Perhaps an incident might be best in this case, so we can have a look in detail.

Best regards,
Christian

Ajit_Routray
Active Contributor
0 Kudos

Hi @Glyba_Dmitrii ,

Could you please check below in WT/WO document, pass the correct resource in your SAP user and let us know any questions.

Reason for error: your assigned resource with your SAP (API)USER ID is not the same the assigned Resource of WO. 

1. Check the Warehouse Order document of Warehouse Task, is there any resource assigned ?

2. Assign the above resource into your Your SAP API USER. 

Screenshot 2025-03-19 at 11.23.02 AM.pngScreenshot 2025-03-19 at 11.15.30 AM.png

Kind Regards,

Ajit

Glyba_Dmitrii
Discoverer

Hi @Ajit_Routray, Thanks for answer and I know about this way and in documentation about this API we have this recomendation:

Glyba_Dmitrii_0-1742386101776.png

in https://help.sap.com/docs/SAP_S4HANA_CLOUD/c46da892efa14cea8347e9b872199d6f/a4dcec7056134b2fa9b311e5...

We can use unassignment. assignment, get and then post and I think the better will be use get and post 

 

Ajit_Routray
Active Contributor
0 Kudos

Hi Glyba_Dmitrii,

Thank you, One more addition- perhaps APIs are different based on different Product ( S/4 HANA On Primise, S/4 HANA CLoud Private,... etc )  . Please see the link for cancellation API onS/4 HANA On Primise EWM  .

https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/5aadd5aa0ed541e49b1e006d7e17919b/a4dcec7056134b2fa9b...

Kind Regards,

Ajit

 

Jerry_Lowery
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Glyba_1 ,

This API is part of 3W0 (Resource Management In Warehousing)

https://me.sap.com/processnavigator/SolS/EARL_SolS-013/2502/SolP/3W0?region=US

You are trying to Cancel the task, but the user has not signed on to the resource, I guess.

This is documented in the Best Practice description and in the Help:

https://help.sap.com/docs/SAP_S4HANA_CLOUD/c46da892efa14cea8347e9b872199d6f/a4dcec7056134b2fa9b311e5...

Are you using the IF Match (see the examples in the Help)

Thank you

Jerry

Glyba_Dmitrii
Discoverer
0 Kudos

Hi @Jerry_Lowery 

My user have resource in warehouse, but the warehouse order is not assigned to my resource.

I tried to use If-Match in this request, took it from the GET request in the ETag field and copied it into the POST request and after that received this answer:

Glyba_1_0-1742315914326.png

Then I find method in Abap that check this field with value "*" and with this value it's working but I have error with resource how i wrote in first message:

Glyba_1_0-1742316927171.png

 

 

Jerry_Lowery
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi, I have never used the "*" and would recommend against it - looking at the date code on your IF MATCH , it is from March 12. Usually you do the get and then immediately call the POST so it doesn't expire. According to the error, it is stale and the system did not find the match. I would recommend to call the GET and POST right after and see if it helps.
Glyba_Dmitrii
Discoverer
0 Kudos

Hi @Jerry_Lowery

Thanks for the answer.

I followed your recommendation and found a way to get the E-Tag from the Get request and use it in the POST request with parameter in body:

{
    "DirectWhseTaskConfIsAllowed": true
}

, but I got the same error:

Glyba_Dmitrii_0-1742340121518.png

 

Can i make something else with this situation?

 

Jerry_Lowery
Product and Topic Expert
Product and Topic Expert
0 Kudos
Could you post the full GET and POST payloads/headers? its hard to tell from the screenshot. - but your date code is from 3/14 so 5 days ago - it is difficult if you tested it recently or something else. its ok if you obscure the private info, but really its difficult without the remaining details or seeing the total flow. I checked my postman and haven't tried this Cancel operation so i would need to setup some test. Is it possible the WO is assigned to another user?