Posted on Apr. 22, 2010 at 10.10 AM - Chennai, India
I have seen many developers who still use classical reporting to display data from their ABAP report. How much delightful the user would have been if they had used ALV instead. And actually creating a report using ALV is very easy, easier than classical reporting itself. Below are step by step required to implement ALV at the simplest form.
1. Declare ALV reference variable
* ALV reference variable
DATA: go_alv TYPE REF TO cl_salv_table.
2. Instantiate ALV class
* Instantiate ALV class
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_alv
CHANGING
t_table = gt_emp_records.
CATCH cx_salv_msg .
ENDTRY.
3. Call method display
* Display data in ALV
CALL METHOD go_alv->display
Easy huh!
Life is beautiful! Let's make it meaningful and colorful!