Abap , oop alv display

Merhaba oop yapısı ile alv raporlama.

 

start-of-selection.

data lo_report type ref to lcl_report.

create OBJECT lo_report.

lo_report->get_data).
lo_report->generate_output).

*———————————————————————-

*       CLASS lcl_report IMPLEMENTATION
*———————————————————————-

*
*———————————————————————-

class lcl_report implementation.

method get_data.
select vbeln erdat auart kunnr
into CORRESPONDING FIELDS OF TABLE itab
from vbak
up to 20 rows.

endmethod.                    “get_data

method generate_output.

data lx_msg type ref to cx_salv_msg.
try.
cl_salv_table=>factory(
importing
r_salv_table o_alv
* itabın içindekileri o_alv ye yaz , o_alv bize dönderdiği değerdir.
changing
t_table itab ).
catch cx_salv_msg into lx_msg.

endtry.

o_alv->display).

endmethod.                    “generate_output
endclass.                    “lcl_report IMPLEMENTATION

You may also like...

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

This site uses Akismet to reduce spam. Learn how your comment data is processed.