Q
Problem solve Get help with specific problems with your technologies, process and projects.

Creating interative reports

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.
This was last published in February 2005

Dig Deeper on SAP HR management

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchManufacturingERP

SearchOracle

SearchDataManagement

SearchAWS

SearchBusinessAnalytics

SearchCRM

SearchContentManagement

SearchFinancialApplications

Close