All SAP time reports can be exported to an Excel spreadsheet. The purpose of exporting the SAP time reports is to. From the List drop down box click on.
Active1 year, 6 months ago
I am using the ExportAsFixedFormat method of EXCEL, in order to export a workbook in PDF through SAP.
Desired outcome: I want to save the entire workbook, instead of saving only the active sheet.
Issue: My problem is that I cannot use the range parameter as it seems that it has no effect in EXCEL.
I tried recording a macro in EXCEL using the Save As Type:PDF, and selecting the Entire Workbook in the Publish What section of the Options.
Unfortunately, whether you only set in the Options the Active Sheet(s), or the Entire Workbook, the macro that is recorded is exactly the same (shown bellow), since I guess the options are included in the IncludeDocProperties, which I cannot pass through my current method. Fancy pants adventure 3 unblocked.
Macro:
Taking into consideration the code bellow, which I am currently using in my class method. I am looking for a way to alter my selection of the Active Sheet(s) or finding a way to pass the desired option of publishing the Entire Workbook.
Please note that I want to find a solution through SAP coding and not through VBA, since my options are limited. Also the amount of sheets that are included in the Workbook is unknown, as they are populated dynamically. Using the select option would not be in favor of the application.
SAP Method:
Thanks in advance for any comments.
Community♦
SwPortalSwPortal
1 Answer
Your ABAP code actually shows the problem.
You are calling the method on the worksheet, and that will only export that worksheet.
What you need to do is call the method on the corresponding workbook to export all the sheets.
Here is some sample ABAP code that will create a workbook, populate two sheets and do the export. The result PDF has a page per sheet:
mydoghaswormsmydoghasworms13.8k88 gold badges5151 silver badges8181 bronze badges