Skip to Content
author's profile photo Former Member
Former Member

Creating a Special Report

Hi everyone,

I want to learn how to create a report just like the one

that appears when you display or want to change the data

of a particular transparent table.

I want to be able to create that interface (the checkboxes at front, the format of the output, looks like a table format if doesn't ring the bell, and the bottoms in the task bar).

If someone knows how to do this and can send me an example using the flight model data.... I'll appreciate it.

Thanks in advanced,

Fidel Peralta.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Feb 24, 2005 at 02:19 PM

    Sounds like you want to do a table control inside of a dynpro. The table control wizard inside of screen painter will help you a lot.

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

    • Here is a very quick & dirty example of a table control. You will need to create screen 100. Use the table control wizard to create your table control. Name the table control as ISPFLI_TC.

      
      report zrich_0002 .
      
      tables: spfli.
      
      data: ispfli type table of spfli with header line.
      
      data: ok_code type sy-ucomm,
            save_ok type sy-ucomm.
      
      * this will be generated by tc wizard
      controls: ispfli_tc type tableview using screen 0100.
      
      start-of-selection.
      
        select * into corresponding fields of table ispfli
                      from spfli.
      
        check sy-subrc = 0.
      
        call screen 100.
      *&---------------------------------------------------------------------*
      *&      Module  STATUS_0100  OUTPUT
      *&---------------------------------------------------------------------*
      module status_0100 output.
        set pf-status '0100'.
      *  SET TITLEBAR 'xxx'.
      
      endmodule.
      
      *&---------------------------------------------------------------------*
      *&      Module  ispfli_tc_change_tc_attr  OUTPUT
      *&---------------------------------------------------------------------*
      * this will be generated by tc wizard
      module ispfli_tc_change_tc_attr output.
        describe table ispfli lines ispfli_tc-lines.
      endmodule.
      
      *&---------------------------------------------------------------------*
      *&      Module  USER_COMMAND_0100  INPUT
      *&---------------------------------------------------------------------*
      
      module user_command_0100 input.
      
        save_ok = ok_code.
        case ok_code.
          when 'BACK'.
            leave program.
        endcase.
      
      endmodule.
      
      

      The flow logic in the screen should be as follows, most of this is generated by the table control wizard.

      
      PROCESS BEFORE OUTPUT.
      *&spwizard: pbo flow logic for tablecontrol 'ISPFLI_TC'
        module ISPFLI_TC_change_tc_attr.
      *&spwizard: module ISPFLI_TC_change_col_attr.
        loop at   ISPFLI
             with control ISPFLI_TC
             cursor ISPFLI_TC-current_line.
      *&spwizard:   module ISPFLI_TC_change_field_attr
        endloop.
      
       MODULE STATUS_0100.
      
      PROCESS AFTER INPUT.
      *&spwizard: pai flow logic for tablecontrol 'ISPFLI_TC'
        loop at ISPFLI.
          chain.
            field ISPFLI-CARRID.
            field ISPFLI-CONNID.
            field ISPFLI-COUNTRYFR.
            field ISPFLI-CITYFROM.
            field ISPFLI-AIRPFROM.
          endchain.
        endloop.
      *&spwizard: module ISPFLI_TC_change_tc_attr.
      *&spwizard: module ISPFLI_TC_change_col_attr.
      
       MODULE USER_COMMAND_0100.
      
      

      Good Luck.

      Rich Heilman

  • author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2005 at 10:50 PM

    Program RSDEMO_TABLE_CONTROL might also be of interest.

    Add a comment
    10|10000 characters needed characters exceeded

    • Here is a sample program which will show you how to do a standard list display via ALV. This is a very simple example. If you the user to interact with the list, it does get more complex.

      
      report zrich_0004
             no standard page heading.
      
      type-pools slis.
      
      data: fieldcat type slis_t_fieldcat_alv.
      
      data: begin of imara occurs 0,
            matnr type mara-matnr,
            maktx type makt-maktx,
            end of imara.
      
      * Selection Screen
      selection-screen begin of block b1 with frame title text-001 .
      select-options: s_matnr for imara-matnr .
      selection-screen end of block b1.
      
      start-of-selection.
      
        perform get_data.
        perform write_report.
      
      
      ************************************************************************
      *  Get_Data
      ************************************************************************
      form get_data.
      
        select  mara~matnr makt~maktx
                  into corresponding fields of table imara
                    from mara
                     inner join makt
                       on mara~matnr = makt~matnr
                          where mara~matnr in s_matnr
                            and makt~spras = sy-langu.
      
      endform.
      
      ************************************************************************
      *  WRITE_REPORT
      ************************************************************************
      form write_report.
      
        data: fc_tmp type slis_t_fieldcat_alv with header line.
        clear: fieldcat. refresh: fieldcat.
      
        clear: fc_tmp.
        fc_tmp-reptext_ddic    = 'Material Number'.
        fc_tmp-fieldname  = 'MATNR'.
        fc_tmp-tabname   = 'IMARA'.
        fc_tmp-outputlen  = '18'.
        fc_tmp-col_pos    = 2.
        append fc_tmp to fieldcat.
      
      
        clear: fc_tmp.
        fc_tmp-reptext_ddic    = 'Material'.
        fc_tmp-fieldname  = 'MAKTX'.
        fc_tmp-tabname   = 'IMARA'.
        fc_tmp-outputlen  = '40'.
        fc_tmp-col_pos    = 3.
        append fc_tmp to fieldcat.
      
      * CALL ABAP LIST VIEWER (ALV)
        call function 'REUSE_ALV_LIST_DISPLAY'
             exporting
                  it_fieldcat = fieldcat
             tables
                  t_outtab    = imara.
      
      endform.
      
      Regards,
      Rich Heilman
      
      

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.