![]() We can instantiate it by calling its factory() method (Factory Design Pattern) that requires an ALV parameter (we get back the reference in this parameter), and an internal table filled with business data that we want to display. To use the OO CL_SALV_TABLE class, we need to create an instance of it. Now, I am going to declare it in the global declaration area for the sake of the simplicity.ĭATA flight_schedule TYPE STANDARD TABLE OF spfli. To avoid any error, we need to declare flight_schedule as an internal table. SELECT * FROM spfli INTO TABLE flight_schedule UP TO 100 ROWS. In this subroutine, we are going to query the top 100 rows from the database table, SPFLI and save the received records into an internal table, flight_schedule. So first, we are going to query the actual flight schedule from the database, then initialize an ALV object, and finally display the ALV on the screen. In order to achieve this, we are going to organize the different responsibilities into small subroutines, like the get_flight_schedule, the initialize_alv, and the display_alv. ![]() In this blog post series, I will use the standard SAP Flight Model to demonstrate the usage of the CL_SALV_TABLE class, within this model I will use the SPFLI database table that contains a complete flight schedule (if your SPFLI database table is not filled with data, then first let's run the ABAP program, SAPBC_DATA_GENERATOR that will generate sample data for you).Īs you know me, I like the transparent and clean code. We are going to use the CL_SALV_TABLE's instance methods to get an instance of each CL_SALV classes that will help us to customize our ALV. In this blog post series, we will cover all the most commonly used settings. If we check the class CL_SALV_TABLE in the SE24 transaction, we can find many methods that we can use to customize our ALV list. ![]() I will demonstrate you different settings one by one that you can use later to customize your ALV lists. In this blog post series, we will focus on the CL_SALV_TABLE class. ![]() It consists of different ALVs such as table, hierarchy, and tree. Let's face it, the field catalogs are unnecessary, the settings are over-complicated.įortunately, in SAP Netweaver 2004, SAP introduced a new Object Oriented ALV list family class, called CL_SALV. I mostly used the standard function modules, such as REUSE_ALV_LIST_DISPLAY and the REUSE_ALV_HIERARCHICAL_LIST_DISPLAY. I used to get headache even if I had to implement a simple ALV list, since it's not simple as the 1x1. These programs usually consists of the following three parts: selection screen, database query, and ALV list. As an ABAP Developer, we often have to develop ABAP reports that displays some data from the database. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |