*&---------------------------------------------------------------------**& Report ZRC_REP6*&*&---------------------------------------------------------------------**&*&*&---------------------------------------------------------------------*REPORT zrc_rep6.*----------------------------------------------------------------------** CLASS lcl_report DEFINITION*----------------------------------------------------------------------***----------------------------------------------------------------------*CLASS lcl_report DEFINITION.PUBLIC SECTION.METHODS:extract,display.PRIVATE SECTION.DATA:t_mara TYPE TABLE OF mara.ENDCLASS. "lcl_report DEFINITIONDATA:o_report TYPE REF TO lcl_report.SELECTION-SCREEN BEGIN OF BLOCK file WITH FRAME TITLE text-001.PARAMETERS:p_sub(2),p_year(4).SELECTION-SCREEN end OF BLOCK file.SELECTION-SCREEN BEGIN OF BLOCK options WITH FRAME TITLE text-002.SELECT-OPTIONS:s_date FOR something.SELECTION-SCREEN end OF BLOCK options.START-OF-SELECTION.CREATE OBJECT o_report.o_report->extract( ).END-OF-SELECTION.o_report->display( ).*----------------------------------------------------------------------** CLASS lcl_report IMPLEMENTATION*----------------------------------------------------------------------***----------------------------------------------------------------------*CLASS lcl_report IMPLEMENTATION.METHOD extract.SELECT * INTO TABLE t_maraFROM mara UP TO 5 ROWS.ENDMETHOD. "extractMETHOD display.DATA:l_o_table TYPE REF TO cl_salv_table.* Get the ALV object refering to the output tableTRY.cl_salv_table=>factory(IMPORTINGr_salv_table = l_o_tableCHANGINGt_table = t_mara ).CATCH cx_salv_msg. "#EC NO_HANDLERENDTRY.* Add basic default functionality in the ALV report* FunctionsDATA:l_o_functions TYPE REF TO cl_salv_functions_list.l_o_functions = l_o_table->get_functions( ).l_o_functions->set_all( abap_true ).* Display the listl_o_table->display( ).ENDMETHOD. "extractENDCLASS. "lcl_report IMPLEMENTATION
Wednesday, March 04, 2009
Basic template for writing OO Report in ALV format
Labels:
alv list,
example,
programming
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment