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

alv

Former Member
0 Likes
765

hi,

what for field catalog is used in alv?

Regards,

siri

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
743

The feild catalog is used to define the columns of the ALV output. There are many attributes which you can set for each column, these are all done using the field catalog.

Regards,

RIch Heilman

hi,

what for field catalog is used in alv?

Regards,

siri

4 REPLIES 4
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
744

The feild catalog is used to define the columns of the ALV output. There are many attributes which you can set for each column, these are all done using the field catalog.

Regards,

RIch Heilman

Read only

0 Likes
743

For example, here is a very simply example program which uses the field catalog to define the columns of the ALV grid.



report zrich_0003 .



* Global ALV Data Declarations
type-pools: slis.

* Internal Tables
data: begin of ialv occurs 0,
      test1(10) type c,
      test2(10) type c,
      end of ialv.

data: fieldcat  type slis_t_fieldcat_alv.

start-of-selection.

  perform get_data.
  perform call_alv.

*********************************************************************
*      Form  GET_DATA
*********************************************************************
form get_data.

  ialv-test1 = 'ABC'.
  ialv-test2 = 'DEF'.
  append ialv.

  ialv-test1 = 'GHI'.
  ialv-test2 = 'JKL'.
  append ialv.


  ialv-test1 = '123'.
  ialv-test2 = '456'.
  append ialv.


endform.                    "GET_DATA

************************************************************************

*  CALL_ALV
************************************************************************

form call_alv.


  perform build_field_catalog.


* Call ABAP List Viewer (ALV)
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      it_excluding = excluding
      it_fieldcat  = fieldcat
    tables
      t_outtab     = ialv.

endform.                    "CALL_ALV

************************************************************************

* BUILD_FIELD_CATALOG
************************************************************************

form build_field_catalog.


  clear: fieldcat. refresh: fieldcat.

  data: tmp_fc type slis_fieldcat_alv.

  tmp_fc-reptext_ddic = 'Test1'.
  tmp_fc-fieldname    = 'TEST1'.
  tmp_fc-tabname      = 'IALV'.
  tmp_fc-outputlen    = '10'.
  append tmp_fc to fieldcat.

  tmp_fc-reptext_ddic = 'Test2'.
  tmp_fc-fieldname    = 'TEST2'.
  tmp_fc-tabname      = 'IALV'.
  tmp_fc-outputlen    = '10'.
  append tmp_fc to fieldcat.


endform.                    "BUILD_FIELD_CATALOG

Regards,

Rich Heilman

Read only

Former Member
0 Likes
743

Hi Siri,

Fieldcatalog is used to design the display. say we need to display a table with 5 fields .. in normal report we loop the table and write the order in which we need to display, or if we need to display a checkbox, hotspot... all these options are mentioned in the fieldcatalog.

Regards,

Vidya.

Read only

Former Member