How can I create interactive reports?
OK, I'm supplying a really basic report. All this does is create an output for IT0002, but with it you should be able to figure out how to go forward. Make sure that you read the documentation to actually understand it:
REPORT ZALVTEST . "PNP is listed as the logical database in attributes tables: pernr. infotypes: 0002. *Declarations needed for ALV. type-pools: slis. data: it_fieldcat type SLIS_T_FIELDCAT_ALV, st_fieldcat type slis_fieldcat_Alv, tabname type SLIS_TABNAME, reportname type sy-repid. *Definition for outtab. data: outtab type table of p0002 with header line. start-of-selection. reportname = sy-repid. tabname = 'OUTTAB'. *This function module sets up the field catalog for ALV. Read *documentation for more detail. CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING I_PROGRAM_NAME = reportname I_STRUCTURE_NAME = 'P0002' I_INTERNAL_TABNAME = tabname CHANGING CT_FIELDCAT = it_fieldcat EXCEPTIONS INCONSISTENT_INTERFACE = 1 PROGRAM_ERROR = 2 OTHERS = 3 . get pernr. rp-provide-from-last p0002 space pnpbegda pnpendda. move-corresponding p0002 to outtab. append outtab. clear outtab. end-of-selection. *Output ALV data. This FM takes the field catalog and the internal *table and outputs the information. You can use modify IT_FIELDCAT *to change attributes CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING I_CALLBACK_PROGRAM = reportname IT_FIELDCAT = it_fieldcat I_SAVE = 'X' TABLES T_OUTTAB = outtab EXCEPTIONS PROGRAM_ERROR = 1 OTHERS = 2 . IF SY-SUBRC <> 0. message e899(s1) with text-001. ENDIF.