14.01.2020 Views

ABAP_to_the_Future

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11

ABAP2XLSX

11.2 Enhancing Custom Reports with ABAP2XLSX

If you were to perform an inventory of what your users were doing with your

custom SAP reports, you would possibly find that they were running large reports

in batch every night and then calling up the spool request the next day and downloading

it to Excel. SAP lets you do that easily, but then you have to remove a few

blank columns from the top and the left . The user will then make the report

“pretty” by making the headers bold and adding colors (e.g., negative numbers in

red) and so forth and then will set up the print formatting so that the report prints

in landscape orientation. Quite often, conditional formatting is used to make

exceptional values jump out right into th e user’s face, making use of red traffic

lights and the like. Sometimes, several reports are merged into one spreadsheet

with multiple worksheets, or a worksheet is added that contains pretty bar and

pie charts. A common enhancement is to add macros to spreadsheets to enable all

sorts of groovy functionality, like sort ing a column when you double-click the

header (just like what happens inside SAP ALV reports).

Finally, the report is emailed out to various interested parties. When those interested

parties get the spreadsheet and open itup, a user might look at some figures

and say: “Oh, that’s interesting; that sales order has a red light to indicate a massive

negative margin. I wonder what’s going on there?” Then, that user goes into

SAP, runs a report to try and find that sales order, and then drills into the underlying

document to get to the root of the problem.

All in all, this is a whole lot of work—and it doesn’t have to be. This section will

go over each one of those tasks in tu rn to see how ABAP2XLSX makes each one

better.

11.2.1 Converting an ALV to an Excel Object

It is highly unlikely that you will create a report that only creates a spreadsheet.

The normal state of affairs is that you have an already existing custom report that

you want to enhance by using ABAP2XLSX to add extra options, such as to download

the report to a spreadsheet or email it to one or more people with all of the

formatting and features that would normally be manually added.

The normal situation starts when you have an SALV object or a CL_GUI_ALV_GRID

object, and you have finished adding sort criteria and hiding columns and saying

what columns should be subtotaled and so forth. You now want to turn this into

466

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

Saved successfully!

Ooh no, something went wrong!