14.01.2020 Views

ABAP_to_the_Future

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

11

ABAP2XLSX

somebody from having to go through th is process manually each time. As you

might imagine, the whole purpose of ABAP2XLSX is to remove the need for this

sort of thing. However, that still leaves the other main purpose of macros, which

is to let the user navigate around complicated spreadsheets in the same way that

you can click icons within SAP and jump into related reports and transactions.

Realistically, the VBA (Visual Basic for Applications) programming language used

inside Excel spreadsheets is powerful enough that the range of things the macros

might be doing is limitless. The inventor of ABAP2XLSX decided it would not be

a very good idea to replicate the VBA language inside of SAP and thus enable

direct creation of a spreadsheet with a macro in the same way that you can generate

a spreadsheet with formatting and colors and charts.

You still want your users to be able to use their macros, though; if they cannot,

they’ll burst into tears. Some of these macros are no doubt works of art, making

SAP programs seem simplistic by comparison. The approach to take using

ABAP2XLSX is as follows:

1. Create a blank spreadsheet that contains all the desired macros.

2. Upload this blank, macro-enabled spreadsheet into SAP via ABAP2XLSX.

3. Download the blank sheet into the SAP database, where it will serve as a template.

4. When the SAP report is run, upload this template from the database; it becomes

your Excel object.

5. Populate the Excel object with the report data, and start formatting it as per

usual, with fonts, print settings, and al the trimmings, and then save the result

to the local drive or email it out.

When the final consumer op ens the spreadsheet, he will find his macros magically

working and will therefore not burst into tears, unless they’re tears of joy.

The next sections will cover each of the preceding steps one at a time.

Creating the Blank, Macro-Enabled Worksheet

On my very first day at work at my organization, I was a student working during

the summer prior to my final year at university. I was given a really boring task to

do, which involved manipulating a spreadsheet so that the data would come out

in a format that could then be given to a room full of people, who would punch

488

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!