Unaware of the ALV report in SAP ABAP? Then this is the right tutorial to check what is SAP ABAP list view report and how to create a structure in the ALV report.
And finally, you can check How to Create SAP ABAP List View Report and call the structure in the ALV report from SAP ABAP.
Also, Read: How to Create a Package in SAP ABAP
Introduction to ALV Report in SAP ABAP
ALV (ABAP List View) report is one of the methods of showing the SAP table in a reporting manner. ALV reports are generally used in the different standard and custom transactions in all the modules.
Functions of ALV Report in SAP ABAP
- Sorting of the records
- Changing the columns
- Hiding the columns
- Changing the order of columns
- Downloading reports in HTML or Excel format.
Limitations in ALV Report
- 255 characters can be shown on a column of the report.
- In one single report, we can show 90 columns.
- Compares to the ALV grid display, the ALV list display will be effective.
Simple ALV Report in SAP ABAP
Here we will see how to create a simple ALV report in SAP ABAP. But it is mandatory to create a structure for the table before getting into ALV Report in SAP ABAP.
Create a Structure in SAP ALV Report
Follow the below steps to create a structure in the SAP ALV report.
Open SAP ABAP and on the home page type the se11 transaction code on the left side of the search bar and hit enter.
Here we are taking the example of company code T001 (Transaction Code) and for creating a structure, give the name which starts with Z in the Datatype field and click Create.
Next, it will ask us to choose Structure from the list of options and click the tickmark down.
Once, we click on Structure, Dictionary: Change Structure page will appear. Here type the short description as Company Code Details.
Then copy and paste the fields in the T001 table and paste it in the component and component type. Also, give the typing method as Types on the same page.
In this step, save this table by CTRL+S in the local object or in a package for creating an ALV report in SAP ABAP.
After saving the structure, we have to activate the structure to proceed with the next step to create an ALV report. Activate the table by clicking CTRL+F3 and clicking Tickmark at the end of the page.
This is the method to create a structure for the table that we are using in the ALV report in SAP ABAP.
Have a look: How to Create Lock Object in SAP ABAP?
Create ALV Report in SAP ABAP
We can start creating a simple ALV report in SAP ABAP by the usual method. Follow the below steps to do so.
Open SAP ABAP and on the home page type the Se38 transaction code on the left side of the search bar and hit enter.
Give the report name starting with Z and click Create. Here I have taken ZCC_T001_ALV (Since this is an ALV report for the company code T001, So I have chosen this). Naming conventions are at the user’s convenience.
Give a short description as the ALV report and choose the type of program as Executable Program and click Save at the down of the page.
Now, we can see the screen with our ALV report name on the ABAP Editor page.
Give the table name and start declaring the internal table and Work area. But every time we do not need to declare the table name, it depends upon the user’s wish. Here my table name is T001.
Tables: T001. DATA: IT_T001 TYPE STANDARD TABLE OF ZST_TOO1,***We are declaring Structure name here**** WA_T001 TYPE ZST_TOO1.
Write the Select statement to declare the field name in the ALV report.
SELECT BUKRS BUTXT ORT01 LAND1 FROM T001 INTO TABLE IT_T001 WHERE BUKRS IN S_BUKRS.
Once this is done, we have to save and activate it to move to the next step. Save by CTRL+S and activate by CTRL+F3.
Click on the Pattern on the ABAP editor at the top of the page. In the CALL FUNCTION column give the name REUSE_ALV_GRID_DISPLAY and click Tickmark at down.
Once we call the function in our ALV program, our screen will appear like the below image.
Here we have to uncomment the word EXPORTING and I_STRUCTURE_NAME then we have to the structure name as ZST_T001 that we created before the ALV report.
Give the internal table as IT-T001 in the t_outtab at the end of the report.
Save the ALV report by CRTL+S and activate it by CTRL+F3. Now check the Output by clicking the F8 key.
This is how we can create an ALV report in SAP ABAP.
Also, you may like some more SAP ABAP and SAP HANA tutorials:
- How to Create a Foreign Key in SAP ABAP
- How to Create Table in SAP ABAP [With Columns]
- How to Install ABAP Development Tools
- SAP HANA Cloud ABAP Environment
- Operators in SAP HANA Cloud
This is a simple ALV report in SAP ABAP. We just created an internal table with a select statement and called a function in the SAP ALV report. Below are the topics covered in this tutorial.
- Introduction to ALV report
- Functions of ALV report
- Limitations in the ALV report
- How to create a structure for the ALV report
- How to create an ALV report in SAP ABAP
I am Chris Waldron, working as a Senior SAP HANA Consultant at Halliburton, Houston, Texas, United States. I have been working in SAP for more than 15 years, especially in SAP IT consulting and business consulting. I worked in various industries in Sales & Distribution, Customer Relationship Management, banking, Risk Management, etc. And I am an SAP Certified Development Specialist – ABAP for SAP HANA 2.0 and SAP HANA Modeling Certified consultant. Read more