When SAP created SAP S/4HANA®, it looked to combine and simplify a number of transactions and processes from previous versions like SAP Business Suite and SAP ECC. Changes also came to ABAP, the underlying development language on which SAP S/4HANA is built, as well.
I’ve recently published a series of blogs on the SAP Community Network (SCN) that details the ABAP changes in SAP S/4HANA from a Consumer Industries perspective, but many of the updates across other industries. In these blogs, I am going to walk you through some technical aspects of using ABAP in SAP S/4HANA. The goal will be to focus on comparing older ABAP language features with a detailed explanation of the new ABAP syntax and SAP S/4HANA features.
Below is a preview of the first of this series, where we combine an Excel upload, Dynamic Select Option generation, display on a Popup Screen and show the results in ALV IDA created for HANA. The complete post can be found on SCN, with plenty of screenshots and code snippets to help you understand just how ABAP has transitioned from legacy SAP systems to SAP S/4HANA.
This blog is organized as follows:
- Program Overview
- Program Flow Diagram
- Excel File Format
- Program Walkthrough
- HANA and CDS Views
- Method Tutorial
- Method Chaining and NEW
- Read Excel Data
- Build Select Options
- Popup Selection Screen
- ALV IDA
- Complete Program
Software Versions discussed in this blog include:
- S/4HANA (SAP_BASIS 752, SAP_ABA 75C)
- SAPGUI Version 750
- Eclipse Version: Oxygen.3a Release (4.7.3a)
- Microsoft Excel (.xlsx capable)
Original Program Flow Diagram
New Program Flow Diagram
Excel File Format
The Excel file will contain either a Table, View or CDS View with the fields that you’d like to appear as Select-Options on your popup window. As an enhancement to the previous program, we will add a new row for a Transaction Code. This will allow us to execute the report via transaction code, without re-loading an Excel spreadsheet each time. In addition, we can store the configuration settings for many reports and their corresponding transaction codes.
Here is an example Excel file with 3 reports:
Column A will contain 3 labels for each report:
- Transaction Code
- Table, View or CDS View Name
- Selection Fields
Column B contains the actual Transaction Code, Table/View/CDS View name and a list of the fields you want to be included as Select Options on the Popup window.
For example, the first report:
- B1 = The Custom SAP Transaction Code
- B2 = Table, View or CDS View Name
- B3+ = List of fields to be included as Select Options
For the CDS View “S_BOOKINGS”, include the fields CARRIERID, FLIGHTDATE, CUSTOMERID, LOCALCURRENCYAMOUNT on the popup window as Select-Options whenever we execute the custom SAP Transaction code ZBOOKINGS.
The popup window for the above, would look like the following: