Application Development 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: 

What is Field catalog pls urgent

Former Member
0 Kudos

Right now I am working on ALV, in that I am using REUSE_ALV_GRID_DISPLAY FM, but the parameters for this FM are an internal table name and a field catalog so i am confused that what field catalog is? Please help me out its very urgent. Thanks in advance.

By Ashok V

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

<b>Field catalog</b>

The field catalog describes the internal data table fields. It is itself an internal table containing an entry for each column in the data table. The field catalog entry determines column output options.

<b>Creating the field catalog</b>

The field catalog can be constructed in various ways:

<b>Manual</b>

Each field catalog entry is explicitly coded into the field catalog by the ALV caller.

Fields with DDIC link must have at least the following field catalog entries:

FIELDCAT-FIELDNAME " Internal output table field name

FIELDCAT-REF_TABNAME " DDIC reference structure name

Fields with no DDIC link must have at least the following field catalog entries:

FIELDCAT-FIELDNAME " Internal output table field name

FIELDCAT-DATATYPE " Internal output table field data type

FIELDCAT-OUTPUTLEN " Column width

and at least one of the four text fields FIELDCAT-SELTEXT_L, FIELDCAT-SELTEXT_M, FIELDCAT-SELTEXT_S, REPTEXT_DDIC.

The field FIELDCAT-TABNAME in the field catalog of hierarchical-sequential lists must also contain the name of the internal output table, to assign columns uniquely to the header or item table. This field must not be filled manually in simple lists.

<b>Automatic</b>

A field catalog need not be passed to ALV under the following condition:

the structure of the internal output table is identical to a DDIC structure or table.

The name of the structure or table is passed to ALV instead of the field catalog.

All columns in the structure are displayed.

<b>Semi-automatic</b>

This mode is a combination of automatic and manual:

the automatically created field catalog can be modified by a manually created field catalog.

If a structure name for an automatic field catalog and a field catalog are both passed, the system determines the field catalog information from them both:

• If the manually created and passed field catalog contains entries for fields which are not described by the DDIC structure, they are added to the field catalog created by the System.

• If the manually created and passed field catalog contains entries for fields which are also described by the DDIC structure, they overwrite the DDIC information.

The system creates field catalogs automatically and semi-automatically from the DDIC reference structure passed to ALV. ALV calls the function module REUSE_ALV_FIELDCATALOG_MERGE which creates the field catalog and adjusts it with an explicit field catalog (semi-automatic mode). This function module can also be called directly by the application (before ALV). This makes the creation of the field catalog by the application flexible.

Hope u understood.

Kindly reward points if u find it useful.

Thanks&Regards,

Ruthra

4 REPLIES 4

Former Member
0 Kudos

Field catalog lists out the fields of the output ALV, their attributes etc.

Read the documentation here

http://help.sap.com/saphelp_47x200/helpdata/en/52/5f060ae02d11d2b47d006094192fe3/frameset.htm

Former Member
0 Kudos

Hi,

The field catalog is an internal table to define specifications on how the fields of our list will be displayed. The field catalog must contain some technical and additional information about display options for each column to be displayed.

The documentation on the function module has some explanations about the attributes of the field catalog.

Regards,

-Ramesh

former_member425121
Participant
0 Kudos

In the internal table you put the records to show in the ALV Grid (that records have columns) but in the Field Catalog you give the list of that fields (columns) contained in the internal table.

For example, if your internal table to report has 3 fields:

DATA: BEGIN OF T_OUTPUT OCCURS 0,

BUKRS LIKE BKPF-BUKRS,

BELNR LIKE BKPF-BELNR,

GJAHR LIKE BKPF-GJAHR,

END OF T_OUTPUT.

(Fill, for example, the Output Table with standard table BKPF)

Then , you put in the Field Catalog these 3 fields:

CLEAR gt_fieldcat.

gt_fieldcat-fieldname = 'BUKRS'. " Field (column) name

gt_fieldcat-tabname = 'T_OUTPUT'. " Output Table

gt_fieldcat-ref_tabname = 'BKPF'. " Reference Table

gt_fieldcat-ref_fieldname = 'BUKRS'. " Reference Field

APPEND gt_fieldcat.

CLEAR gt_fieldcat.

gt_fieldcat-fieldname = 'BELNR'.

gt_fieldcat-tabname = 'T_OUTPUT'.

gt_fieldcat-ref_tabname = 'BKPF'.

gt_fieldcat-ref_fieldname = 'BELNR'.

APPEND gt_fieldcat.

CLEAR gt_fieldcat.

gt_fieldcat-fieldname = 'GJAHR'.

gt_fieldcat-tabname = 'T_OUTPUT'.

gt_fieldcat-ref_tabname = 'BKPF'.

gt_fieldcat-ref_fieldname = 'GJAHR'.

APPEND gt_fieldcat.

And then call the function to set the ALV Grid.

Regards

Frank

Former Member
0 Kudos

Hi,

<b>Field catalog</b>

The field catalog describes the internal data table fields. It is itself an internal table containing an entry for each column in the data table. The field catalog entry determines column output options.

<b>Creating the field catalog</b>

The field catalog can be constructed in various ways:

<b>Manual</b>

Each field catalog entry is explicitly coded into the field catalog by the ALV caller.

Fields with DDIC link must have at least the following field catalog entries:

FIELDCAT-FIELDNAME " Internal output table field name

FIELDCAT-REF_TABNAME " DDIC reference structure name

Fields with no DDIC link must have at least the following field catalog entries:

FIELDCAT-FIELDNAME " Internal output table field name

FIELDCAT-DATATYPE " Internal output table field data type

FIELDCAT-OUTPUTLEN " Column width

and at least one of the four text fields FIELDCAT-SELTEXT_L, FIELDCAT-SELTEXT_M, FIELDCAT-SELTEXT_S, REPTEXT_DDIC.

The field FIELDCAT-TABNAME in the field catalog of hierarchical-sequential lists must also contain the name of the internal output table, to assign columns uniquely to the header or item table. This field must not be filled manually in simple lists.

<b>Automatic</b>

A field catalog need not be passed to ALV under the following condition:

the structure of the internal output table is identical to a DDIC structure or table.

The name of the structure or table is passed to ALV instead of the field catalog.

All columns in the structure are displayed.

<b>Semi-automatic</b>

This mode is a combination of automatic and manual:

the automatically created field catalog can be modified by a manually created field catalog.

If a structure name for an automatic field catalog and a field catalog are both passed, the system determines the field catalog information from them both:

• If the manually created and passed field catalog contains entries for fields which are not described by the DDIC structure, they are added to the field catalog created by the System.

• If the manually created and passed field catalog contains entries for fields which are also described by the DDIC structure, they overwrite the DDIC information.

The system creates field catalogs automatically and semi-automatically from the DDIC reference structure passed to ALV. ALV calls the function module REUSE_ALV_FIELDCATALOG_MERGE which creates the field catalog and adjusts it with an explicit field catalog (semi-automatic mode). This function module can also be called directly by the application (before ALV). This makes the creation of the field catalog by the application flexible.

Hope u understood.

Kindly reward points if u find it useful.

Thanks&Regards,

Ruthra