cancel
Showing results for 
Search instead for 
Did you mean: 

Updating PickList via ServiceLayer in batch request

0 Kudos
1,463

HI SAP experts

I have the following task: to update existing PickList by changing PickedQuantity and change BINLocation as well as create Delivery Notes for the orders on the PickList via ServiceLayer.

Hereby my request on POSTMAN :

As you can see : there is an error : "Internal error (-5002 occured)".

When i have copied the part responsible for PickList PATH and pasted to another POSTMAN window, after 4 attempts with the same error, fifth worked sucessfully (i can see updated PickList with PickedQuantity and BINLocation) :

What i'm doing wrong with the batch request ? And why Service Layer is not stable while executing the same request 4 times - fifth works fine without changing nothing ?

I'm using SAP BO ver 9.3 PL: 00. Batch boundary in the barch request header is fine.

Looking forward to your answer.

Regards

Kriss

Accepted Solutions (0)

Answers (3)

Answers (3)

0 Kudos

HI Alessandro

Here is my payload :

--batch_cce18d7a-e514-4105-a1c5-54a0240e8edc

Content-Type:multipart/mixed;boundary=changeset_ec27180b-97d4-4536-a8c9-e066f01e0d3b

--changeset_ec27180b-97d4-4536-a8c9-e066f01e0d3b

Content-Type: application/http

Content-Transfer-Encoding: binary

Content-ID: 1

POST /b1s/v1/PickListsService_UpdateReleasedAllocation

{"PickList": {"Absoluteentry":2410,"PickListsLines":[{"AbsoluteEntry":2410,"BaseObjectType": 17,"OrderEntry": 20662,"OrderRowID": 0, "LineNumber":0,"PickStatus": "ps_Released","PickedQuantity": 0,"PreviouslyReleasedQuantity": 1,"ReleasedQuantity": 1,"DocumentLinesBinAllocations":[{"BinAbsEntry":357,"Quantity":1,"BaseLineNumber":0},]}]}}

--changeset_ec27180b-97d4-4536-a8c9-e066f01e0d3b

Content-Type: application/http

Content-Transfer-Encoding: binary

Content-ID: 2

PATCH /b1s/v1/PickLists(2410)

{"PickListsLines":[{"LineNumber":0,"PickedQuantity":1,"DocumentLinesBinAllocations":[{"BinAbsEntry":357,"Quantity":1,"BaseLineNumber":0},]},]}

--changeset_ec27180b-97d4-4536-a8c9-e066f01e0d3b

Content-Type: application/http

Content-Transfer-Encoding: binary

Content-ID: 4

POST /b1s/v1/DeliveryNotes

{"CardCode":"100022","DocDate":"2019-09-11T12:06:29.867029+00:00","DocDueDate":"2019-09-11T12:06:29.86705+00:00","Comments":null,"DocumentLines":[{"BaseEntry":20662,"BaseType":17,"BaseLine":0,"ItemCode":null,"Quantity":1.0,"WarehouseCode":"BC","DocumentLinesBinAllocations":[{"BinAbsEntry":357,"Quantity":1.0}]}],"Remarks":null,"ContactPersonCode":0,"NumAtCard":null}

--changeset_ec27180b-97d4-4536-a8c9-e066f01e0d3b

Content-Type: application/http

Content-Transfer-Encoding: binary

Content-ID: 3

POST /b1s/v1/StockTransfers

{"DocDate":"2019-09-11T00:00:00","DueDate":"2019-09-11T00:00:00","StockTransferLines":[{"ItemCode":"Test ItemCode","Quantity":2.0,"FromWarehouseCode":"BC","WarehouseCode":"SP","StockTransferLinesBinAllocations":[{"BinActionType":"batFromWarehouse","BinAbsEntry":379,"Quantity":2.0},{"BinActionType":"batToWarehouse","BinAbsEntry":918,"Quantity":2.0}]}],"FromWarehouse":"BC","ToWarehouse":"SP"}

--changeset_ec27180b-97d4-4536-a8c9-e066f01e0d3b--

--batch_cce18d7a-e514-4105-a1c5-54a0240e8edc--

Hope it helps

Best

0 Kudos

Hi Krzysztof,

Thanks a lot for your quick replay and for sharing code, but in my scenario it doesn't work.

I try to ask you (and soon i will open a nwe thread):

my scenario:

  1. Picklist with Serial number and bin location
  2. Serial numbers assigned in Order
  3. Picklist with previous Picked Quantity.

I want to update Picked Quantity with new Quantity.

According to reference:

PUT PickLists(id)

PickList is a very special object. The exposed properties are not enough for Service Layer to finish a patch operation with 'PickListsLines'. In this way, use 'put' instead.

Example

i tried:

I tried also your batch solution, with same error.

I can add that is a conversion from a DI application and it's work without calling UpdateReleasedAllocation (and i think ( hope 🙂 )the same for service layer version).

Thank you for help.

0 Kudos

Hi kriss77,

it's been a long time from your post, but i try 🙂

i have same problem, can you copy/paste full payload?

A big hello.

Alessandro

0 Kudos

HI there

Because i could not find any solution anywhere , decided to learn on mistakes and trials : here is what i found :

solution is quite simple apparently , you have to perform

POST /b1s/v1/PickListsService_UpdateReleasedAllocation

action first which will change released values with BINAllocation on PickLists and then do the PATH, better to do it in changset request so failure to any of the request in changset will fail entire request.

I hope this will help somebody looking similar solution.

Best

Kriss