Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Creating a Special Report

Former Member
0 Likes
954

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.

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.

7 REPLIES 7
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
907

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

Read only

0 Likes
907

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

Read only

Former Member
0 Likes
907

Program RSDEMO_TABLE_CONTROL might also be of interest.

Read only

0 Likes
907

Thanks for the help guys.

but actually is not a table control what I want to learn how to do. is more like a subroutine that paint the boxes

and created check boxes. the menu path is:

data dictionary(display any table) -> utilities -> table

contents -> Display (and then execute ).

I'm not so sure, but I believe that is not a table control; is more like a Interface created with different subroutines.

Regards,

Fidel.

Read only

0 Likes
907

Hi,

Do you want to create a selection-screen for the user to input search criteria to query data from database? If so, please take a look at SAP documentation for keywords like Parameters and Select-Options. If I have misumderstood the question, please elaborate your requirement in bit more detail.

Regards

Read only

0 Likes
907

Oh, that is a standard list display which in this case was generated thru classic ALV, I believe.

Regards,

Rich Heilman

Read only

0 Likes
907

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