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

AND RETURN.

ENDIF.

CATCH cx_bcs INTO lo_bcs_exception.

* If something goes wrong you probably want to send a simple failure

* message to the user and a more detailed one to the application log

ENDTRY.

Listing 11.31 Sending a Spreadsheet by Email

You will find that the ability to send out SAP-generated spreadsheets by email is

really the jewel in the crown of ABAP2XLSX. You will want to give people a P_

EMAIL parameter on the selection screen of all ABAP2XLSX-enabled reports

together with a Send Spreadsheet by Email checkbox so that when the report

runs (in the foreground or the backgr ound) a spreadsheet is emailed to the

address specified in the P_EMAIL selection parameter.

You can default to the email address of the current user by using BAPI_USER_GET_

DETAIL, or if you are using SAP ERP Huma n Capital Manageme nt (HCM), then

usually you can find the email address in Infotype 0105. Because the email

address is a selection parameter, the user can change his email address and send

the spreadsheet to someone else, or even to a distribution list.

11.2.9 Adding Hyperlinks to SAP Transactions

One of the best features of SAP reports (and SAP in general) is that when you see

something on the screen you are interested in, like a sales order number, you can

double-click it and be directed to the underlying document. However, if you send

people a spreadsheet and they go throug h it and find a sales order number they

really want to look at, then naturally they can’t just double-click the cell and have

the SAP screen pop up to show them—f or example—Transaction VA03 (Display

Sales Order). That would be impossible.

Or would it?

In a normal Excel spreadsheet, you can ha ve hyperlinks that, when clicked, take

you to a web page of some sort. ABAP2XLSX has a hyperlink object, which is concerned

with generating such URLs for embedding in spreadsheets generated from

SAP.

It has been said that one of the great leaps forward SAP has made in recent years

is the introduction of the ICF (Interne t Connection Framework), which enables

496

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

Saved successfully!

Ooh no, something went wrong!