cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Environment in BTP: Handling API Timeout for Long-Running Requests

reda_hamrani
Explorer
247

Hello SAP Community,

I have developed an ABAP program in the ABAP Environment on SAP BTP that calls an external API. The request works fine when the response time is short, but when the request takes longer, I get a timeout error:

"The operation was timeout."

I would like to know:

  1. Is it possible to increase the timeout duration for HTTP requests in the ABAP Environment on BTP?
  2. If so, how can I configure it properly?
  3. Are there alternative solutions to handle long-running API requests in ABAP?

Here is a simplified version of my HTTP request implementation:

 

 

   DATA(lo_destination) = cl_http_destination_provider=>create_by_url( c_api_endpoint ).
  DATA(lo_client) = cl_web_http_client_manager=>create_by_http_destination( lo_destination ).
....
DATA(lo_response) = lo_client->execute( i_method = if_web_http_client=>post ).

 

 

Any guidance or best practices would be greatly appreciated.

Thanks in advance!

SAP BTP, ABAP environment  API  

View Entire Topic
Ulrich_Schmidt
Product and Topic Expert
Product and Topic Expert
0 Kudos

As you are using a destination (cl_web_http_client_manager=>create_by_http_destination( lo_destination )), you can also specify a timeout in the destination: go to transaction SM59, open the destination used here and then modify the timeout on the "Special Options" tab.

Sandra_Rossi
Active Contributor
0 Kudos
No SM59 in BTP.