SAP Knowledge Base Article - Public

2614934 - Batch operation returns error: "The request count exceeds the maximum request count allowed : 180" - OData API

Symptom

SuccessFactors OData API response throws the error message below during a $batch operation:

<code>BadRequestException</code>
<message lang="en-US">The request count exceeds the maximum request count allowed : 180</message>

Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.

Environment

  • SAP SuccessFactors HXM Suite
    • OData API

Cause

This is the expected behavior from the system.

There is a limit on the number of requests you can send in your batch operation. You can only send 180 requests. If that is exceeded, the error occurs.

What exactly is a request in the batch operation?

Let's take the payload below as an example:

--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Type: application/http
Content-Transfer-Encoding:binary
GET User('admin')?$format=json HTTP/1.1
Content-Type: application/atom+xml;type=entry

--batch_36522ad7-fc75-4b56-8c71-56071383e77b
Content-Length: 100
Content-Type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 
Content-Transfer-Encoding: binary
Content-Type: application/http
POST upsert HTTP/1.1
Content-Type: application/json;charset=utf-8
accept:application/json
{
"__metadata": {
"uri": "User('content1')"
},
"username": "content1",
"password": "content1",
"hireDate": "/Date(978307200000)/",
"status": "active",
"userId": "content1",
"firstName": "content1",
"lastName": "helloterry@abc.com",
"department": "test",
"timeZone": "PST",
"hr": {
"__metadata": {
"uri": "User('admin')"
}
},
"manager": {
"__metadata": {
"uri": "User('admin')"
}
}
}
--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621 
Content-Transfer-Encoding: binary
Content-Type: application/http
POST User('content1') HTTP/1.1
Content-Type: application/json;charset=utf-8
X-HTTP-METHOD: MERGE
{
"manager": {
"__metadata": {
"uri": "User('admin')"
}
}
}
--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621--

--batch_36522ad7-fc75-4b56-8c71-56071383e77b--

Here, we can see that this payload is sending 3 requests only:

  • GET User...
  • POST upsert...
  • POST User...

So this payload won't fail with the error.

Each one of these requests will count to the limitation of 180 requests. If it reaches a number greater than 180, the error will occur.

Resolution

Please review the payload of your batch call and make sure it is sending less than 180 requests.

See Also

Batch Operations | SAP Help Portal

Keywords

$batch, batch, 180, requests, 400, BadRequestException, The request count exceeds the maximum request count allowed : 180 , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem

Product

SAP SuccessFactors HCM Suite all versions