I try to download a huge Report as a Spreadsheet (Excel file “.xlsx”) from SAP which is about 30MB big. The problem I am facing, in the end the file should be uploaded to the Sharepoint, which is not directly possible within SAP.
Here are my steps after I triggered the download
Check which GUI appears for the upcoming download
Fillout the path and filename
Generate the Excel file
After the Download, the Excel file opens automatically
To time the next step, which is about to kill all open Excel files (otherwise it could be in use when I try to upload it to Sharepoint)
Check if the Excel file is fully loaded to perform the kill
I was facing some problems when I just tried with a simple delay. Sometimes no Excel file was found and sometimes it was killed. And I dont want to block the bots longer than needed, beacuse i know a simple delay of 30min would hellp.
What Activities I tried so far:
Element exists within a Do while Loop → Tried to check the Header name of the file
Element exists with a Retry Scope → Tried to check the Header name of the file
Check App state → Tried to check the Header name of the file
Check App State → Check Range A1
Do you have any ideas how to make it 100% trust worthy?
So the Path Exists activity just gives an output when the file is fully loaded? So in combination with Retry Scope or do while this should fix my problem?
So I tried both suggested Activities, but they didn’t work out.
The wait for download activity had 2 problems:
I have a longer if statement after I use the Download trigger
This results in an Denied Error from SAP
The Path Exists Activity inside a do while showed the same problem as before, that the file wasn’t fully loaded and the kill process didnt’ recognize any open Excel files.
This was put inside the Do Loop from the wait for download activity
Not sure what you have done in wait for downalod…it shpuld be working if the file already does not exist
Now another work around is in excel left bottom ypu would see done or ready once the excel is completely downloaded and ready to be used…may be you can try indicating the same in check app state
And thats what I did with the Wait for Download Activity:
In the monitored Folder I just put my Desktop (thats the location where SAP Should save it) → Didnt recognize it, so the Kill Process didnt find anyopen Excel files and the upcoming error was during saving the file on the Sharepoint, cause the Excel file was in use… Yes it was open
I put the Path and File into the Var which also ended in an error from SAP: Access denied sy-subrc: 15 → but that’s beacuse he’s then creating the folder on the Desktop named xxx.xlsx