I am using CL_HTTP_CLIENT and trying to download a Excel file from HTTPS URL in ABAP
Basically, the URL points to Excel export / download functionality of a reporting web application
When I directly input the URL in browser, it simply starts the Excel download in background (can be seen by clicking the Downloads)
I can’t reveal the actual URL as it is intranet but it is similar to the below URL
https://www.tesourodireto.com.br/data/files/EE/E3/A1/59/6266F610BB8E41E6894D49A8/LFT_2019.xls
The above link directly points to an existing static Excel file but the URL I am talking about executes the action “generate the report and export it as Excel sheet” which then behaves like the above link. It also allows filtering criteria for generating the report as parameters in URL
It looks like
https://example.com/sap/crp/cdo?type=CRP_L&list=36&$ge$contract_signed_date=20240401&$product_group_id=XYZ&chart_display=true&chart_type=line&csv=X
contract_signed_date and product_group_id are filter parameters and last parameter csv=X is an instruction to the server to export the report as Excel spreadsheet output
While the Excel file download in the background, the browser shows blank html body as response
Right now I am able to get only this blank html body as response using CL_HTTP_CLIENT client with lo_http_client->response->get_data( )
How to capture the Excel file that silently gets downloaded in the background?
Hope, I am able to explain well… please let me know
Vishnu Tallapragada is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.