Introduction to Field Catalog ( SLIS_T_FIELDCAT_ALV )

VN:F [1.9.3_1094]
Rating: 8.6/10 (9 votes cast)

In my previous post ( SAP ALV Tutorial : SAP ALV programming techniques), I tried to give a brief overview about what SAP ALV (SAP List Viewer) is and what are the different ways to use this UI tool of SAP in ABAP programs. In this post, we will dive into the details of  the first and simpler method of programming ALV – REUSE_ALV_ function modules.

In this post, we will begin with the most important programming aspect of an ALV termed Field Catalog. The field catalog is a common input required by all ALV whether you use REUSE_ALV_ methods or ABAP Class CL_GUI_ALV_GRID method. Neverthless, the data type of field catalog for both the methods are different, but they serve the same purpose.

So what’s an ALV field catalog?

In order to display some tabular data in an ALV, the ALV needs some information about the columns/ fields which will be displayed in the ALV. Field catalog is basically the internal table which carries information about each of the columns/ fields with which ALV has to deal with. It need not necessarily contain information about each of the columns/ fields in the data table used as data source of ALV. Only the fields which are important for display or of some technical use for ALV need to be informed to ALV through field catalog.

Ok!! I understood the purpose of field catalog. Tell me its technical details from REUSE_ALV_ method’s perspective!!!

Field catalog for REUSE_ALV_* function modules is a normal internal table of type SLIS_T_FIELDCAT_ALV from type group SLIS. So, in your program, you will have to include type group SLIS before you declare an internal table of type SLIS_T_FIELDCAT_ALV.

Report my_first_alv.
TYPE-POOLS: SLIS.
DATA: lt_field_catalog TYPE SLIS_T_FIELDCAT_ALV.

In this field catalog internal table, you have individual records for each of the columns/ fields to be displayed in ALV.

The only mandatory field in every record of field catalog is FIELDNAME. Your program using ALV will dump if this field is found empty in the field catalog.

Rest all fields are needed to control different aspects of a particular field but not mandatory. Your program would continue to work even if not completely as per your expectation.

I am mentioning below a list of most frequently used fields in field catalog structure along with their purpose.

KEY : This field indicates if the respective column is the key field in the tabular data to be displayed. The columns marked as ‘Key’ fields will always be positioned before the non-key fields. Example..

COL_POS : Specifies the position of column in the ALV display. If this property is not specified, the columns/fields of data table will appear in ALV display in the order in which their “fieldname” appear in the field catalog. “Key” fields will always have higher priority than non-key fields. You are free to use the same position number for key fields & non-key fields. However, if two key fields or non-key fields have been assigned the same position number, they will be displayed in the order in  their “fieldname” appear in the field catalog. Example..

Table of Contents: SAP ALV Tutorial

SAP ALV Tutorial : SAP ALV programming techniques

Introduction to Field Catalog ( SLIS_T_FIELDCAT_ALV )

VN:F [1.9.3_1094]
Rating: 8.6/10 (9 votes cast)
Introduction to Field Catalog ( SLIS_T_FIELDCAT_ALV ), 8.6 out of 10 based on 9 ratings
Hey friends!!! Don't forget to promote the post by pressing the buttons below, if you liked it...
  • Digg
  • del.icio.us
  • StumbleUpon
  • Twitthis
  • Yahoo! Buzz
  • Facebook
  • Technorati
  • LinkedIn

2 comments to Introduction to Field Catalog ( SLIS_T_FIELDCAT_ALV )

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>