cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with InventoryCountings (B1 Service Layer)

sap-chris
Explorer
0 Kudos

Hi Everyone

We've a problem with Service Layer (B1 V10.0 FP2105).

Our goal is to load a presaved inventory counting list trough service layer and show them in our application to the employees. They count the items and save the counted quantity trough service layer back to SAP.
The problem we are faced is that when we load the presaved inventory list, we can’t get the lines with the items we have to count. “InventoryCountingLines” is always 0.

We tried it on two different SAP Systems (both V10.0 FP2105) and with different presaved inventory lists. We also tried it with different user, including admin user. Always the same problem.

Any Idea how we can solve this issue and get the information about the items in a inventory counting who have to be counted?

{
   "odata.metadata" : "https://sap-server:50000/b1s/v1/$metadata#InventoryCountings",
   "value" : [
      {
         "DocumentEntry" : 419,
         "DocumentNumber" : 419,
         "Series" : 51,
         "CountDate" : "2022-11-18",
         "CountTime" : "14:23:00",
         "SingleCounterType" : "ctUser",
         "SingleCounterID" : 9,
         "DocumentStatus" : "cdsOpen",
         "Remarks" : null,
         "Reference2" : null,
         "BranchID" : null,
         "DocObjectCodeEx" : "1470000065",
         "FinancialPeriod" : 138,
         "PeriodIndicator" : "Standard",
         "CountingType" : "ctSingleCounter",
         "AttachmentEntry" : null,
         "YearEndDate" : null,
         "TeamCounters" : [],
         "IndividualCounters" : [],
-------> "InventoryCountingLines" : [], 
         "InventoryCountingDocumentReferencesCollection" : []
      }
   ]
}
View Entire Topic
0 Kudos

TL;DR;

EDIT with response: If you send just the LineNumber (Instead of ItemCode and WarehouseCode) and the CountedQuantity, it works!! 🙂

Hello folks, related to that question, what is the right way to update the values on the array?.

I'm trying to do something like that

PATCH /b1s/v1/InventoryCountings(1)<br><br>{         <br>    "InventoryCountingLines": [
        {  "ItemCode": "AG-35",  "CountedQuantity": 1.0,  "WarehouseCode": "01"  }                     

    ]
}

But I receive this error:

{<br>  "error": {<br>  "code": -5002,<br>  "message": {<br>  "lang": "en-us",<br>  "value": "1470000411 - Item AG-35 in warehouse 01 has already been added to current document [INC1.ItemCode][line: 5934]"<br>  }<br>  }<br>}

I suppose that it's interpreting that i want to update the entire array, which is not the case. Any help on that?