SAP - Run Report - Download - Loop

sap
studio

#1

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.


#2

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:


#3

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


#4

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.


#5

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


#6

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


#7

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


#8

Thanks! a visual would def be helpful!


#9

ChangeFileFormat.zip (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)


#10

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