SAP - Run Report - Download - Loop

I am running a report in SAP and have a variable for the sls org & DC - download the report and loop to select another sls org repeat until 4 sls orgs have been run and downloaded to excel. Once downloaded - open reports - format and save and email to an outlook user grp depending on the file name(sls org).

So I got the easy part - run report - download - format - email - how do I get it to loop around and select the other 3 sls orgs and repeat. I also have tried two different ways to format the excel report - using hot keys and if statements and also created a macro. Would prefer to use the macro, but I am having issues trying to get the execute macro activity to work as I can not get the excel file to save as an .xlsm.

Any help would be appreciated.

Why not store the report names, variants, dates and email addresses for the reports in an excel sheet and loop round the data table rows using the For Each loop? The loop should encompass the SAP run report - download - format - email process you mention. :sunglasses:

Thank you that is one approach I have considered and seems like the best solution.

Any thoughts on the macro - how do I take the SAP .xls download and then re-save as .xlsm in order for the execute macro activity to work. I haved tried save as and select item with no success.

Using the Excel Application scope, have a spreadsheet with a macro that renames all .xls files in a folder to .xlsx using the execute macro activity, incorporated into your workflow

Thanks - that’s easy for you to say! No clue what that would look like or how to execute.

Will try and post something here tomorrow if i get time!! :sunglasses:

Thanks! a visual would def be helpful! (17.0 KB)
Hi meada,

Please try this workflow - make sure you copy the Excel file to a folder called C:\Temp for the process to work…let me know how you get on. The Excel macro loops through the folder selected from the dialog box and saves any .xls files to .xlsx format. (Edited to explain how the macro works)

Thanks for this - does not fit my current needs - but will def keep it for future ones!

hi i need to dowload report from sap for pass 3 month day by day. example MB5B if i set it to run for today and dowload it. then again i want to dowload same report for wise need to run same process for pass 90 days seperatly. is theres a way to do it. kindly help me

Hi @Hasanthi_Devendra1

I would recommend to start here

Best regards, Lev