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: 

alv

Former Member
0 Kudos

what is alv feild catalog and whats its significance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

field catalog is the thing where you can how your field responds to user commands and how it works.

there is a type pool SLIS, in that you can find FIELD CATALOG. you can go through the different fields of that FIELDCATALOG, THEN YOU WILL COME TO KNOW WHAT IS FIELD CATALOG.

6 REPLIES 6

Former Member
0 Kudos

for defining the fields and attributes to be include inthe alv grid

Former Member
0 Kudos

Hi,

It is just like the properties of columns of alv report.

Rgds,

Bujji

Former Member
0 Kudos

Hi,

Field Catalog: We use another internal table to define specifications on how the fields of our list will be displayed. This internal table is called the “field catalog”. The field catalog must comprise some technical and additional information about display options for each column to be displayed. There are three procedures to generate the field catalog as “Automatic generation”, “Semi-automatic generation”, and “Manual generation”. The internal table for the field catalog must be referenced to the dictionary type “LVC_T_FCAT”.

Regards,

Satish

abdulazeez12
Active Contributor
0 Kudos

Hi

When u pass Internal Table (data u want to display ) using FM/Class .

We also pass Fieldcatalog .

FM matches the data and the fieldcatalog to display the data based on the fieldcatalog . For eg second column of the internal table is MATNR...

But in the FIeldcatalog you define Matnr position as column 1 .

So on the output you see Matnr comes in the first column .

Fieldcatalog determines/control manay such parameters .

The Field Catalog

Definition

The field cataog is a table of type LVC_T_FCAT that contains information on the fields to be displayed. The ALV uses this table to recognize the type of a field, for example.

Use

You can use fields of the catalog to determine the number format and column properties of the list to be displayed.

In some exceptional cases, it is not necessary to pass the field catalog (see also: Generating the Field Catalog Automatically).

Structure

The field catalog contains more than 60 fields, some of which are only used internally. Those fields that are relevant to application developers are described in Fields of the Field Catalog.

http://help.sap.com/saphelp_erp2004/helpdata/en/22/a3f5fed2fe11d2b467006094192fe3/content.htm

http://help.sap.com/saphelp_erp2004/helpdata/en/8e/5dc9bee10111d2b47e006094192fe3/content.htm

Field catalogs are nothing but a container used to define the output display properties of data to be output using alv.

U can refer the below program:

&----


*& Report ZALV *

*& *

&----


*& *

*& *

&----


REPORT zalv .

TYPE-POOLS SLIS.

TABLES: vbrk,

vbrp,

likp,

lips,

vbak,

vbap.

*DATA: BEGIN OF tbl_inv_header OCCURS 10,

vbeln LIKE vbrk-vbeln,

erdat LIKE vbrk-erdat,

kunnr LIKE vbrk-kunrg,

sfakn LIKE vbrk-sfakn,

xblnr LIKE vbrk-xblnr,

END OF tbl_inv_header,

BEGIN OF tbl_inv_item OCCURS 10,

vbeln LIKE vbrp-vbeln,

posnr LIKE vbrp-posnr,

vgbel LIKE vbrp-vgbel,

vgpos LIKE vbrp-vgpos,

aubel LIKE vbrp-aubel,

aupos LIKE vbrp-aupos,

matnr LIKE vbrp-matnr,

arktx LIKE vbrp-arktx,

werks LIKE vbrp-werks,

END OF tbl_inv_item.

DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

DATA: BEGIN OF tbl_inv OCCURS 10,

vbeln LIKE vbrk-vbeln,

erdat LIKE vbrk-erdat,

kunnr LIKE vbrk-kunrg,

sfakn LIKE vbrk-sfakn,

xblnr LIKE vbrk-xblnr,

posnr LIKE vbrp-posnr,

vgbel LIKE vbrp-vgbel,

vgpos LIKE vbrp-vgpos,

aubel LIKE vbrp-aubel,

aupos LIKE vbrp-aupos,

matnr LIKE vbrp-matnr,

arktx LIKE vbrp-arktx,

werks LIKE vbrp-werks,

END OF tbl_inv,

BEGIN OF tbl_sales OCCURS 10,

vbeln LIKE vbak-vbeln,

erdat LIKE vbak-erdat,

kunnr LIKE vbak-kunnr,

posnr LIKE vbap-posnr,

kwmeng LIKE vbap-kwmeng,

END OF tbl_sales,

BEGIN OF tbl_lips OCCURS 10,

vbeln LIKE lips-vbeln,

posnr LIKE lips-posnr,

lfimg LIKE lips-lfimg,

meins LIKE lips-meins,

END OF tbl_lips.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS s_werks FOR vbrp-werks OBLIGATORY.

PARAMETERS p_vkorg LIKE vbrk-vkorg OBLIGATORY. "Sales Organisation

SELECT-OPTIONS : s_vtweg FOR vbrk-vtweg,

"Distribution channel

s_spart FOR vbrk-spart, "Division

s_erdat FOR vbrk-erdat OBLIGATORY.

s_werks-sign = 'IE'.

s_werks-option = 'EQ'.

s_werks-low = '0001'.

s_werks-high = '1200'.

SELECTION-SCREEN END OF BLOCK b1.

IF s_vtweg IS INITIAL AND s_spart IS INITIAL.

SELECT p~vbeln

p~erdat

p~kunrg

p~sfakn

p~xblnr

q~posnr

q~vgbel

q~vgpos

q~aubel

q~aupos

q~matnr

q~arktx

q~werks

iNTO TABLE tbl_inv

FROM vbrk AS p

JOIN vbrp AS q

ON pvbeln = qvbeln

WHERE p~erdat IN s_erdat

AND p~vkorg = p_vkorg.

ELSEIF s_vtweg IS INITIAL.

SELECT p~vbeln

p~erdat

p~kunrg

p~sfakn

p~xblnr

q~posnr

q~vgbel

q~vgpos

q~aubel

q~aupos

q~matnr

q~arktx

q~werks

INTO TABLE tbl_inv

FROM vbrk AS p

JOIN vbrp AS q

ON pvbeln = qvbeln

WHERE p~erdat IN s_erdat

AND p~vkorg = p_vkorg

AND p~spart IN s_spart.

ELSEIF s_spart IS INITIAL.

SELECT p~vbeln

p~erdat

p~kunrg

p~sfakn

p~xblnr

q~posnr

q~vgbel

q~vgpos

q~aubel

q~aupos

q~matnr

q~arktx

q~werks

INTO TABLE tbl_inv

FROM vbrk AS p

JOIN vbrp AS q

ON pvbeln = qvbeln

WHERE p~erdat IN s_erdat

AND p~vkorg = p_vkorg

AND p~vtweg IN s_vtweg.

ELSE.

SELECT p~vbeln

p~erdat

p~kunrg

p~sfakn

p~xblnr

q~posnr

q~vgbel

q~vgpos

q~aubel

q~aupos

q~matnr

q~arktx

q~werks

INTO TABLE tbl_inv

FROM vbrk AS p

JOIN vbrp AS q

ON pvbeln = qvbeln

WHERE p~erdat IN s_erdat

AND p~vkorg = p_vkorg

AND p~vtweg IN s_vtweg

AND p~spart IN s_spart.

ENDIF.

WRITE 'Number of entries:'.

DESCRIBE TABLE tbl_lips LINES sy-tfill.

WRITE sy-tfill.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = 'ZALV'

I_INTERNAL_TABNAME = 'TBL_INV'

I_STRUCTURE_NAME =

I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = 'ZALV_68416'

I_BYPASSING_BUFFER =

I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = FIELDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

IF sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_INTERFACE_CHECK = ' '

I_BYPASSING_BUFFER = ' '

I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = 'ZALV'

TABLES

t_outtab = tbl_inv

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF sy-subrc 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Thanks

Shakir

Former Member
0 Kudos

resolved

Former Member
0 Kudos

field catalog is the thing where you can how your field responds to user commands and how it works.

there is a type pool SLIS, in that you can find FIELD CATALOG. you can go through the different fields of that FIELDCATALOG, THEN YOU WILL COME TO KNOW WHAT IS FIELD CATALOG.